Skip to content

Commit

Permalink
chooseGroup volle groepen duidelijk
Browse files Browse the repository at this point in the history
  • Loading branch information
sPAICEcake committed May 21, 2024
1 parent 2ec6f9c commit d35a5ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/frontend/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const english = {
join_course: 'Join course?',
join: 'Join',
join_group: 'Join',
group_full: 'Group is full',
leave: 'Leave',
acces: 'This gives you access to the course.',
copy_invite: 'Copy invitation link',
Expand Down
1 change: 1 addition & 0 deletions frontend/frontend/src/i18n/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dutch = {
join_course: 'Voeg vak toe?',
join: 'Voeg toe',
join_group: 'Wordt lid',
group_full: 'Groep zit vol',
leave: 'Verlaat',
acces: 'Dit geeft je toegang tot het vak.',
copy_invite: 'Kopieer uitnodigingslink',
Expand Down
15 changes: 15 additions & 0 deletions frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface Assignment {

function joinLeaveButton(
isin: boolean,
disabled: boolean,
handleJoin: () => void,
handleLeave: () => void
) {
Expand All @@ -56,6 +57,13 @@ function joinLeaveButton(
</>
)
}
if (disabled){
return (
<>
<Typography>{t('group_full')}</Typography>
</>
)
}
return (
<>
<Button size={'small'} onClick={handleJoin}>
Expand Down Expand Up @@ -658,6 +666,13 @@ export function ChooseGroup() {
user.user
)
: false,
group.studenten.length === assignment?.max_groep_grootte
&& !(user !=
undefined
? group.studenten.includes(
user.user
)
: false),
handleJoin,
handleLeave
)}
Expand Down

0 comments on commit d35a5ee

Please sign in to comment.