diff --git a/src/Schedule/Event.jsx b/src/Schedule/Event.jsx index bf7d109..eef8413 100644 --- a/src/Schedule/Event.jsx +++ b/src/Schedule/Event.jsx @@ -4,7 +4,7 @@ import FeedbackLink from './FeedbackLink.jsx'; export default function Event(event) { return (<> - {event.title} + {event.title}
{event.participant_users && !isTrackHidden(event.track) && <> {event.participant_users.map(speaker => speaker && )} diff --git a/src/Schedule/Schedule.jsx b/src/Schedule/Schedule.jsx index bdd4583..0b5adb6 100644 --- a/src/Schedule/Schedule.jsx +++ b/src/Schedule/Schedule.jsx @@ -62,18 +62,18 @@ export default function Schedule({
- {Object.entries(tracks).filter(([, track]) => + {Object.values(tracks).filter(track => !isTrackHidden(track) - ).map(([trackId, track]) => + ).map(track => )} - {Object.entries(langs).map(([code, name]) => - + {Object.entries(langs).map(([langId, langName]) => + )}
{track.name[lang]}
{name}
{langName}
- {Object.entries(events).map(([eventId, event]) =>
+ {Object.values(events).map(event =>

{event.title} {event.participant_users && !isTrackHidden(event.track) && <> @@ -92,14 +92,14 @@ export default function Schedule({

)} {<>
- {Object.entries(speakers).map(([speakerId, speaker]) => - {Object.entries(speakers).map(([speakerId, speaker]) => -
+ {Object.values(speakers).map(speaker => +
{getSpeakerName(speaker)}/

{getSpeakerName(speaker)}

diff --git a/src/Schedule/Speaker.jsx b/src/Schedule/Speaker.jsx index 7001852..c6ef067 100644 --- a/src/Schedule/Speaker.jsx +++ b/src/Schedule/Speaker.jsx @@ -3,12 +3,13 @@ import PropTypes from 'prop-types'; export default function Speaker(speaker) { return (<> - {getSpeakerName(speaker)} + {getSpeakerName(speaker)} {speaker.organisation && <>/⁠{speaker.organisation}⁠/} ); } Speaker.propTypes = { + id: PropTypes.number.isRequired, first_name: PropTypes.string.isRequired, last_name: PropTypes.string.isRequired, organisation: PropTypes.string, diff --git a/src/hooks/useCfpRequest.js b/src/hooks/useCfpRequest.js index 9c3e8a3..ee11474 100644 --- a/src/hooks/useCfpRequest.js +++ b/src/hooks/useCfpRequest.js @@ -1,6 +1,6 @@ import useSWR from 'swr'; -const fetcher = (...args) => fetch(...args).then(res => res.json()); +const fetcher = (input, init) => fetch(input, init).then(res => res.json()); export default function useCfpRequest(path) { return useSWR(import.meta.env.VITE_CFP_BASE_URL.concat(path), fetcher); diff --git a/src/hooks/useScheduleTable.js b/src/hooks/useScheduleTable.js index e4b612c..6f7f6e3 100644 --- a/src/hooks/useScheduleTable.js +++ b/src/hooks/useScheduleTable.js @@ -3,14 +3,13 @@ export default function useScheduleTable({ halls = {}, lang, }) { - const hallIds = new Set(Object.keys(halls)); - const header = Object.entries(halls).filter(([id]) => hallIds.has(id)).map(([id, hall]) => ({ - id, + const header = Object.values(halls).map(hall => ({ + id: hall.id, name: hall.name[lang], })); - const rows = Object.entries(events).map(([eventId, event]) => ({ - id: eventId, + const rows = Object.values(events).map(event => ({ + id: event.id, cells: [{ id: 1, attributes: { diff --git a/src/utils.js b/src/utils.js index cf372a2..b7c313c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -45,7 +45,7 @@ export function calculateProgress(...elements) { export const addIdAndRelations = (items, relations = []) => Object.fromEntries(Object.entries(items).map(([id, item]) => ([id, { - id, + id: parseInt(id, 10), ...item, ...Object.fromEntries(relations.map(([field, collection, idField]) => ([ field,