Merge pull request #943 from SuperHuangXu/main

修复 next 主题 bug
This commit is contained in:
tangly1024
2023-04-02 17:21:31 +08:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -35,12 +35,12 @@ export const MenuList = (props) => {
<>
{/* 大屏模式菜单 */}
<nav id='nav' className='hidden md:block leading-8 text-gray-500 dark:text-gray-400 font-sans'>
{links.map(link => link && link.show && <MenuItemDrop key={link?.id} link={link} />)}
{links.map(link => link && link.show && <MenuItemDrop key={link?.to} link={link} />)}
</nav>
{/* 移动端菜单 */}
<div id='nav-menu-mobile' className='block md:hidden my-auto justify-start bg-white'>
{links?.map(link => link && link.show && <MenuItemCollapse onHeightChange={props.onHeightChange} key={link?.id} link={link} />)}
{links?.map(link => link && link.show && <MenuItemCollapse onHeightChange={props.onHeightChange} key={link?.to} link={link} />)}
</div>
</>
)

View File

@@ -25,6 +25,8 @@ const SideAreaRight = (props) => {
const { tagOptions, currentTag, slot, categoryOptions, currentCategory, notice } = props
const { locale } = useGlobal()
const router = useRouter()
const announcementVisible = notice && Object.keys(notice).length > 0
return (<aside id='right' className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'mr-4' : 'ml-4') + ' space-y-4 hidden xl:block flex-col w-60 relative z-10'}>
{CONFIG_NEXT.RIGHT_AD && <Card className='mb-2'>
@@ -41,7 +43,7 @@ const SideAreaRight = (props) => {
</Card>}
<div className="sticky top-0 space-y-4 w-full">
{notice && <Card>
{announcementVisible && <Card>
<Announcement post={notice} />
</Card>}