Make events accordion actually change
This commit is contained in:
parent
368be242e0
commit
ab427cfca0
@ -132,7 +132,29 @@ export default function () {
|
|||||||
);
|
);
|
||||||
onOpen();
|
onOpen();
|
||||||
}}
|
}}
|
||||||
onSelectSlot={(s) => {}}
|
onSelectSlot={(s) => {
|
||||||
|
const day = s.start.getUTCDate();
|
||||||
|
const month = s.start.getUTCMonth() + 1;
|
||||||
|
|
||||||
|
for (const [type, setter] of Object.entries({
|
||||||
|
fotd: setTodayFOTD,
|
||||||
|
gamenight: setTodayGameNight,
|
||||||
|
qotd: setTodayQOTD,
|
||||||
|
rotw: setTodayROTW,
|
||||||
|
})) {
|
||||||
|
const event = data.eventList.find(
|
||||||
|
(ev) => ev.type === type && ev.day === day && ev.month === month,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!event) continue;
|
||||||
|
|
||||||
|
setter(
|
||||||
|
event.type === "rotw"
|
||||||
|
? `${event.details}\n\nAnswer: ${event.answer}`
|
||||||
|
: (event.details as string),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
popup
|
popup
|
||||||
startAccessor={(event) => new Date(event.start)}
|
startAccessor={(event) => new Date(event.start)}
|
||||||
style={{ height: 500 }}
|
style={{ height: 500 }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user