Skip to content

Commit

Permalink
Feat: implement back button in settings side nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Feng-09 committed Aug 25, 2024
1 parent 3af8d50 commit 1d82194
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "lucide-react";
import { useSession } from "next-auth/react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { usePathname, useRouter } from "next/navigation";
import { FC, ForwardRefExoticComponent, RefAttributes } from "react";

import { useOrgContext } from "~/contexts/orgContext";
Expand Down Expand Up @@ -97,14 +97,15 @@ const SettingsSidebar: FC<Iproperties> = ({ sideNavitems = sideItems }) => {
const organizationPath = pathname?.split("/")[4];
const { organizations } = useOrgContext();
const { data: session } = useSession();
const router = useRouter();

const organization = organizations.find(
(org) => org.organisation_id === session?.currentOrgId,
);

return (
<div className="h-screen w-[50px] flex-col items-center justify-center bg-[#FAFAFA] pt-6 md:block md:w-[304px] md:justify-start md:px-4">
<div className="mb-6 flex items-center justify-center md:justify-start md:gap-2">
<div className="mb-6 flex items-center justify-center md:justify-start md:gap-2 hover:cursor-pointer" onClick={() => router.push("/dashboard")}>
<ChevronLeft className="h-5 w-5 text-neutral-dark-2" />
<h2 className="hidden text-xl text-neutral-dark-2 md:block">
Settings
Expand Down

0 comments on commit 1d82194

Please sign in to comment.