Reset app bar height to 0 on unmount

This commit is contained in:
schroda
2024-07-13 15:35:34 +02:00
parent 5632c4584b
commit 847a5c68b2
3 changed files with 4 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { useCallback, useContext, useMemo, useRef } from 'react';
import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
@@ -89,6 +89,7 @@ export function DefaultNavBar() {
appBarRef,
useCallback(() => setAppBarHeight(appBarRef.current?.clientHeight ?? 0), [appBarRef]),
);
useEffect(() => setAppBarHeight(0), []);
const activeNavBar: NavbarItem['show'] = isMobileWidth ? 'mobile' : 'desktop';
const visibleNavBarItems = useMemo(