mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
微调样式、修复异常
This commit is contained in:
@@ -62,8 +62,10 @@ const WalineComponent = (props) => {
|
||||
}
|
||||
|
||||
return () => {
|
||||
waline.destroy()
|
||||
waline = null
|
||||
if (waline) {
|
||||
waline.destroy()
|
||||
waline = null
|
||||
}
|
||||
router.events.off('routeChangeComplete', updateWaline)
|
||||
}
|
||||
}, [])
|
||||
|
||||
@@ -69,6 +69,7 @@ const LayoutBase = (props) => {
|
||||
<div className='h-0.5 w-full bg-gray-700 dark:bg-gray-600 hidden lg:block'/>
|
||||
|
||||
<main id='wrapper' className='flex justify-center flex-1 pb-12'>
|
||||
{/* 左侧栏样式 */}
|
||||
<SideAreaLeft slot={leftAreaSlot} targetRef={targetRef} {...props}/>
|
||||
<section id='container-inner' className={`${CONFIG_NEXT.NAV_TYPE !== 'normal' ? 'mt-40' : ''} lg:max-w-3xl xl:max-w-4xl flex-grow md:mt-0 min-h-screen w-full`} ref={targetRef}>
|
||||
{onLoading ? <LoadingCover/> : <> {children}</> }
|
||||
|
||||
@@ -10,22 +10,23 @@ const MenuButtonGroup = (props) => {
|
||||
const router = useRouter()
|
||||
const archiveSlot = <div className='bg-gray-300 dark:bg-gray-500 rounded-md text-gray-50 px-1 text-xs'>{postCount}</div>
|
||||
|
||||
let links = [
|
||||
const defaultLinks = [
|
||||
{ icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true },
|
||||
{ icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NEXT.MENU_CATEGORY },
|
||||
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NEXT.MENU_TAG },
|
||||
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_NEXT.MENU_ARCHIVE },
|
||||
{ icon: 'fas fa-user', name: locale.NAV.ABOUT, to: '/about', show: CONFIG_NEXT.MENU_ABOUT }
|
||||
]
|
||||
let links = [].concat(defaultLinks)
|
||||
if (customNav) {
|
||||
links = links.concat(customNav)
|
||||
links = defaultLinks.concat(customNav)
|
||||
}
|
||||
|
||||
return <nav id='nav' className='leading-8 text-gray-500 dark:text-gray-400 font-sans'>
|
||||
{links.map(link => {
|
||||
if (link && link.show) {
|
||||
const selected = (router.pathname === link.to) || (router.asPath === link.to)
|
||||
return <Link key={`${link.to}`} title={link.to} href={link.to} >
|
||||
return <Link key={link.to} title={link.to} href={link.to} >
|
||||
<a target={link.to.indexOf('http') === 0 ? '_blank' : '_self'} className={'py-1.5 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-gray-200 text-black' : ' ')} >
|
||||
<div className='my-auto items-center justify-center flex '>
|
||||
@@ -36,7 +37,7 @@ const MenuButtonGroup = (props) => {
|
||||
</a>
|
||||
</Link>
|
||||
} else {
|
||||
return null
|
||||
return <></>
|
||||
}
|
||||
})}
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user