fix: 🐛 Announcement 显隐判断条件

This commit is contained in:
SuperHuangXu
2023-03-30 19:04:19 +08:00
parent 67127acb74
commit 63e3f36395

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>}