mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
little fix
This commit is contained in:
@@ -32,7 +32,7 @@ export default function CategoryBar(props) {
|
||||
return <div id='category-bar' className={`flex flex-nowrap justify-between items-center h-12 mb-4 space-x-2 w-full lg:bg-white dark:lg:bg-[#1e1e1e]
|
||||
${border ? 'lg:border lg:hover:border dark:lg:border-gray-800 hover:border-indigo-600 dark:hover:border-yellow-600 ' : ''} py-2 lg:px-2 rounded-xl transition-colors duration-200`}>
|
||||
|
||||
<div id='category-bar-items' ref={categoryBarItemsRef} className='max-w-4xl rounded-lg scroll-hidden flex justify-start flex-nowrap items-center overflow-x-scroll'>
|
||||
<div id='category-bar-items' ref={categoryBarItemsRef} className='scroll-smooth max-w-4xl rounded-lg scroll-hidden flex justify-start flex-nowrap items-center overflow-x-scroll'>
|
||||
<MenuItem href='/' name={locale.NAV.INDEX} />
|
||||
{categoryOptions?.map((c, index) => <MenuItem key={index} href={`/category/${c.name}`} name={c.name} />)}
|
||||
</div>
|
||||
|
||||
@@ -20,6 +20,9 @@ export const MenuItem = ({ link }) => {
|
||||
return null
|
||||
}
|
||||
|
||||
// #号加标题 快速跳转到指定锚点
|
||||
const url = link?.to && link?.to.length > 0 ? link.to : '#' + link?.title
|
||||
|
||||
return <>
|
||||
{/* 菜单 */}
|
||||
<div
|
||||
@@ -36,8 +39,7 @@ export const MenuItem = ({ link }) => {
|
||||
</div>
|
||||
</>)
|
||||
: (
|
||||
// link?.to
|
||||
<Link href={'#' + link?.title} className='dark:text-neutral-400 dark:hover:text-white font-bold w-full display-block'>
|
||||
<Link href={url} className='dark:text-neutral-400 dark:hover:text-white font-bold w-full display-block'>
|
||||
{link?.icon && <i className={`text-base ${link?.icon}`} />}{link?.title}
|
||||
</Link>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user