nice routing
This commit is contained in:
@@ -15,11 +15,13 @@ import {
|
||||
} from "react-icons/fa";
|
||||
import { HiSpeakerphone } from "react-icons/hi";
|
||||
import Routes from "@nirvana/common/helpers/routes";
|
||||
import Link from "next/link";
|
||||
import { useRecoilValue } from "recoil";
|
||||
import { currPagePath } from "../../recoil/main";
|
||||
|
||||
function Sidebar() {
|
||||
const router = useRouter();
|
||||
const currPage = router.pathname;
|
||||
|
||||
const currPage = useRecoilValue(currPagePath);
|
||||
|
||||
const handleRoute = (route: Routes) => {
|
||||
router.push(route);
|
||||
@@ -35,11 +37,6 @@ function Sidebar() {
|
||||
|
||||
{/* navigation items */}
|
||||
<div className="flex flex-col my-5 space-y-5 w-full">
|
||||
<Link href={Routes.convos}>{Routes.convos}</Link>
|
||||
<Link href={Routes.later}>{Routes.later}</Link>
|
||||
<Link href={Routes.done}>{Routes.done}</Link>
|
||||
<Link href={Routes.drawer}>{Routes.drawer}</Link>
|
||||
|
||||
<span
|
||||
onClick={() => handleRoute(Routes.convos)}
|
||||
className="flex flex-row items-center hover:cursor-pointer transition-all group"
|
||||
|
||||
Reference in New Issue
Block a user