Skip to content

Commit

Permalink
Merge pull request #286 from SELab-2/frontend
Browse files Browse the repository at this point in the history
Frontend into develop
  • Loading branch information
sPAICEcake authored May 20, 2024
2 parents 9766e1b + ff4ff65 commit cf7d490
Show file tree
Hide file tree
Showing 39 changed files with 4,522 additions and 2,777 deletions.
Binary file added frontend/frontend/public/assets/logo_duif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/frontend/public/assets/logo_duif_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/frontend/public/assets/logo_duif_top.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/frontend/src/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const theme = createTheme({
contrastText: '#47464A',
},
background: {
default: '#FFFFFF',
paper: '#FAFAFF',
default: '#FCF8FD',
paper: '#FCF8FD',
},
text: {
primary: '#47464A',
Expand Down
8 changes: 4 additions & 4 deletions frontend/frontend/src/components/AssignmentListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export function AssignmentListItem({
>
{/* Project Name */}
<ListItemText
id='projectName'
id="projectName"
sx={{ maxWidth: 100 }}
primary={projectName}
/>
{/* Due Date */}
<ListItemText
id='dueDate'
id="dueDate"
sx={{ maxWidth: 150 }}
primary={dueDate ? dueDate : t('no_deadline')}
/>
Expand All @@ -81,12 +81,12 @@ export function AssignmentListItem({
<ListItemIcon sx={{ minWidth: 35 }}>
{status ? (
<CheckCircleOutlineIcon
id='check'
id="check"
sx={{ color: 'success.main' }}
/>
) : (
<HighlightOffIcon
id='cross'
id="cross"
sx={{ color: 'error.main' }}
/>
)}
Expand Down
17 changes: 11 additions & 6 deletions frontend/frontend/src/components/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useState } from 'react'
import { darken } from '@mui/system'
import { Box, Collapse, Tooltip, Typography } from '@mui/material'
import Button from '@mui/material/Button'
import { Button } from './CustomComponents.tsx'
import { AssignmentTurnedIn, ContentPaste } from '@mui/icons-material'
import { t } from 'i18next'
import theme from '../Theme.ts'

interface CopyToClipboardProps {
invitationLink: string
Expand Down Expand Up @@ -42,21 +44,24 @@ export const CopyToClipboard = ({ invitationLink }: CopyToClipboardProps) => {
>
<Button
onClick={copyToClipboard}
variant={'contained'}
sx={{
height: 40,
maxWidth: 500,
minWidth: 200,
backgroundColor: 'background.default',
backgroundColor: 'secondary.main',
color: 'text.primary',
textTransform: 'none',
borderRadius: 2,
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
padding: 0,
gap: 1,
'&:hover': {
backgroundColor: 'secondary.main',
backgroundColor: darken(
theme.palette.secondary.main,
0.2
),
},
}}
>
Expand Down Expand Up @@ -89,7 +94,7 @@ export const CopyToClipboard = ({ invitationLink }: CopyToClipboardProps) => {
textOverflow: 'ellipsis',
}}
>
{invitationLink}
{t('copy_invite')}
</Typography>
</Button>
</Collapse>
Expand Down
61 changes: 36 additions & 25 deletions frontend/frontend/src/components/CourseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function CourseCard({
{/* Clickable area for the card */}
<CardActionArea onClick={handleCardClick}>
<Box
id='courseInfo'
id="courseInfo"
aria-label={'courseHeader'}
sx={{
backgroundColor: 'secondary.main',
Expand All @@ -151,7 +151,6 @@ export function CourseCard({
>
{/* Course name and teachers */}
<Box

width={'70%'}
height={'100%'}
display={'flex'}
Expand Down Expand Up @@ -246,51 +245,69 @@ export function CourseCard({
{isStudent ? (
// Display assignments for students
<Box
id='student'
id="student"
display={'flex'}
flexDirection={'row'}
justifyContent={'space-between'}
pl={3}
pr={3}
>
<Typography id='project' width={30}>Project</Typography>
<Typography id='deadline' width={30}>Deadline</Typography>
<Typography id='status' width={30}>Status</Typography>
<Typography id="project" width={30}>
Project
</Typography>
<Typography id="deadline" width={30}>
Deadline
</Typography>
<Typography id="status" width={30}>
Status
</Typography>
</Box>
) : (
// Display assignments for teachers
<>
{archived ? (
<Box
id='teacherArchived'
id="teacherArchived"
display={'flex'}
flexDirection={'row'}
justifyContent={'space-between'}
pl={3}
pr={3}
width={{ xs: '81%', sm: '85%' }}
>
<Typography id='project' maxWidth={100}>
<Typography
id="project"
maxWidth={100}
>
Project
</Typography>
<Typography id='deadline' minWidth={50}>
<Typography
id="deadline"
minWidth={50}
>
Deadline
</Typography>
</Box>
) : (
<Box
id='teacherNonArchived'
id="teacherNonArchived"
display={'flex'}
flexDirection={'row'}
justifyContent={'space-between'}
pl={3}
pr={3}
width={{ xs: '71%', sm: '75%' }}
>
<Typography id='project' maxWidth={100}>
<Typography
id="project"
maxWidth={100}
>
Project
</Typography>
<Typography id='deadline' minWidth={50}>
<Typography
id="deadline"
minWidth={50}
>
Deadline
</Typography>
</Box>
Expand All @@ -316,10 +333,8 @@ export function CourseCard({
)
.map((assignment) => (
<AssignmentListItem
key={
assignment.project_id
}
id={`project${assignment.project_id}`}
key={`project${assignment.project_id}`}
id={assignment.project_id.toString()}
courseId={courseId}
projectName={
assignment.titel
Expand Down Expand Up @@ -354,10 +369,8 @@ export function CourseCard({
{assignments.map(
(assignment) => (
<AssignmentListItem
key={
assignment.project_id
}
id={`project${assignment.project_id}`}
key={`project${assignment.project_id}`}
id={assignment.project_id.toString()}
courseId={
courseId
}
Expand Down Expand Up @@ -400,10 +413,8 @@ export function CourseCard({
)
.map((assignment) => (
<AssignmentListItem
key={
assignment.project_id
}
id={`project${assignment.project_id}`}
key={`project${assignment.project_id}`}
id={assignment.project_id.toString()}
courseId={
courseId
}
Expand Down Expand Up @@ -442,7 +453,7 @@ export function CourseCard({
}}
>
<IconButton
id='archiveButton'
id="archiveButton"
onClick={archiveEvent}
sx={{
backgroundColor:
Expand Down
Loading

0 comments on commit cf7d490

Please sign in to comment.