Skip to content

Commit

Permalink
Update Place Info Card & My Reservation Table (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 authored Dec 27, 2023
1 parent f38ca34 commit 09b8b64
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
14 changes: 12 additions & 2 deletions components/auth/MyPlaceReservationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PlaceReservationDetailModal
from '../reservation/place.reservation.detail.modal'
import DeleteConfirmModal from '../common/delete.confirm.modal'
import { PoPoAxios } from '@/lib/axios.instance'
import Link from 'next/link'

const MyPlaceReservationTable = () => {
const [reserve_list, setReserveList] = useState<IPlaceReservation[]>([])
Expand All @@ -27,7 +28,8 @@ const MyPlaceReservationTable = () => {
<Table.Header>
<Table.Row textAlign="center">
<Table.HeaderCell width={1}>#</Table.HeaderCell>
<Table.HeaderCell width={5}>예약 제목</Table.HeaderCell>
<Table.HeaderCell width={3}>예약 제목</Table.HeaderCell>
<Table.HeaderCell width={3}>예약 설명</Table.HeaderCell>
<Table.HeaderCell width={4}>예약 장소</Table.HeaderCell>
<Table.HeaderCell width={3}>예약 기간</Table.HeaderCell>
<Table.HeaderCell width={1}>상태</Table.HeaderCell>
Expand All @@ -51,7 +53,15 @@ const MyPlaceReservationTable = () => {
}
/>

<Table.Cell>{reservation.place.name}</Table.Cell>
<Table.Cell style={{cursor: 'pointer'}}>
{reservation.description}
</Table.Cell>

<Table.Cell>
<Link href={`/reservation/place/${reservation.place.region}/${reservation.place.name}`}>
{reservation.place.name}
</Link>
</Table.Cell>

<Table.Cell>
{convertDate(reservation.date)}<br/>
Expand Down
16 changes: 16 additions & 0 deletions components/reservation/place.information.card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ const PlaceInformationCard: FunctionComponent<{
<Card.Description>{placeInfo.description}</Card.Description>
<Card.Meta style={{marginTop: 8}}>
<OpeningHoursList openingHours={JSON.parse(placeInfo.opening_hours)}/>
{
(placeInfo.max_minutes !== 24 * 60 || placeInfo.max_concurrent_reservation > 1) ? (
<ul style={{paddingLeft: 16}}>
{
placeInfo.max_minutes !== 24 * 60 ? (
<li>최대 예약 기간: {placeInfo.max_minutes}</li>
) : null
}
{
placeInfo.max_concurrent_reservation > 1 ? (
<li>동시 예약 가능 갯수: 최대 {placeInfo.max_concurrent_reservation}개 예약</li>
) : null
}
</ul>
) : null
}
</Card.Meta>
</Card.Content>
</Card>
Expand Down
1 change: 1 addition & 0 deletions types/reservation.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface IPlace {
description: string;
image_url?: string;
max_minutes: number;
max_concurrent_reservation: number;
opening_hours: string;
}

Expand Down

0 comments on commit 09b8b64

Please sign in to comment.