Remove lang from schedule table hook, reorder items
This commit is contained in:
parent
8121f3fc30
commit
b17572da4b
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue