diff --git a/src/components/GNB/GNB.tsx b/src/components/GNB/GNB.tsx index b0cb983f..c6ff91a5 100644 --- a/src/components/GNB/GNB.tsx +++ b/src/components/GNB/GNB.tsx @@ -1,13 +1,32 @@ import Image from 'next/image'; import Link from 'next/link'; +import { useRouter } from 'next/router'; import { css } from '@emotion/react'; import { Button } from '~/components/Button'; -import { GNB_MENU_NAME } from '~/constant/gnb'; +import { GNB_MENU_NAME, GNBMenu } from '~/constant/gnb'; import { colors } from '~/styles/colors'; const LOGO_IMAGE = `/images/logo.png`; + +function ApplyButton({ menu }: { menu: GNBMenu }) { + return ( + + ); +} + export function GNB() { + const { pathname } = useRouter(); + const getActiveLinkcss = (menu: GNBMenu) => { + if (pathname.startsWith(menu.href)) { + return activeLinkCss; + } + return inActiveLinkCss; + }; return (