diff --git a/packages/common/src/components/mdx_components/session_timetable.tsx b/packages/common/src/components/mdx_components/session_timetable.tsx index 56597e9..99ebaa2 100644 --- a/packages/common/src/components/mdx_components/session_timetable.tsx +++ b/packages/common/src/components/mdx_components/session_timetable.tsx @@ -2,7 +2,7 @@ import { Button, Chip, CircularProgress, Stack, styled, Table, TableBody, TableC import { ErrorBoundary, Suspense } from "@suspensive/react"; import { DateTime } from "luxon"; import { FC, useState } from "react"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import { isArray, isEmpty, isString } from "remeda"; import { CenteredPage } from "@frontend/common/components/centered_page"; @@ -108,8 +108,9 @@ const SessionColumn: FC<{ rowSpan: number; colSpan?: number; session: SessionSchema; + selectedDate: string; getSessionUrl?: (session: SessionSchema) => string; -}> = ({ rowSpan, colSpan, session, getSessionUrl }) => { +}> = ({ rowSpan, colSpan, session, selectedDate, getSessionUrl }) => { const sessionUrl = getSessionUrl ? getSessionUrl(session) : undefined; const clickable = isArray(session.speakers) && !isEmpty(session.speakers) && !!sessionUrl; // Firefox는 rowSpan된 td의 height를 계산할 때 rowSpan을 고려하지 않습니다. 따라서 직접 계산하여 height를 설정합니다. @@ -117,7 +118,7 @@ const SessionColumn: FC<{ return ( {clickable ? ( - + @@ -155,7 +156,9 @@ type SessionTimeTablePropType = { export const SessionTimeTable: FC = ErrorBoundary.with( { fallback: ErrorFallback }, Suspense.with({ fallback: } /> }, ({ event, types, getSessionUrl }) => { - const [confDate, setConfDate] = useState(""); + const location = useLocation(); + + const [confDate, setConfDate] = useState(location.state?.selectedDate ?? ""); const { language } = Common.useCommonContext(); const backendAPIClient = BackendAPI.useBackendClient(); @@ -168,7 +171,7 @@ export const SessionTimeTable: FC = ErrorBoundary.with const roomCount = Object.keys(rooms).length; const sortedRoomList = Object.keys(rooms).sort(); - const selectedDate = confDate || dates[0]; + const [selectedDate, setSelectedDate] = useState(location.state?.selectedDate ?? (confDate || dates[0])); const selectedTableData = timeTableData[selectedDate]; let breakCount = 0; @@ -186,7 +189,15 @@ export const SessionTimeTable: FC = ErrorBoundary.with {dates.map((date, i) => { const dateStr = DateTime.fromISO(date).setLocale(language).toLocaleString({ weekday: "long", month: "long", day: "numeric" }); return ( -