diff --git a/src/app/Header.tsx b/src/app/Header.tsx index cb136a4..7da3765 100644 --- a/src/app/Header.tsx +++ b/src/app/Header.tsx @@ -9,6 +9,9 @@ import UserMenu from "../user/UserMenu"; import { useMobile } from "hooks"; import HeaderButtons from "./HeaderButtons"; import { useGlobalState } from "providers"; +import SideNavigator from "navigation/SideNavigator"; +import React, { useState } from "react"; +import BottomNavigator from "navigation/BottomNavigator"; const useStyles = makeStyles((theme: Theme) => ({ appBar: { @@ -77,8 +80,6 @@ const useStyles = makeStyles((theme: Theme) => ({ interface Props { toggleTheme: () => void; - sideIsOpen: boolean; - openSide: () => void; // teams: Team[]; // setTeams: React.Dispatch>; } @@ -86,7 +87,7 @@ interface Props { export default function Header(props: Props) { // const { sideIsOpen, openSide, toggleTheme } = props; - const { openSide, toggleTheme } = props; + const { toggleTheme } = props; const themeType = useThemeType(); const classes = useStyles() const isMobile = useMobile(); @@ -94,7 +95,10 @@ export default function Header(props: Props) { const [{ user, team }] = useGlobalState(); const hasTeams = user.hasFeature ? user.hasFeature("teams") : false; + const [navOpen, setNavOpen] = useState(false) + return ( + @@ -102,7 +106,7 @@ export default function Header(props: Props) { {setNavOpen(true)}} style={{ color: getSignatureAccentColour() }} className={classes.button}> @@ -125,6 +129,10 @@ export default function Header(props: Props) { + + {setNavOpen(true)}} onClose={() => {setNavOpen(false)}} /> + {isMobile && {setNavOpen(true)}} sideIsOpen={navOpen} />} + ) } \ No newline at end of file diff --git a/src/navigation/NavigationContainer.tsx b/src/navigation/NavigationContainer.tsx index 3b9b411..6516783 100644 --- a/src/navigation/NavigationContainer.tsx +++ b/src/navigation/NavigationContainer.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren, useState } from "react"; +import React, { PropsWithChildren } from "react"; import Router from "./Router"; interface Props extends PropsWithChildren { @@ -10,23 +10,11 @@ interface Props extends PropsWithChildren { export default function NavigationContainer(props: Props) { // const { toggleTheme, teams, setTeams } = props; const { toggleTheme } = props; - const [sideNavigatorOpen, setSideNavigatorOpen] = useState(false); - - const openSideNavigator = () => { - setSideNavigatorOpen(true); - }; - - const closeSideMenu = () => { - setSideNavigatorOpen(false); - }; return ( {/* */} diff --git a/src/navigation/Router.tsx b/src/navigation/Router.tsx index b7864a2..d7d2283 100644 --- a/src/navigation/Router.tsx +++ b/src/navigation/Router.tsx @@ -4,10 +4,7 @@ import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom"; import { Typography } from "@mui/material"; import { useAuth0 } from "@auth0/auth0-react"; import Teams from "pages/Teams"; -import SideNavigator from "./SideNavigator"; import Users from "pages/Users"; -import { useMobile } from "hooks"; -import BottomNavigator from "./BottomNavigator"; import TeamPage from "pages/Team"; import Header from "app/Header"; import Logout from "pages/Logout"; @@ -17,9 +14,6 @@ import GroupsPage from "pages/Groups"; import GroupPage from "pages/Group"; interface Props { - open: boolean, - onOpen: () => void; - onClose: () => void; toggleTheme: () => void; } @@ -30,9 +24,8 @@ export const appendToUrl = (appendage: number | string) => { export default function Router(props: Props) { - const {open, onOpen, onClose, toggleTheme } = props; + const { toggleTheme } = props; const { isAuthenticated, loginWithRedirect, isLoading } = useAuth0(); - const isMobile = useMobile(); const RelativeRoutes = () => { return ( @@ -127,13 +120,10 @@ export default function Router(props: Props) { }>
- {/* Redirects */} @@ -148,7 +138,6 @@ export default function Router(props: Props) { } /> - {isMobile && } )