Remove lang from schedule table hook, reorder items

This commit is contained in:
Vencislav Atanasov 2024-09-23 17:13:34 +03:00
parent 8121f3fc30
commit b17572da4b
3 changed files with 6 additions and 11 deletions

View File

@ -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({
<table>
<thead>
<tr>
{header.map(hall => <th key={hall.id}>{hall.name}</th>)}
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr>
</thead>
<tbody>
@ -55,7 +54,7 @@ export default function Schedule({
</tbody>
<tfoot>
<tr>
{header.map(hall => <th key={hall.id}>{hall.name}</th>)}
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr>
</tfoot>
</table>

View File

@ -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,

View File

@ -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,