diff --git a/FE/airbnb/src/components/util/ConditionalLink.tsx b/FE/airbnb/src/components/util/ConditionalLink.tsx
index 080b1cd3e..70cf17561 100644
--- a/FE/airbnb/src/components/util/ConditionalLink.tsx
+++ b/FE/airbnb/src/components/util/ConditionalLink.tsx
@@ -7,6 +7,6 @@ interface Props {
}
const ConditionalLink = ({ children, to, condition }: Props) =>
- !!condition && to ? {children} : <>{children}>;
+ condition && to ? {children} : <>{children}>;
export default ConditionalLink;
diff --git a/FE/airbnb/src/pages/ReservePage.tsx b/FE/airbnb/src/pages/ReservePage.tsx
index 3cf4593f7..178ea7f0a 100644
--- a/FE/airbnb/src/pages/ReservePage.tsx
+++ b/FE/airbnb/src/pages/ReservePage.tsx
@@ -1,8 +1,9 @@
-import { useEffect } from 'react';
+import { Suspense, useEffect } from 'react';
import { useRecoilValue, useRecoilState } from 'recoil';
import styled from 'styled-components';
import Map from '../components/map/Map';
import ReserveHeader from '../components/reserveHeader/ReserveHeader';
+import MapSkeleton from '../components/reservePageSkeleton/MapSkeleton';
import ReserveRoomList from '../components/reserveRoomList/ReserveRoomList';
import { reserveInfoSelector } from '../recoil/headerAtom';
import { getRoomsSelector } from '../recoil/reserveRoomAtom';
@@ -11,8 +12,6 @@ interface Props {}
const ReservePage = ({}: Props) => {
const [reserveInfo, setReserveInfo] = useRecoilState(reserveInfoSelector);
- const roomsData = useRecoilValue(getRoomsSelector);
- console.log(roomsData);
useEffect(() => {
const [encodedAddress, checkIn, checkOut, minCharge, maxCharge, adult, child, infants] =
getQueryValue(window.location.search);
@@ -35,8 +34,12 @@ const ReservePage = ({}: Props) => {
return (
-
-
+
+
+
+ }>
+
+
);
};
diff --git a/FE/airbnb/src/recoil/reserveRoomAtom.ts b/FE/airbnb/src/recoil/reserveRoomAtom.ts
index 3e47249d5..4a4c144e6 100644
--- a/FE/airbnb/src/recoil/reserveRoomAtom.ts
+++ b/FE/airbnb/src/recoil/reserveRoomAtom.ts
@@ -1,6 +1,7 @@
import { atom, selector } from 'recoil';
import { roomType } from '../components/reserveRoomList/roomType';
import { serverAPI } from '../util/api';
+import { delay } from '../util/util';
import { reserveInfoSelector, reserveQueryType } from './headerAtom';
import { roomData } from './roomSampleData';
@@ -20,7 +21,8 @@ export const getRoomsSelector = selector({
if (isUndefined(reserveInfo)) return null;
const response = await fetch(serverAPI.getRooms(reserveInfo));
const data = await response.json();
- return data;
+
+ return delay(1000, data);
},
});
diff --git a/FE/airbnb/src/util/util.js b/FE/airbnb/src/util/util.js
index d1c77545e..58cbf9575 100644
--- a/FE/airbnb/src/util/util.js
+++ b/FE/airbnb/src/util/util.js
@@ -14,3 +14,6 @@ export const getUrlParams = () => {
return params;
};
+
+export const delay = (time, value = '') =>
+ new Promise((resolve) => setTimeout(() => resolve(value), time));