nice routing

This commit is contained in:
talksik
2022-01-31 00:00:08 -08:00
parent 16c8d26476
commit 6a349f2227
5 changed files with 38 additions and 18 deletions
+4 -7
View File
@@ -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"