+
-
-
인원
-
게스트 {totalGuest}명
+
+
인원
+
게스트 {totalGuest}명
+
);
@@ -43,11 +47,31 @@ const ReserveFormInfo = (props: Props) => {
export default ReserveFormInfo;
const StyledReserveFormInfo = styled.div`
- .reserve-form__date,
+ border-radius: 10px;
.reserve-form__column {
- padding: 1rem;
+ display: flex;
+ align-items: center;
}
+ .reserve-form__item {
+ padding: 8px;
+ .reserve-form__title {
+ font-size: ${({ theme }) => theme.fontSize.small};
+ font-weight: 700;
+ }
+ .reserve-form__info {
+ color: ${({ theme }) => theme.colors.gray2};
+ }
+ }
+ border: ${({ theme }) => `1px solid ${theme.colors.gray4}`};
.reserve-form__column:first-child {
- display: flex;
+ }
+ .reserve-form__date {
+ flex: 1;
+ }
+ .reserve-form__date:first-child {
+ border-right: ${({ theme }) => `1px solid ${theme.colors.gray4}`};
+ }
+ .reserve-form__column:last-child {
+ border-top: ${({ theme }) => `1px solid ${theme.colors.gray4}`};
}
`;
diff --git a/FE/airbnb/src/components/reserveRoomList/reserveForm/ReserveFromPrice.tsx b/FE/airbnb/src/components/reserveRoomList/reserveForm/ReserveFromPrice.tsx
new file mode 100644
index 000000000..1b354f7e5
--- /dev/null
+++ b/FE/airbnb/src/components/reserveRoomList/reserveForm/ReserveFromPrice.tsx
@@ -0,0 +1,87 @@
+import { useRecoilValue } from 'recoil';
+import styled from 'styled-components';
+import { selectDateState } from '../../../recoil/calendarAtom';
+import { getBetweenDays } from '../../header/form/calendar/calendarDateFn';
+
+interface Props {
+ chargePerNight: number;
+}
+
+const ReserveFromPrice = ({ chargePerNight }: Props) => {
+ const selectDate = useRecoilValue(selectDateState);
+
+ const getCleanCharge = (totalPrice: number): number => Math.floor(totalPrice * 0.03);
+ const getServiceCharge = (totalPrice: number): number => Math.floor(totalPrice * 0.15);
+ const getTaxCharge = (totalPrice: number): number => Math.floor(totalPrice * 0.01);
+
+ const betweenDays = getBetweenDays(selectDate.checkIn, selectDate.checkOut);
+ const totalPrice = chargePerNight * betweenDays;
+
+ const cleanCharge = getCleanCharge(totalPrice);
+ const serviceCharge = getServiceCharge(totalPrice);
+ const taxCharge = getTaxCharge(totalPrice);
+
+ const totalCharge = totalPrice + cleanCharge + serviceCharge + taxCharge;
+
+ return (
+
+
+
+
+ ₩{chargePerNight.toLocaleString()} x {betweenDays}박
+
+
₩{totalPrice.toLocaleString()}
+
+
+
청소비
+
₩{cleanCharge.toLocaleString()}
+
+
+
서비스 수수료
+
₩{serviceCharge.toLocaleString()}
+
+
+
숙박세와 수수료
+
₩{taxCharge.toLocaleString()}
+
+
+
+
+
총 합계
+
₩{totalCharge.toLocaleString()}
+
+
+
+ );
+};
+
+export default ReserveFromPrice;
+
+const StyledReservePriceWrapper = styled.div`
+ .reserve-price__column {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 8px;
+ }
+ .reserve-price__title {
+ text-decoration: underline;
+ }
+`;
+
+const StyledReserveFormPrice = styled.div`
+ padding-bottom: 1rem;
+ border-bottom: ${({ theme }) => `2px solid ${theme.colors.gray5}`};
+ margin-bottom: 1rem;
+`;
+
+const StyledReserveCharge = styled.div`
+ font-weight: 700;
+ .reserve-price__column {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 8px;
+ }
+ .reserve-price__title {
+ text-decoration: underline;
+ }
+`;