@@ -2,14 +2,18 @@ import Link from "next/link";
22import { useRouter } from "next/router" ;
33import { CirclesFour , CirclesThreePlus , X } from "phosphor-react" ;
44import { Dispatch , SetStateAction , useState } from "react" ;
5+ import cx from "clsx" ;
56import ToggleThemeBtn from "./toggle-dark-theme-btn" ;
67
78type useEffectProps = {
89 isOpenedModal : boolean
910 setIsOpenedModal : Dispatch < SetStateAction < boolean > >
1011}
1112
12- export default function NavBar ( { isOpenedModal, setIsOpenedModal } : useEffectProps ) {
13+ export default function NavBar ( {
14+ isOpenedModal,
15+ setIsOpenedModal
16+ } : useEffectProps ) {
1317 const router = useRouter ( ) ;
1418 const [ effect , setEffect ] = useState ( false ) ;
1519
@@ -19,33 +23,33 @@ export default function NavBar({ isOpenedModal, setIsOpenedModal }: useEffectPro
1923
2024 return (
2125 < nav className = "flex justify-center items-center" >
22- < ul className = "hidden sm:flex justify-stretch items-cente gap-x-3" >
23- < li className = { ` ${ router . pathname == "/" && "light: text-zinc-900/90 dark:fill-zinc-400/90 font-medium" } font-normal sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-lg md:w-20 select-none` } >
26+ < ul className = "hidden sm:flex sm: justify-stretch sm: items-cente sm: gap-x-3" >
27+ < li className = { cx ( router . pathname == "/" && "text-zinc-900/90 dark:fill-zinc-400/90 font-semibold" , " font-medium sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-base md:w-20 select-none" ) } >
2428 < Link href = "/" > Home</ Link >
2529 </ li >
26- < li className = { ` ${ router . pathname == "/about" && "light: text-zinc-900/90 dark:fill-zinc-400/90 font-medium" } font-normal sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-lg md:w-20 select-none` } >
30+ < li className = { cx ( router . pathname == "/about" && "text-zinc-900/90 dark:fill-zinc-400/90 font-semibold" , " font-medium sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-base md:w-20 select-none" ) } >
2731 < Link href = "/about" > About</ Link >
2832 </ li >
29- < li className = { ` ${ router . pathname == "/projects" && "light: text-zinc-900/90 dark:fill-zinc-400/90 font-medium" } font-normal sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-lg md:w-20 select-none` } >
33+ < li className = { cx ( router . pathname == "/projects" && "text-zinc-900/90 dark:fill-zinc-400/90 font-semibold" , " font-medium sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-base md:w-20 select-none" ) } >
3034 < Link href = "/projects" > Projects</ Link >
3135 </ li >
32- < li className = { ` ${ router . pathname == "/contact" && "light: text-zinc-900/90 dark:fill-zinc-400/90 font-medium" } font-normal sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-lg md:w-20 select-none` } >
36+ < li className = { cx ( router . pathname == "/contact" && "text-zinc-900/90 dark:fill-zinc-400/90 font-semibold" , " font-medium sm:min-w-max sm:w-16 sm:flex sm:justify-center hover:text-violet-900/80 hover:transition hover:duration-75 hover:ease-in-out md:text-base md:w-20 select-none" ) } >
3337 < Link href = "/contact" > Contact</ Link >
3438 </ li >
3539 </ ul >
3640
3741 < hr className = "hidden sm:block w-0.5 h-5 bg-separator/80 dark:bg-white/25 mx-5 md:mx-7 shadow-md rounded-full" />
3842
3943 < button
40- className = { ` relative z-50 text-2xl hover:text-violet-900/80 dark:hover:text-violet-300/70 ${ effect && "animate-effect" } mr-3` }
44+ className = { cx ( " relative z-50 text-2xl hover:text-violet-900/80 dark:hover:text-violet-300/70" , effect && "animate-effect" , " mr-3" ) }
4145 onClick = { ( ) => {
4246 setEffect ( true ) ;
4347 changeCurrentStateModal ( ) ;
4448 } }
4549 onAnimationEnd = { ( ) => setEffect ( false ) }
4650 >
4751 {
48- effect ? < CirclesFour size = { 25 } /> : ( isOpenedModal ? < X size = { 25 } /> : < CirclesThreePlus size = { 25 } /> )
52+ effect ? < CirclesFour size = { 25 } /> : ( isOpenedModal ? < X size = { 25 } /> : < CirclesThreePlus size = { 25 } /> )
4953 }
5054 </ button >
5155
0 commit comments