mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-08 08:34:20 +02:00
display day unavailability in team members in grey
This commit is contained in:
parent
7b9507ca35
commit
12ab2220a6
@ -35,6 +35,31 @@ const VolunteerEmail: FC<VolunteerEmailProps> = withUserRole("référent", ({ em
|
||||
<div className={styles.volunteerEmail}>{email}</div>
|
||||
))
|
||||
|
||||
type DaysAvailabilityProps = {
|
||||
volunteer: Volunteer
|
||||
}
|
||||
|
||||
const DaysAvailability: FC<DaysAvailabilityProps> = ({ volunteer }): JSX.Element => {
|
||||
if (volunteer.dayWishes.length === 0) {
|
||||
return (
|
||||
<>
|
||||
<div className={classnames(styles.day, styles.unknown)}>S</div>
|
||||
<div className={classnames(styles.day, styles.unknown)}>D</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<div className={classnames(styles.day, hasDay("S")(volunteer) && styles.available)}>
|
||||
S
|
||||
</div>
|
||||
<div className={classnames(styles.day, hasDay("D")(volunteer) && styles.available)}>
|
||||
D
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
type Props = {
|
||||
teamId: number
|
||||
}
|
||||
@ -58,22 +83,7 @@ const TeamMembers: FC<Props> = ({ teamId }): JSX.Element => {
|
||||
<div className={styles.volunteerName}>
|
||||
{volunteer.firstname} {volunteer.lastname}
|
||||
</div>
|
||||
<div
|
||||
className={classnames(
|
||||
styles.day,
|
||||
hasDay("S")(volunteer) && styles.available
|
||||
)}
|
||||
>
|
||||
S
|
||||
</div>
|
||||
<div
|
||||
className={classnames(
|
||||
styles.day,
|
||||
hasDay("D")(volunteer) && styles.available
|
||||
)}
|
||||
>
|
||||
D
|
||||
</div>
|
||||
<DaysAvailability volunteer={volunteer} />
|
||||
<VolunteerEmail email={volunteer.email} />
|
||||
</li>
|
||||
))}
|
||||
|
@ -45,6 +45,10 @@ $height: 24px;
|
||||
background-color: $color-red;
|
||||
color: transparent;
|
||||
|
||||
&.unknown {
|
||||
background-color: $color-grey-medium;
|
||||
}
|
||||
|
||||
&.available {
|
||||
background-color: $color-green;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user