MCPcopy Create free account
hub / github.com/atomicdata-dev/atomic-data-browser / NavWrapper

Function NavWrapper

data-browser/src/components/Navigation.tsx:29–54  ·  view source on GitHub ↗
({ children }: NavWrapperProps)

Source from the content-addressed store, hash-verified

27
28/** Wraps the entire app and adds a navbar at the bottom or the top */
29export function NavWrapper({ children }: NavWrapperProps): JSX.Element {
30 const { navbarTop, navbarFloating } = useSettings();
31 const contentRef = React.useRef(null);
32 const location = useLocation();
33
34 useEffect(() => {
35 contentRef?.current?.scrollTo(0, 0);
36 }, [location]);
37
38 return (
39 <>
40 {navbarTop && <NavBar />}
41 <SideBarWrapper>
42 <SideBar />
43 <Content
44 ref={contentRef}
45 navbarTop={navbarTop}
46 navbarFloating={navbarFloating}
47 >
48 {children}
49 </Content>
50 </SideBarWrapper>
51 {!navbarTop && <NavBar />}
52 </>
53 );
54}
55
56interface ContentProps {
57 navbarTop: boolean;

Callers

nothing calls this directly

Calls 1

useSettingsFunction · 0.90

Tested by

no test coverage detected