generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
92 additions
and
140 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Box, Button, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from "@mui/material"; | ||
|
||
// TODO: Replace this with a real table | ||
function createData( | ||
id: number, | ||
title: string, | ||
description: string, | ||
category: string, | ||
complexity: string | ||
) { | ||
return { id, title, description, category, complexity }; | ||
} | ||
|
||
const rows = [ | ||
createData(1, "Reverse a String", "Description 1", "Strings, Algorithms", "Easy"), | ||
createData(1, "Repeated DNA Sequences", "Description 2", "Data Structures, Algorithms", "Medium"), | ||
createData(1, "Sliding Window Maximum", "Description 3", "Arrays, Algorithms", "Hard") | ||
]; | ||
|
||
export default function Dashboard() { | ||
return ( | ||
<Box> | ||
<Typography variant="h2">PeerPrep Dashboard</Typography> | ||
<Button href={`/login`}>Log out</Button> | ||
<TableContainer component={Paper}> | ||
<Table sx={{ minWidth: 650 }} aria-label="simple table"> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell>ID</TableCell> | ||
<TableCell align="left">Title</TableCell> | ||
<TableCell align="left">Category (g)</TableCell> | ||
<TableCell align="left">Complexity (g)</TableCell> | ||
{/* <TableCell align="right">Protein (g)</TableCell> */} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{rows.map((row) => ( | ||
<TableRow | ||
key={row.id} | ||
sx={{ '&:last-child td, &:last-child th': { border: 0 } }} | ||
> | ||
<TableCell component="th" scope="row"> | ||
{row.id} | ||
</TableCell> | ||
<TableCell align="left">{row.title}</TableCell> | ||
<TableCell align="left">{row.category}</TableCell> | ||
<TableCell align="left">{row.complexity}</TableCell> | ||
{/* <TableCell align="right">{row.protein}</TableCell> */} | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Box, Button, TextField, Typography } from "@mui/material"; | ||
|
||
export default function Login() { | ||
return ( | ||
<> | ||
<Box sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}}> | ||
<Typography variant="h1" gutterBottom>PeerPrep</Typography> | ||
<TextField id="outlined-basic" label="Username" variant="outlined" /> | ||
<TextField id="outlined-basic" label="Password" variant="outlined" /> | ||
<Button href={`/dashboard`} variant="contained">Log in</Button> | ||
</Box> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Navigate, createBrowserRouter } from 'react-router-dom'; | ||
import Login from '../pages/Login'; | ||
import Dashboard from '../pages/Dashboard'; | ||
|
||
export default createBrowserRouter([ | ||
{ | ||
path: '/login', | ||
element: <Login /> | ||
}, | ||
{ | ||
path: '/dashboard', | ||
element: <Dashboard /> | ||
}, | ||
{ path: '*', element: <Navigate to="/login" replace /> }, | ||
]) |