Skip to content

Commit

Permalink
Merge pull request #67 from Spaces-Place/dusqo
Browse files Browse the repository at this point in the history
step4 title 내보이기중
  • Loading branch information
KangYeonbae authored Dec 5, 2024
2 parents 499db07 + 9c45554 commit 8b3356c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
34 changes: 17 additions & 17 deletions src/components/steps/BookingStep4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PAYMENT_METHODS } from "../../constants/bookingIndex";

export const BookingStep4 = ({ bookingData, bookingInfo, price }) => {
export const BookingStep4 = ({ bookingData, bookingInfo, price, totalprice, spaceName }) => {
// 시간 포맷팅 함수
const formatTime = (timeString) => {
return new Date(timeString).toLocaleTimeString('ko-KR', {
Expand All @@ -10,36 +10,36 @@ export const BookingStep4 = ({ bookingData, bookingInfo, price }) => {
});
};

// reservationInfo와 spaceInfo를 bookingData, bookingInfo에서 분리
const { spaceInfo, reservationInfo } = bookingData || {};
console.log(bookingData, spaceName)
console.log(bookingInfo)
console.log(price, totalprice)



return (
<div className="booking_step">
<h2 className="booking_step4-text">예약 확인</h2>
<div className="booking_step4-round">
<div>
<h3 className="booking_step4-booking-info">예약정보</h3>
<p>공간: {spaceInfo?.title}</p>
{reservationInfo?.date ? (
<p>날짜: {reservationInfo.date}</p>
) : (
<p>시간: {formatTime(reservationInfo?.start_time)} ~ {formatTime(reservationInfo?.end_time)}</p>
)}
<p>인원: {reservationInfo?.numberOfPeople}</p>
{reservationInfo?.requirements && (
<p>요청사항: {reservationInfo.requirements}</p>
<p>공간: {spaceName}</p>
<p>날짜: {bookingData.date}</p>
<p>시간: {formatTime(bookingData.start_time)} ~ {formatTime(bookingData.end_time)}</p>
<p>인원: {bookingData.numberOfPeople}</p>
{bookingData.requirements && (
<p>요청사항: {bookingData.requirements}</p>
)}
</div>
<div>
<h3 className="booking_step4-booking-people">예약자 정보</h3>
<p>이름: {bookingData?.name}</p>
<p>연락처: {bookingData?.phone}</p>
<p>이메일: {bookingData?.email}</p>
<p>이름: {bookingData.name}</p>
<p>연락처: {bookingData.phone}</p>
<p>이메일: {bookingData.email}</p>
</div>
<div>
<h3 className="booking_step4-booking-payment">결제 정보</h3>
<p>결제 금액: {price?.toLocaleString()}</p>
<p>결제 수단: {PAYMENT_METHODS[reservationInfo?.paymentMethod]}</p>
<p>결제 금액: {price.toLocaleString()}</p>
<p>결제 수단: {PAYMENT_METHODS[bookingData.paymentMethod]}</p>
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/booking.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ return (
<BookingStep4
bookingData={bookingData}
bookingInfo={bookingInfo}
price={totalPrice || bookingInfo.price}
price={bookingInfo.price}
totalPrice={totalPrice}
spaceName={bookingInfo.title}
/>
)}

Expand Down

0 comments on commit 8b3356c

Please sign in to comment.