Skip to content

Commit

Permalink
Remove the useNavigation from header
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihbaltaci committed Feb 6, 2025
1 parent 67daa13 commit 7c18c47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gurubase-frontend/src/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useUser } from "@auth0/nextjs-auth0/client";
import { Icon } from "@iconify/react";
import clsx from "clsx";
import { usePathname } from "next/navigation";
import { usePathname, useRouter } from "next/navigation";
import { memo, useState } from "react";

import GuruBaseLogo from "@/components/GuruBaseLogo";
Expand Down Expand Up @@ -79,11 +79,12 @@ const Header = memo(({ guruType, allGuruTypes, sidebarExists = false }) => {
(state) => state.mainForm.postContentExist
);
const navigation = useAppNavigation();
const router = useRouter();

const handleNavigate = (path) => {
const returnTo = encodeURIComponent(pathname);

navigation.push(`${path}?returnTo=${returnTo}`);
router.push(`${path}?returnTo=${returnTo}`);
};

const isSelfHosted = process.env.NEXT_PUBLIC_NODE_ENV === "selfhosted";
Expand Down

0 comments on commit 7c18c47

Please sign in to comment.