-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from SELab-2/frontend
Frontend
- Loading branch information
Showing
36 changed files
with
1,915 additions
and
519 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"hash": "ea10a7bd", | ||
"configHash": "baf76694", | ||
"lockfileHash": "e3b0c442", | ||
"browserHash": "89947c23", | ||
"optimized": {}, | ||
"chunks": {} | ||
} |
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,3 @@ | ||
{ | ||
"type": "module" | ||
} |
Large diffs are not rendered by default.
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
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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
62 changes: 62 additions & 0 deletions
62
frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx
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,62 @@ | ||
import {ListItem, ListItemButton, ListItemText, Divider} from "@mui/material"; | ||
import {useNavigate} from "react-router-dom"; | ||
import {t} from "i18next"; | ||
interface AssignmentListItemSubjectsPageProps { | ||
key: string; | ||
projectName: string; | ||
dueDate?: Date; | ||
submissions: number; | ||
score: number; | ||
isStudent: boolean; | ||
} | ||
|
||
/* | ||
* This component is used to display a single assignment in the list of assignments | ||
* @param key: string - the key of the assignment | ||
* @param projectName: string - the name of the project | ||
* @param dueDate: Date - the due date of the project | ||
* @param submissions: number - number of submissions for the project | ||
* @param score: number - assigned score on the project | ||
* @param isStudent: boolean - if the user is a student or a teacher | ||
*/ | ||
|
||
export function AssignmentListItemSubjectsPage({key,projectName, dueDate, submissions, score, isStudent}:AssignmentListItemSubjectsPageProps) { | ||
const navigate = useNavigate(); | ||
const handleProjectClick = () => { | ||
console.log("Project clicked"); | ||
navigate(`/${key}`) | ||
} | ||
|
||
return ( | ||
<> | ||
<ListItem key={projectName} sx={{margin:0}} disablePadding={true}> | ||
<ListItemButton onClick={handleProjectClick} sx={{ | ||
width: "100%", | ||
height: 30, | ||
display: "flex", | ||
flexDirection: "row", | ||
justifyContent: "space-between", | ||
paddingX: 1, | ||
paddingY: 3, | ||
borderRadius:2, | ||
}}> | ||
{isStudent? | ||
<> | ||
<ListItemText sx={{maxWidth:100}} primary={projectName}/> | ||
<ListItemText sx={{maxWidth:110}} primary={dueDate? dueDate.toLocaleDateString() : t("no_deadline")}/> | ||
<ListItemText sx={{maxWidth:100}} primary={submissions + " indieningen"}/> | ||
<ListItemText sx={{maxWidth:50}} primary={score + "/20"}/> | ||
</> | ||
: | ||
<> | ||
<ListItemText sx={{maxWidth:100}} primary={projectName}/> | ||
<ListItemText sx={{maxWidth:110}} primary={dueDate? dueDate.toLocaleDateString() : t("no_deadline")}/> | ||
<ListItemText sx={{maxWidth:40}} primary={"edit"}/> | ||
</> | ||
} | ||
</ListItemButton> | ||
</ListItem> | ||
<Divider color={"text.main"}></Divider> | ||
</> | ||
); | ||
} |
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.