Fix can not show navbar when switch tab bug

This commit is contained in:
2023-09-10 23:55:52 +08:00
parent e842651851
commit 774ad57670

View File

@@ -25,11 +25,16 @@ const MainFramework: React.FC = () => {
const routeId = useMatches()[1].id const routeId = useMatches()[1].id
const routeChildren = router.routes[0].children?.find((value) => value.id === routeId)?.children const routeChildren = router.routes[0].children?.find((value) => value.id === routeId)?.children
const pathname = useLocation().pathname
useEffect(() => {
setNavbarHidden(false)
}, [pathname])
return ( return (
<> <>
<HideScrollbar ref={hideScrollbarRef}> <HideScrollbar ref={hideScrollbarRef}>
<div className={'body'}> <div className={'body'}>
<header className={'nav ' + (navbarHidden ? 'hide' : '')}> <header className={'nav' + (navbarHidden ? ' hide' : '')}>
<a className={'logo'} href={'https://fatweb.top'}> <a className={'logo'} href={'https://fatweb.top'}>
<span className={'title'}>FatWeb</span> <span className={'title'}>FatWeb</span>
</a> </a>