From b17572da4b1f8b49f60d436f5b3b9b82d6a86440 Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Mon, 23 Sep 2024 17:13:34 +0300 Subject: [PATCH] Remove lang from schedule table hook, reorder items --- src/Schedule/Schedule.jsx | 9 ++++----- src/hooks/useSchedule.js | 2 +- src/hooks/useScheduleTable.js | 6 +----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Schedule/Schedule.jsx b/src/Schedule/Schedule.jsx index 0b5adb6..ddde193 100644 --- a/src/Schedule/Schedule.jsx +++ b/src/Schedule/Schedule.jsx @@ -15,10 +15,10 @@ export default function Schedule({ lang, }) { const { - events, speakers, tracks, halls, + events, slots, isLoading, loadingProgress, @@ -29,11 +29,10 @@ export default function Schedule({ header, rows, } = useScheduleTable({ - events, tracks, halls, + events, slots, - lang, }); return (<> @@ -43,7 +42,7 @@ export default function Schedule({ - {header.map(hall => )} + {header.map(hall => )} @@ -55,7 +54,7 @@ export default function Schedule({ - {header.map(hall => )} + {header.map(hall => )}
{hall.name}{hall.name[lang]}
{hall.name}{hall.name[lang]}
diff --git a/src/hooks/useSchedule.js b/src/hooks/useSchedule.js index 0ec43ad..e83eb9f 100644 --- a/src/hooks/useSchedule.js +++ b/src/hooks/useSchedule.js @@ -78,11 +78,11 @@ export default function useSchedule(conferenceId) { } = calculateProgress(events, speakers, tracks, eventTypes, halls, slots); return { - events, speakers, tracks, eventTypes, halls, + events, slots, isLoading, loadingProgress, diff --git a/src/hooks/useScheduleTable.js b/src/hooks/useScheduleTable.js index 6f7f6e3..2032ea1 100644 --- a/src/hooks/useScheduleTable.js +++ b/src/hooks/useScheduleTable.js @@ -1,12 +1,8 @@ export default function useScheduleTable({ events = {}, halls = {}, - lang, }) { - const header = Object.values(halls).map(hall => ({ - id: hall.id, - name: hall.name[lang], - })); + const header = Object.values(halls); const rows = Object.values(events).map(event => ({ id: event.id,