import { Navigate, Route, Routes, useNavigate } from 'react-router-dom'; import { CalendarMonth, CalendarMonthOutlined, Home as HomeIcon, HomeOutlined, Info, InfoOutlined, } from '@mui/icons-material'; import MainMenu from './components/MainMenu'; import Home from './screens/Home'; import Information from './screens/Information'; import Calendar from './screens/Calendar'; import { Container } from '@mui/system'; import useLayoutType from './hooks/useLayoutType'; import Toolbar from './components/Toolbar'; import { useUser } from './context/user'; import { useAuthState } from './context/auth'; function AuthenticatedApp() { const navigate = useNavigate(); const { state } = useUser(); const { logout } = useAuthState(); const layoutType = useLayoutType(); const avatarMenuOptions = [ { text: 'Meu Perfil', action: () => navigate('/profile', { replace: true }), }, { text: 'Sair', action: logout, }, ]; return ( state && state.user && ( <> Olá, {state.user.name} 👋

} layoutType={layoutType} avatarMenuOptions={avatarMenuOptions} /> } /> } /> } /> } /> } /> ) ); } const container = { height: '100vh', margin: 0, padding: 0, display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'primary.mainBackground', }; const mobileContainer = { ...container, flexDirection: 'column-reverse', }; const menuOptions = activePath => [ { id: 0, text: 'Página Inicial', selectedIcon: , unselectedIcon: , pathname: '/home', isActive: activePath === '/home' || activePath === '/login', }, { id: 1, text: 'Informações', selectedIcon: , unselectedIcon: , pathname: '/info', isActive: activePath === '/info', }, { id: 2, text: 'Calendário', selectedIcon: , unselectedIcon: , pathname: '/calendar', isActive: activePath === '/calendar', }, ]; export default AuthenticatedApp;