mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-09 09:04:20 +02:00
Show more days in team member listing
This commit is contained in:
parent
ca52d1a108
commit
9f03b2c63b
@ -14,6 +14,8 @@ interface ExtendedVolunteer extends Volunteer {
|
|||||||
teamObject: Team | undefined
|
teamObject: Team | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dayList = ["m", "j", "v", "S", "D", "l"] // Upper case for important days
|
||||||
|
|
||||||
const selectVolunteersWithTeam = createSelector(
|
const selectVolunteersWithTeam = createSelector(
|
||||||
selectVolunteerListAlphaSorted,
|
selectVolunteerListAlphaSorted,
|
||||||
selectTeamList,
|
selectTeamList,
|
||||||
@ -36,22 +38,19 @@ const DaysAvailability: FC<DaysAvailabilityProps> = ({ volunteer }): JSX.Element
|
|||||||
const hasWishes = volunteer.dayWishes.length > 0
|
const hasWishes = volunteer.dayWishes.length > 0
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<td
|
{dayList.map((dayId) => (
|
||||||
className={classnames(
|
<td
|
||||||
styles.day,
|
className={classnames(
|
||||||
hasWishes ? hasDay("S")(volunteer) && styles.available : styles.unknown
|
styles.day,
|
||||||
)}
|
hasWishes
|
||||||
>
|
? hasDay(dayId.toUpperCase())(volunteer) && styles.available
|
||||||
{hasWishes ? "" : "?"}
|
: styles.unknown,
|
||||||
</td>
|
dayId === dayId.toUpperCase() ? styles.weekend : styles.week
|
||||||
<td
|
)}
|
||||||
className={classnames(
|
>
|
||||||
styles.day,
|
{hasWishes ? "" : "?"}
|
||||||
hasWishes ? hasDay("D")(volunteer) && styles.available : styles.unknown
|
</td>
|
||||||
)}
|
))}
|
||||||
>
|
|
||||||
{hasWishes ? "" : "?"}
|
|
||||||
</td>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -73,8 +72,14 @@ const TeamMembers: FC<Props> = ({ teamId }): JSX.Element => {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bénévoles</th>
|
<th>Bénévoles</th>
|
||||||
<th className={styles.dayTitle}>S ({volunteers.filter(hasDay("S")).length})</th>
|
<>
|
||||||
<th className={styles.dayTitle}>D ({volunteers.filter(hasDay("D")).length})</th>
|
{dayList.map((dayId) => (
|
||||||
|
<th className={styles.dayTitle}>
|
||||||
|
{dayId.toUpperCase()} (
|
||||||
|
{volunteers.filter(hasDay(dayId.toUpperCase())).length})
|
||||||
|
</th>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
</tr>
|
</tr>
|
||||||
{volunteers.map((volunteer) => (
|
{volunteers.map((volunteer) => (
|
||||||
<tr key={volunteer.id}>
|
<tr key={volunteer.id}>
|
||||||
|
@ -1,15 +1,27 @@
|
|||||||
@import "../../theme/variables";
|
@import "../../theme/variables";
|
||||||
@import "../../theme/mixins";
|
@import "../../theme/mixins";
|
||||||
.day {
|
.day {
|
||||||
background-color: $color-red;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
min-width: 10%;
|
min-width: 10%;
|
||||||
&.unknown {
|
|
||||||
|
&.weekend {
|
||||||
|
background-color: $color-red;
|
||||||
|
}
|
||||||
|
&.weekend.unknown {
|
||||||
background-color: $color-grey-medium;
|
background-color: $color-grey-medium;
|
||||||
}
|
}
|
||||||
&.available {
|
&.weekend.available {
|
||||||
background-color: $color-green;
|
background-color: $color-green;
|
||||||
}
|
}
|
||||||
|
&.week {
|
||||||
|
background-color: $color-red-light;
|
||||||
|
}
|
||||||
|
&.week.unknown {
|
||||||
|
background-color: $color-grey-light;
|
||||||
|
}
|
||||||
|
&.week.available {
|
||||||
|
background-color: $color-green-light;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.teamMembers {
|
.teamMembers {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
$color-white: #fff;
|
$color-white: #fff;
|
||||||
$color-black: #000;
|
$color-black: #000;
|
||||||
$color-red: #f00;
|
$color-red: #f00;
|
||||||
|
$color-red-light: #ec7c7c;
|
||||||
$color-blue: rgb(43, 61, 223);
|
$color-blue: rgb(43, 61, 223);
|
||||||
$color-orange: #ea4d0a;
|
$color-orange: #ea4d0a;
|
||||||
$color-yellow: #fdd137;
|
$color-yellow: #fdd137;
|
||||||
@ -9,6 +10,7 @@ $color-grey-medium: #999;
|
|||||||
$color-grey-light: #ccc;
|
$color-grey-light: #ccc;
|
||||||
$color-grey-lighter: #eee;
|
$color-grey-lighter: #eee;
|
||||||
$color-green: #080;
|
$color-green: #080;
|
||||||
|
$color-green-light: #58ba58;
|
||||||
|
|
||||||
$color-unknown: rgb(232, 223, 235);
|
$color-unknown: rgb(232, 223, 235);
|
||||||
$color-active-unknown: rgb(167, 74, 196);
|
$color-active-unknown: rgb(167, 74, 196);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user