From 829223d4e29e97ce50fc461a89cdbb5fd711473b Mon Sep 17 00:00:00 2001 From: Peam Date: Sun, 16 Jul 2023 12:31:59 +0700 Subject: [PATCH] fix --- src/components/Navbar.tsx | 170 +++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index d3619c6..9f7363d 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -4,96 +4,96 @@ import { useCallback, type FC, useEffect, useState } from "react"; import { twMerge } from "tailwind-merge"; export interface INavbarProps { - data: { name: string; href: string }[]; + data: { name: string; href: string }[]; } export const Navbar: FC = (props) => { - const { data } = props; - const router = useRouter(); - const [path, setPath] = useState("/"); - const user = useSession(); + const { data } = props; + const router = useRouter(); + const [path, setPath] = useState("/"); + const user = useSession(); - const isActive = useCallback( - (href: string): boolean => { - const res = path.includes(href); - return res; - }, - [path] - ); + const isActive = useCallback( + (href: string): boolean => { + const res = path.includes(href); + return res; + }, + [path] + ); - useEffect(() => { - setPath(router.asPath); - }, [router.asPath]); + useEffect(() => { + setPath(router.asPath); + }, [router.asPath]); - return ( - - ); +
+ + +
+ + + + ); };