mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-08 18:36:53 +08:00
feat: 增加可选性隐藏功能
- 目前可以隐藏 侧边栏,导航栏,发布按钮
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
'use client'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import { usePathname, useSearchParams } from 'next/navigation'
|
||||
import s from './index.module.css'
|
||||
import classNames from '@/utils/classnames'
|
||||
|
||||
@@ -11,8 +11,16 @@ const HeaderWrapper = ({
|
||||
children,
|
||||
}: HeaderWrapperProps) => {
|
||||
const pathname = usePathname()
|
||||
const searchParams = useSearchParams()
|
||||
const isBordered = ['/apps', '/datasets', '/datasets/create', '/tools'].includes(pathname)
|
||||
|
||||
// 当不携带 header 参数时,或者 header 参数为 1 时,显示 header
|
||||
const headerParam = searchParams.get('header')
|
||||
const showHeader = !headerParam || headerParam === '1'
|
||||
|
||||
// console.log('headerParam: ', headerParam, !headerParam, (headerParam === '1'))
|
||||
// console.log('showHeader: ', showHeader)
|
||||
if (!showHeader) return null
|
||||
return (
|
||||
<div className={classNames(
|
||||
'sticky top-0 left-0 right-0 z-30 flex flex-col grow-0 shrink-0 basis-auto min-h-[56px]',
|
||||
|
||||
Reference in New Issue
Block a user