Skip to content

Commit

Permalink
refactor: 코드리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
CheeseB committed Mar 29, 2024
1 parent a116a67 commit 57d50d3
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/components/calendar/ModalContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const ModalContents = ({ gameId, activeDate, onClickCloseButton, onClickCardButt
};

const ReservationMockData: Record<string, DetailReservationResponse> = {
'0-confirmed': reservationDetailMockDataConfirmed as DetailReservationResponse,
'0-declined': reservationDetailMockDataDeclined as DetailReservationResponse,
'0-pending': reservationDetailMockDataPending as DetailReservationResponse,
'1-pending': reservationDetailMockDataPendingNoData as DetailReservationResponse,
'1-0-confirmed': reservationDetailMockDataConfirmed as DetailReservationResponse,
'1-0-declined': reservationDetailMockDataDeclined as DetailReservationResponse,
'1-0-pending': reservationDetailMockDataPending as DetailReservationResponse,
'1-1-pending': reservationDetailMockDataPendingNoData as DetailReservationResponse,
};

const dropdownOptions = getScheduleDropdownOption(DailyMockData[activeDate]);
Expand All @@ -60,22 +60,19 @@ const ModalContents = ({ gameId, activeDate, onClickCloseButton, onClickCardButt

const currentDeviceType = useDeviceType();

const { totalCount, reservations } = ReservationMockData[`${scheduleId}-${selectedStatus}`];
const { totalCount, reservations } = ReservationMockData[`${gameId}-${scheduleId}-${selectedStatus}`];

const handleChangeTabId = (selectedId: string | number) => {
setSelectedStatus(selectedId as MyReservationsStatus);
};

const handleChangeScheduleId = (value: string | number) => {
setScheduleId(value as number);
};

console.log(gameId);

return (
<div className={cx('schedule-modal-container')}>
<Tab
items={statusTabOptions}
size='small'
selectedTabId={selectedStatus}
onClick={(selectedId) => setSelectedStatus(selectedId as MyReservationsStatus)}
/>
<Tab items={statusTabOptions} size='small' selectedTabId={selectedStatus} onClick={handleChangeTabId} />
<div className={cx('schedule-modal-date')}>
<h3 className={cx('schedule-modal-date-title')}>예약 날짜</h3>
<span className={cx('schedule-modal-date-korean')}>{getDateStringKR(activeDate)}</span>
Expand Down

0 comments on commit 57d50d3

Please sign in to comment.