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.
Include formatting and linting for tsx, jsx and js files
- Loading branch information
Showing
6 changed files
with
77 additions
and
65 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import Router from './routes' | ||
import { RouterProvider } from 'react-router-dom' | ||
import Router from './routes'; | ||
import { RouterProvider } from 'react-router-dom'; | ||
|
||
function App() { | ||
return ( | ||
<RouterProvider router={Router} /> | ||
) | ||
return <RouterProvider router={Router} />; | ||
} | ||
|
||
export default App | ||
export default App; |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import App from './App.tsx' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './App.tsx'; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) | ||
); |
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 |
---|---|---|
@@ -1,56 +1,64 @@ | ||
import { Box, Button, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from "@mui/material"; | ||
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 | ||
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") | ||
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> */} | ||
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> | ||
</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> | ||
))} | ||
</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 |
---|---|---|
@@ -1,18 +1,24 @@ | ||
import { Box, Button, TextField, Typography } from "@mui/material"; | ||
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> | ||
<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> | ||
<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