Fixed access to dashboard page.

This commit is contained in:
Harrison Deng 2022-03-07 20:49:43 -06:00
parent 5c7e26a1a9
commit fba8212aeb
3 changed files with 11 additions and 9 deletions

View File

@ -5,11 +5,14 @@ import SignUp from './SignUp';
import Admin from './Admin';
import Home from './Home';
import ChatWindow from './ChatWindow';
import UserDashboard from "./UserDashboard";
function App() {
return (
<div className="App">
<Routes>
<Route path="" element={<Home />} />
<Route path="dashboard" element={<UserDashboard />} />
<Route path="sign-in" element={<SignIn />} />
<Route path="sign-up" element={<SignUp />} />
<Route path="admin" element={<Admin />} />

View File

@ -95,15 +95,12 @@ export default function Navbar() {
Sports Matcher
</Typography>
<Box sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' }, marginLeft: '2%' }}>
{pages.map((page) => (
<Button
key={page}
onClick={handleCloseNavMenu}
sx={{ my: 2, color: 'white', display: 'block', textTransform: 'none', fontSize: '100%' }}
>
{page}
</Button>
))}
<Button
onClick={() => { navigate("/dashboard") }}
sx={{ my: 2, color: 'white', display: 'block', textTransform: 'none', fontSize: '100%' }}
>
Dashboard
</Button>
</Box>
<Box sx={{ flexGrow: 0, marginRight: '1%' }}>

View File

@ -12,11 +12,13 @@ import Filter from "./Filter";
import SearchBar from "./SearchBar";
import { useNavigate } from 'react-router-dom';
import MatchesList from './MatchesList';
import Navbar from './Navbar';
export default function UserDashboard() {
const navigate = useNavigate();
return (
<div>
<Navbar></Navbar>
<SearchBar></SearchBar>
<Filter></Filter>
<MatchesList></MatchesList>