|
|
@ -22,13 +22,20 @@ export default function Nav({ type = 'server' }: { type?: NextComponentType }) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pathMatch = (path: string) => {
|
|
|
|
|
|
|
|
if (path === '/') {
|
|
|
|
|
|
|
|
return pathName === path || /^\/vol\//.test(pathName) || /^\/music\//.test(pathName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return pathName === path;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<nav>
|
|
|
|
<nav>
|
|
|
|
<ul className="flex flex-row items-center space-x-[40px]">
|
|
|
|
<ul className="flex flex-row items-center space-x-[40px]">
|
|
|
|
{menuList.map(({ name, path }) => (
|
|
|
|
{menuList.map(({ name, path }) => (
|
|
|
|
<li
|
|
|
|
<li
|
|
|
|
key={path}
|
|
|
|
key={path}
|
|
|
|
className={`text-[18px] leading-[25.2px] font-medium hover:text-[rgba(0,0,0,0.95)] ${pathName === path || (path === '/' && /^\/vol\//.test(pathName)) ? 'text-[rgba(0,0,0,0.95)]' : 'text-[rgba(0,0,0,0.4)]'}`}
|
|
|
|
className={`text-[18px] leading-[25.2px] font-medium hover:text-[rgba(0,0,0,0.95)] ${pathMatch(path) ? 'text-[rgba(0,0,0,0.95)]' : 'text-[rgba(0,0,0,0.4)]'}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{type === 'server' ? <Link href={path}>{name}</Link> : <ClientLink href={path}>{name}</ClientLink>}
|
|
|
|
{type === 'server' ? <Link href={path}>{name}</Link> : <ClientLink href={path}>{name}</ClientLink>}
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|