-
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.
Add overview button to admin page of projects (#384)
* changes bekijken * beaucoup * edit title and description functionality * linter :nerd: * frontend linter --------- Co-authored-by: Siebe Vlietinck <71773032+Vucis@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
303 additions
and
64 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
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,43 @@ | ||
import {Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from "@mui/material"; | ||
import {Deadline} from "../../types/deadline.ts"; | ||
import {useTranslation} from "react-i18next"; | ||
|
||
interface Props { | ||
deadlines: Deadline[]; | ||
minWidth: number | ||
} | ||
|
||
/** | ||
* @returns grid that displays deadlines in a grid | ||
*/ | ||
export default function DeadlineGrid({deadlines, minWidth}: Props) { | ||
|
||
const { t } = useTranslation('translation', { keyPrefix: 'projectForm' }); | ||
|
||
return ( | ||
<TableContainer component={Paper}> | ||
<Table sx={{ minWidth: minWidth }}> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell sx={{ fontWeight: 'bold' }}>{t("deadline")}</TableCell> | ||
<TableCell sx={{ fontWeight: 'bold' }} align="right">{t("description")}</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{deadlines.length === 0 ? ( // Check if deadlines is empty | ||
<TableRow> | ||
<TableCell colSpan={2} align="center">{t("noDeadlinesPlaceholder")}</TableCell> | ||
</TableRow> | ||
) : ( | ||
deadlines.map((deadline, index) => ( | ||
<TableRow key={index} sx={{ '&:last-child td, &:last-child th': { border: 0 } }}> | ||
<TableCell component="th" scope="row">{deadline.deadline}</TableCell> | ||
<TableCell align="right">{deadline.description}</TableCell> | ||
</TableRow> | ||
)) | ||
)} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
) | ||
} |
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
Oops, something went wrong.