fix: enter and exit full canvas cause nav items missing (#21691)
This commit is contained in:
parent
9588a64487
commit
96d27d7087
1 changed files with 2 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ const HeaderWrapper = ({
|
||||||
}: HeaderWrapperProps) => {
|
}: HeaderWrapperProps) => {
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const isBordered = ['/apps', '/datasets', '/datasets/create', '/tools'].includes(pathname)
|
const isBordered = ['/apps', '/datasets', '/datasets/create', '/tools'].includes(pathname)
|
||||||
// // Check if the current path is a workflow canvas & fullscreen
|
// Check if the current path is a workflow canvas & fullscreen
|
||||||
const inWorkflowCanvas = pathname.endsWith('/workflow')
|
const inWorkflowCanvas = pathname.endsWith('/workflow')
|
||||||
const workflowCanvasMaximize = localStorage.getItem('workflow-canvas-maximize') === 'true'
|
const workflowCanvasMaximize = localStorage.getItem('workflow-canvas-maximize') === 'true'
|
||||||
const [hideHeader, setHideHeader] = useState(workflowCanvasMaximize)
|
const [hideHeader, setHideHeader] = useState(workflowCanvasMaximize)
|
||||||
|
|
@ -25,14 +25,12 @@ const HeaderWrapper = ({
|
||||||
setHideHeader(v.payload)
|
setHideHeader(v.payload)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hideHeader && inWorkflowCanvas)
|
|
||||||
return null
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(
|
<div className={classNames(
|
||||||
'sticky left-0 right-0 top-0 z-[15] flex min-h-[56px] shrink-0 grow-0 basis-auto flex-col',
|
'sticky left-0 right-0 top-0 z-[15] flex min-h-[56px] shrink-0 grow-0 basis-auto flex-col',
|
||||||
s.header,
|
s.header,
|
||||||
isBordered ? 'border-b border-divider-regular' : '',
|
isBordered ? 'border-b border-divider-regular' : '',
|
||||||
|
hideHeader && inWorkflowCanvas && 'hidden',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue