diff --git a/server/src/data/bookings.json b/server/src/data/bookings.json index fc5d024..1f4955e 100644 --- a/server/src/data/bookings.json +++ b/server/src/data/bookings.json @@ -20,7 +20,12 @@ "petsNumber": 2 } }, - "alreadyBookedDates": [] + "alreadyBookedDates": [ + { + "startDate": "12/10/2024", + "endDate": "12/13/2024" + } + ] }, { "id": 2, diff --git a/server/src/data/reservations.json b/server/src/data/reservations.json index 9948956..451a424 100644 --- a/server/src/data/reservations.json +++ b/server/src/data/reservations.json @@ -82,5 +82,26 @@ "cleaningFee": 10, "longStayDiscount": 0 } + }, + { + "reservationId": 5, + "productId": 1, + "checkInDate": "12/10/2024", + "checkOutDate": "12/13/2024", + "guestCounts": { + "adults": 2, + "children": 1, + "infants": 1, + "pets": 1 + }, + "totalPrice": 458, + "breakdown": { + "nights": 3, + "pricePerNight": 146, + "basePrice": 438, + "airbnbServiceFee": 10, + "cleaningFee": 10, + "longStayDiscount": 0 + } } ] \ No newline at end of file diff --git a/src/components/SearchBar/SearchBar.jsx b/src/components/SearchBar/SearchBar.jsx index 3b3237f..2582f0a 100644 --- a/src/components/SearchBar/SearchBar.jsx +++ b/src/components/SearchBar/SearchBar.jsx @@ -9,6 +9,7 @@ import useOutsideClick from "../../hooks/useOutsideClick"; import { formatDateToMonthDay, formatDateRange, convertStringToDateObject, convertDateObjectToString } from "../../utils/dateUtils"; import { CloseButtonIcon } from "../../icons/CloseButtonIcon"; import AddGuestsPopUp from "../AddGuestsPopUp/AddGuestsPopUp"; +import DestinationPopUp from "../DestinationPopUp/DestinationPopUp"; import { calculateGuestCounts } from "../../utils/guestCounts"; import { useWindowSize } from "../../hooks/useWindowSize"; @@ -28,6 +29,7 @@ const SearchBar = ({ searchType, onSearch }) => { const [showCalendar, setShowCalendar] = useState(false); const [showWhoDropdown, setShowWhoDropdown] = useState(false); const [closing, setClosing] = useState(false); + const [handelDestinationPopUp, setHandelDestinationPopUp] = useState(false); const [hoverStates, setHoverStates] = useState({ location: false, checkIn: false, @@ -121,8 +123,10 @@ const SearchBar = ({ searchType, onSearch }) => { } const closeCalendarPopup = () => setShowCalendar(false) + const closeDestinationPopup = () => setHandelDestinationPopUp(false) const closeWhoDropdown = () => setShowWhoDropdown(false) + const destinationRef = useOutsideClick(closeDestinationPopup) const searchBarRef = useOutsideClick(disableSearchBarFocus); const calendarRef = useOutsideClick(closeCalendarPopup) const whoRef = useOutsideClick(closeWhoDropdown) @@ -213,7 +217,13 @@ const SearchBar = ({ searchType, onSearch }) => { onSearch(searchParams); }; - + + const handelDestinationClick = () =>{ + setHandelDestinationPopUp(!handelDestinationPopUp); + } + const handelDestination = (destination) =>{ + setLocation(destination); + } return ( <>