feat: 增加可选性隐藏功能

- 目前可以隐藏 侧边栏,导航栏,发布按钮
This commit is contained in:
Huangzhe
2025-04-22 20:34:49 +08:00
parent 523efbfea5
commit 9e7197443c
4 changed files with 28 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ import {
useMergeRefs,
useRole,
} from '@floating-ui/react'
import { useSearchParams } from 'next/navigation'
import type { OffsetOptions, Placement } from '@floating-ui/react'
import cn from '@/utils/classnames'
export type PortalToFollowElemOptions = {
@@ -139,6 +139,12 @@ export const PortalToFollowElemTrigger = (
)
}
// 检测是否开启 publish 功能
const searchParams = useSearchParams()
const publishParam = searchParams.get('publish')
const showPublish = !publishParam || publishParam === '1'
if (!showPublish) return null
return (
<div
ref={ref}