mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 23:16:52 +00:00
slug 调整兼容已有主题
This commit is contained in:
@@ -5,20 +5,24 @@ export const MenuItemNormal = props => {
|
||||
const router = useRouter()
|
||||
|
||||
const { link } = props
|
||||
const selected = (router.pathname === link.to) || (router.asPath === link.to)
|
||||
const selected = router.pathname === link.href || router.asPath === link.href
|
||||
|
||||
return <Link
|
||||
key={link.to}
|
||||
title={link.to}
|
||||
href={link.to}
|
||||
className={'py-2 px-5 duration-300 text-base justify-between hover:bg-gray-700 hover:text-white hover:shadow-lg cursor-pointer font-light flex flex-nowrap items-center ' +
|
||||
(selected ? 'bg-indigo-500 text-white ' : ' text-black dark:text-white ')}>
|
||||
|
||||
<div className='my-auto items-center justify-between flex '>
|
||||
return (
|
||||
<Link
|
||||
key={link.href}
|
||||
title={link.href}
|
||||
href={link.href}
|
||||
className={
|
||||
'py-2 px-5 duration-300 text-base justify-between hover:bg-gray-700 hover:text-white hover:shadow-lg cursor-pointer font-light flex flex-nowrap items-center ' +
|
||||
(selected
|
||||
? 'bg-indigo-500 text-white '
|
||||
: ' text-black dark:text-white ')
|
||||
}>
|
||||
<div className='my-auto items-center justify-between flex '>
|
||||
<i className={`${link.icon} w-4 ml-3 mr-6 text-center`} />
|
||||
<div >{link.name}</div>
|
||||
</div>
|
||||
{link.slot}
|
||||
|
||||
</Link>
|
||||
<div>{link.name}</div>
|
||||
</div>
|
||||
{link.slot}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user