Hide footer when navigation is hidden

This commit is contained in:
IRBorisov 2023-08-15 21:55:43 +03:00
parent 2deeee756c
commit 162191040c
2 changed files with 9 additions and 9 deletions

View File

@ -22,14 +22,14 @@ function App () {
const scrollWindowSize = useMemo( const scrollWindowSize = useMemo(
() => { () => {
return !noNavigation ? return !noNavigation ?
'max-h-[calc(100vh-4.5rem)]' 'calc(100vh - 4.5rem)'
: 'max-h-[100vh]'; : '100vh';
}, [noNavigation]); }, [noNavigation]);
const mainSize = useMemo( const mainSize = useMemo(
() => { () => {
return !noNavigation ? return !noNavigation ?
'min-h-[calc(100vh-12rem)]' 'calc(100vh - 12rem)'
: 'min-h-[calc(100vh-8rem)] '; : '100vh';
}, [noNavigation]); }, [noNavigation]);
return ( return (
@ -42,8 +42,8 @@ function App () {
pauseOnFocusLoss={false} pauseOnFocusLoss={false}
/> />
<div className={`${scrollWindowSize} overflow-auto`}> <div className='overflow-auto' style={{maxHeight: scrollWindowSize}}>
<main className={`${mainSize} px-2`}> <main className='px-2' style={{minHeight: mainSize}}>
<Routes> <Routes>
<Route path='/' element={ <HomePage/>} /> <Route path='/' element={ <HomePage/>} />
@ -60,7 +60,7 @@ function App () {
<Route path='*' element={ <NotFoundPage/>} /> <Route path='*' element={ <NotFoundPage/>} />
</Routes> </Routes>
</main> </main>
<Footer /> {!noNavigation && <Footer />}
</div> </div>
</div> </div>
); );

View File

@ -189,7 +189,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
() => { () => {
return !noNavigation ? return !noNavigation ?
'calc(100vh - 13rem)' 'calc(100vh - 13rem)'
: 'calc(100vh - 8.5rem)'; : 'calc(100vh - 2rem)';
}, [noNavigation]); }, [noNavigation]);
const dismissedStyle = useCallback( const dismissedStyle = useCallback(
@ -281,7 +281,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
<div className='flex-wrap w-full h-full overflow-auto'> <div className='flex-wrap w-full h-full overflow-auto'>
<div <div
className='relative border-t border-r' className='relative border-t border-r'
style={{width: canvasWidth, height: canvasHeight}} style={{width: canvasWidth, height: canvasHeight, borderBottomWidth: noNavigation ? '1px': ''}}
> >
<div id='items-graph-help' className='relative top-0 right-0 z-10 m-2'> <div id='items-graph-help' className='relative top-0 right-0 z-10 m-2'>
<HelpIcon color='text-primary' size={6} /> <HelpIcon color='text-primary' size={6} />