Skip to content

Commit

Permalink
rearrange the order of rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
dada878 committed Feb 15, 2024
1 parent 351e182 commit fbdeb87
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 5 deletions.
28 changes: 27 additions & 1 deletion components/website/AgendaPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,33 @@ export default function Page({
.sort()
.map((item) => parseTime(item))
.filter((item, index, self) => self.indexOf(item) === index);
const rooms = sessions.rooms;
const rooms = [
{
"id": "R2",
"zh": { "name": "R2", "description": "" },
"en": { "name": "R2", "description": "" }
},
{
"id": "R0",
"zh": { "name": "R0", "description": "" },
"en": { "name": "R0", "description": "" }
},
{
"id": "R1",
"zh": { "name": "R1", "description": "" },
"en": { "name": "R1", "description": "" }
},
{
"id": "R3",
"zh": { "name": "R3", "description": "" },
"en": { "name": "R3", "description": "" }
},
{
"id": "S",
"zh": { "name": "S", "description": "" },
"en": { "name": "S", "description": "" }
}
];
const timeTableStyle = {
gridTemplateColumns:
"[time] auto" +
Expand Down
36 changes: 32 additions & 4 deletions components/website/SessionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@ export default function SessionCard({
}
const { isMobile } = useMediaQuery();

const rooms = [
{
"id": "R2",
"zh": { "name": "R2", "description": "" },
"en": { "name": "R2", "description": "" }
},
{
"id": "R0",
"zh": { "name": "R0", "description": "" },
"en": { "name": "R0", "description": "" }
},
{
"id": "R1",
"zh": { "name": "R1", "description": "" },
"en": { "name": "R1", "description": "" }
},
{
"id": "R3",
"zh": { "name": "R3", "description": "" },
"en": { "name": "R3", "description": "" }
},
{
"id": "S",
"zh": { "name": "S", "description": "" },
"en": { "name": "S", "description": "" }
}
];

const session = sessions.sessions.find((x) => x.id == sessionID)!;
const clickable = session.zh.description != "";

Expand Down Expand Up @@ -64,16 +92,16 @@ export default function SessionCard({
} else if (broadcast != null) {
const roomStartID: number = Math.min(
...session!.broadcast.map((x) =>
sessions.rooms.map((x) => x.id).indexOf(x),
rooms.map((x) => x.id).indexOf(x),
),
);
const roomEndID: number = Math.max(
...session!.broadcast.map((x) =>
sessions.rooms.map((x) => x.id).indexOf(x),
rooms.map((x) => x.id).indexOf(x),
),
);
const roomStart = sessions.rooms.map((x) => x.id)[roomStartID] || "time";
const roomEnd = sessions.rooms.map((x) => x.id)[roomEndID + 1] || "end";
const roomStart = rooms.map((x) => x.id)[roomStartID] || "time";
const roomEnd = rooms.map((x) => x.id)[roomEndID + 1] || "end";
gridColumnString = `${roomStart} / ${roomEnd}`;
} else {
gridColumnString = session!.room;
Expand Down

0 comments on commit fbdeb87

Please sign in to comment.