mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-09 09:04: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>
|
<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 = {
|
type Props = {
|
||||||
teamId: number
|
teamId: number
|
||||||
}
|
}
|
||||||
@ -58,22 +83,7 @@ const TeamMembers: FC<Props> = ({ teamId }): JSX.Element => {
|
|||||||
<div className={styles.volunteerName}>
|
<div className={styles.volunteerName}>
|
||||||
{volunteer.firstname} {volunteer.lastname}
|
{volunteer.firstname} {volunteer.lastname}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<DaysAvailability volunteer={volunteer} />
|
||||||
className={classnames(
|
|
||||||
styles.day,
|
|
||||||
hasDay("S")(volunteer) && styles.available
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
S
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={classnames(
|
|
||||||
styles.day,
|
|
||||||
hasDay("D")(volunteer) && styles.available
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
D
|
|
||||||
</div>
|
|
||||||
<VolunteerEmail email={volunteer.email} />
|
<VolunteerEmail email={volunteer.email} />
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
@ -45,6 +45,10 @@ $height: 24px;
|
|||||||
background-color: $color-red;
|
background-color: $color-red;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
|
|
||||||
|
&.unknown {
|
||||||
|
background-color: $color-grey-medium;
|
||||||
|
}
|
||||||
|
|
||||||
&.available {
|
&.available {
|
||||||
background-color: $color-green;
|
background-color: $color-green;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user