From 0ac9b0aeff30c6c050c364b1983475c2cad79ef3 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Tue, 15 Oct 2024 15:32:41 +0200 Subject: [PATCH] fix events ui (styling, rdb mode) :bug: --- src/components/events/EventList.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/events/EventList.tsx b/src/components/events/EventList.tsx index 4cf3649f..54a7449b 100644 --- a/src/components/events/EventList.tsx +++ b/src/components/events/EventList.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import {sortByYear, groupByYear, isPastOrWithinNext31Days, type ReducedEvent } from '~/util/EventUtil.ts'; +import {sortByYear, groupByYear, isPastOrWithinNext31Days, type ReducedEvent, getHumanReadableAttendanceMode } from '~/util/EventUtil.ts'; import EventInfoList from './EventInfoList.tsx'; interface Props { @@ -53,7 +53,7 @@ function ControlButtons({label, options, selectedOption, setOption}: ControlButt function EventCard (event: ReducedEvent) { return ( -
+

{event.data.title}

@@ -103,7 +103,7 @@ export default function EventList( {events, showFilter = true, showPastFutureLim .map(year => parseInt(year)) // Convert keys to numbers .sort((a, b) => b - a); // Sort in descending order (b - a) - const modes = new Set(events.map((event) => event.data.mode)); + const modes = new Set(events.map((event) => getHumanReadableAttendanceMode(event.data.mode))); const toggleMode = (mode: string) => { mode === config.mode ? setConfig({...config, mode: null}) : setConfig({...config, mode: mode}) } @@ -119,7 +119,7 @@ export default function EventList( {events, showFilter = true, showPastFutureLim } const filterEvents = (event: ReducedEvent) => { - if (config.mode && event.data.mode !== config.mode) return false; + if (config.mode && getHumanReadableAttendanceMode(event.data.mode) !== config.mode) return false; if (config.audience && !(event.data.audience as string[]).includes(config.audience)) return false; if (config.category && event.data.category !== config.category) return false; return true; @@ -139,7 +139,7 @@ export default function EventList( {events, showFilter = true, showPastFutureLim ) } -

Upcoming

+

Upcoming

Found {upcomingEvents.filter(filterEvents).length} upcoming event(s). @@ -150,7 +150,7 @@ export default function EventList( {events, showFilter = true, showPastFutureLim )) } -

Archive

+

Archive

Found {pastEvents.filter(filterEvents).length} past event(s).