@admin-layout/tailwind-design-pro 10.0.9-alpha.9 → 10.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +345 -1
- package/lib/cdm-locales/en/settings.json +35 -1
- package/lib/cdm-locales/es/settings.json +37 -3
- package/lib/components/Layout/BasicLayout/index.d.ts +1 -2
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +146 -42
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.js +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts +1 -8
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/Copyright.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/Footer.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts +2 -15
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +70 -38
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Logo.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/Logo.js +141 -0
- package/lib/components/Layout/GlobalHeader/Logo.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +6 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js +230 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts +1 -12
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -13
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js +290 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts +9 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.js +118 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -0
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +1 -2
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/Divider.d.ts +1 -31
- package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +5 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js +51 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +1 -12
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Sidebar.js +108 -92
- package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +110 -20
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +29 -19
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/Layout/getPageTitle.d.ts +1 -16
- package/lib/components/Layout/getPageTitle.d.ts.map +1 -1
- package/lib/components/Layout/getPageTitle.js +1 -1
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.d.ts +1 -1
- package/lib/components/Layout/slot-fill/Footer.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.js +6 -6
- package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderNotice.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts +3 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js +6 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts +3 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js +6 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.d.ts +3 -0
- package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.js +6 -0
- package/lib/components/Layout/slot-fill/RightContent.js.map +1 -0
- package/lib/components/Layout/slot-fill/index.d.ts +3 -0
- package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
- package/lib/components/Layout/util.d.ts.map +1 -1
- package/lib/components/Layout/util.js +12 -0
- package/lib/components/Layout/util.js.map +1 -0
- package/lib/components/SettingDrawer/CheckBoxTheme.js +1 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts +1 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.js +75 -17
- package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.js +18 -10
- package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.js +685 -33
- package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +164 -39
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts +3 -0
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/WebFontsSelector.js +24 -0
- package/lib/components/SettingDrawer/WebFontsSelector.js.map +1 -0
- package/lib/components/SettingDrawer/types.d.ts +23 -2
- package/lib/components/SettingDrawer/types.d.ts.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +6 -16
- package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.js +26 -28
- package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/lib/components/ThemeProvider/ThemeToggle.js +50 -0
- package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -0
- package/lib/components/ThemeProvider/index.d.ts +2 -5
- package/lib/components/ThemeProvider/index.d.ts.map +1 -1
- package/lib/components/ThemeProvider/themes/airbnb.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/airbnb.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/airbnb.js +186 -0
- package/lib/components/ThemeProvider/themes/airbnb.js.map +1 -0
- package/lib/components/ThemeProvider/themes/default.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/default.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/default.js +183 -0
- package/lib/components/ThemeProvider/themes/default.js.map +1 -0
- package/lib/components/ThemeProvider/themes/github.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/github.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/github.js +190 -0
- package/lib/components/ThemeProvider/themes/github.js.map +1 -0
- package/lib/components/ThemeProvider/themes/index.d.ts +15 -0
- package/lib/components/ThemeProvider/themes/index.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/index.js +7 -0
- package/lib/components/ThemeProvider/themes/index.js.map +1 -0
- package/lib/components/ThemeProvider/themes/slack.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/slack.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/slack.js +188 -0
- package/lib/components/ThemeProvider/themes/slack.js.map +1 -0
- package/lib/components/ThemeProvider/themes/spotify.d.ts +3 -0
- package/lib/components/ThemeProvider/themes/spotify.d.ts.map +1 -0
- package/lib/components/ThemeProvider/themes/spotify.js +189 -0
- package/lib/components/ThemeProvider/themes/spotify.js.map +1 -0
- package/lib/components/ThemeProvider/types.d.ts +106 -106
- package/lib/components/ThemeProvider/types.d.ts.map +1 -1
- package/lib/components/UI/CardList.d.ts +61 -0
- package/lib/components/UI/CardList.d.ts.map +1 -0
- package/lib/components/UI/CardList.js +43 -0
- package/lib/components/UI/CardList.js.map +1 -0
- package/lib/components/UI/CategoriesTypeList.d.ts +29 -0
- package/lib/components/UI/CategoriesTypeList.d.ts.map +1 -0
- package/lib/components/UI/CategoriesTypeList.js +140 -0
- package/lib/components/UI/CategoriesTypeList.js.map +1 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +83 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +1 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.js +107 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.js.map +1 -0
- package/lib/components/UI/Pagination.d.ts +6 -0
- package/lib/components/UI/Pagination.d.ts.map +1 -0
- package/lib/components/UI/Pagination.js +59 -0
- package/lib/components/UI/Pagination.js.map +1 -0
- package/lib/components/UI/ParamSearchResultContainer.d.ts +101 -0
- package/lib/components/UI/ParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/UI/ParamSearchResultContainer.js +120 -0
- package/lib/components/UI/ParamSearchResultContainer.js.map +1 -0
- package/lib/components/UI/PropertyCard.d.ts +24 -0
- package/lib/components/UI/PropertyCard.d.ts.map +1 -0
- package/lib/components/UI/PropertyCard.js +375 -0
- package/lib/components/UI/PropertyCard.js.map +1 -0
- package/lib/components/UI/PropertyCardOnMap.d.ts +10 -0
- package/lib/components/UI/PropertyCardOnMap.d.ts.map +1 -0
- package/lib/components/UI/PropertyCardOnMap.js +108 -0
- package/lib/components/UI/PropertyCardOnMap.js.map +1 -0
- package/lib/components/UI/VehicleCard.d.ts +15 -0
- package/lib/components/UI/VehicleCard.d.ts.map +1 -0
- package/lib/components/UI/VehicleCardList.d.ts +14 -0
- package/lib/components/UI/VehicleCardList.d.ts.map +1 -0
- package/lib/components/UI/VehicleComponents/CarCardFooter.d.ts +7 -0
- package/lib/components/UI/VehicleComponents/CarCardFooter.d.ts.map +1 -0
- package/lib/components/UI/VehicleComponents/CarCardFooter.js +61 -0
- package/lib/components/UI/VehicleComponents/CarCardFooter.js.map +1 -0
- package/lib/components/UI/VehicleComponents/CarCardImage.d.ts +9 -0
- package/lib/components/UI/VehicleComponents/CarCardImage.d.ts.map +1 -0
- package/lib/components/UI/VehicleComponents/CarCardImage.js +32 -0
- package/lib/components/UI/VehicleComponents/CarCardImage.js.map +1 -0
- package/lib/components/UI/VehicleComponents/CarCardInfo.d.ts +13 -0
- package/lib/components/UI/VehicleComponents/CarCardInfo.d.ts.map +1 -0
- package/lib/components/UI/VehicleComponents/CarCardInfo.js +49 -0
- package/lib/components/UI/VehicleComponents/CarCardInfo.js.map +1 -0
- package/lib/components/UI/VehicleComponents/index.d.ts +4 -0
- package/lib/components/UI/VehicleComponents/index.d.ts.map +1 -0
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts +90 -0
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/UI/icons/LocationIcon.d.ts +7 -0
- package/lib/components/UI/icons/LocationIcon.d.ts.map +1 -0
- package/lib/components/UI/icons/LocationIcon.js +18 -0
- package/lib/components/UI/icons/LocationIcon.js.map +1 -0
- package/lib/components/UI/icons/index.d.ts +2 -0
- package/lib/components/UI/icons/index.d.ts.map +1 -0
- package/lib/components/UI/index.d.ts +9 -0
- package/lib/components/UI/index.d.ts.map +1 -0
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/typings.d.ts +133 -51
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/components/typings.js +6 -0
- package/lib/components/typings.js.map +1 -0
- package/lib/config/constants.d.ts +8 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +32 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/env-config.d.ts +15 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +66 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/helpers/DynamicIcon.d.ts +7 -4
- package/lib/helpers/DynamicIcon.d.ts.map +1 -1
- package/lib/helpers/DynamicIcon.js +51 -0
- package/lib/helpers/DynamicIcon.js.map +1 -0
- package/lib/hooks/index.d.ts +6 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.d.ts +18 -0
- package/lib/hooks/use-get-current-lat-long.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.js +29 -0
- package/lib/hooks/use-get-current-lat-long.js.map +1 -0
- package/lib/hooks/useMediaQuery.d.ts +14 -0
- package/lib/hooks/useMediaQuery.d.ts.map +1 -0
- package/lib/hooks/useMediaQuery.js +48 -0
- package/lib/hooks/useMediaQuery.js.map +1 -0
- package/lib/hooks/useScrollThreshold.d.ts +12 -0
- package/lib/hooks/useScrollThreshold.d.ts.map +1 -0
- package/lib/hooks/useScrollThreshold.js +60 -0
- package/lib/hooks/useScrollThreshold.js.map +1 -0
- package/lib/hooks/useTailwindTheme.d.ts +34 -0
- package/lib/hooks/useTailwindTheme.d.ts.map +1 -0
- package/lib/hooks/useTailwindTheme.js +82 -0
- package/lib/hooks/useTailwindTheme.js.map +1 -0
- package/lib/hooks/useWindowSize.d.ts +6 -0
- package/lib/hooks/useWindowSize.d.ts.map +1 -0
- package/lib/hooks/useWindowSize.js +20 -0
- package/lib/hooks/useWindowSize.js.map +1 -0
- package/lib/icons.d.ts +2 -0
- package/lib/icons.d.ts.map +1 -1
- package/lib/icons.js +3 -4
- package/lib/icons.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/machines/settingsMachine.d.ts +4 -1
- package/lib/machines/settingsMachine.d.ts.map +1 -1
- package/lib/machines/settingsMachine.js +170 -120
- package/lib/machines/settingsMachine.js.map +1 -1
- package/lib/machines/types.d.ts +124 -17
- package/lib/machines/types.d.ts.map +1 -1
- package/lib/machines/types.js +5 -0
- package/lib/machines/types.js.map +1 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +6 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts +6 -0
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +1 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +7 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/datasourcesMiddleware.d.ts +6 -0
- package/lib/middlewares/datasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +7 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/module.d.ts +0 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +14 -15
- package/lib/module.js.map +1 -1
- package/lib/redux/index.d.ts +2 -0
- package/lib/redux/index.d.ts.map +1 -0
- package/lib/redux/searchReducer.d.ts +42 -0
- package/lib/redux/searchReducer.d.ts.map +1 -0
- package/lib/redux/searchReducer.js +64 -0
- package/lib/redux/searchReducer.js.map +1 -0
- package/lib/tailwindConfig.d.ts +42 -0
- package/lib/tailwindConfig.d.ts.map +1 -0
- package/lib/tailwindConfig.js +23 -0
- package/lib/tailwindConfig.js.map +1 -0
- package/lib/utils/formateCarData.d.ts +2 -0
- package/lib/utils/formateCarData.d.ts.map +1 -0
- package/lib/utils/menu.d.ts.map +1 -1
- package/lib/utils/test-utils.d.ts.map +1 -1
- package/lib/utils/utils/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/lib/components/Layout/GlobalFooter/Copyright.js +0 -8
- package/lib/components/Layout/GlobalFooter/Copyright.js.map +0 -1
- package/lib/components/Layout/GlobalFooter/Footer.js +0 -22
- package/lib/components/Layout/GlobalFooter/Footer.js.map +0 -1
- package/lib/components/ThemeProvider/themeRegistry.d.ts +0 -3
- package/lib/components/ThemeProvider/themeRegistry.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themeRegistry.js +0 -388
- package/lib/components/ThemeProvider/themeRegistry.js.map +0 -1
- package/lib/components/ThemeProvider/themeUtils.d.ts +0 -26
- package/lib/components/ThemeProvider/themeUtils.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themeUtils.js +0 -135
- package/lib/components/ThemeProvider/themeUtils.js.map +0 -1
- package/lib/components/defaultSettings.d.ts +0 -4
- package/lib/components/defaultSettings.d.ts.map +0 -1
- package/lib/components/defaultSettings.js +0 -14
- package/lib/components/defaultSettings.js.map +0 -1
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useMemo,useState,useEffect,useCallback}from'react';import {BsHeart}from'@react-icons/all-files/bs/BsHeart.js';import {BsStarFill}from'@react-icons/all-files/bs/BsStarFill.js';import {FaUserAlt}from'@react-icons/all-files/fa/FaUserAlt.js';import {useTranslation}from'react-i18next';import {WithAuthentication}from'@adminide-stack/user-auth0-browser/lib/index.component.js';import {Splide,SplideSlide}from'@cdmbase/react-splide';import {useLocation}from'@remix-run/react';import {format}from'date-fns';import {startCase}from'lodash-es';import {useTailwindTheme}from'../../hooks/useTailwindTheme.js';import {useGetCurrentLongLat}from'../../hooks/use-get-current-lat-long.js';import {LocationIcon}from'./icons/LocationIcon.js';import {renderDynamicIcon}from'../../helpers/DynamicIcon.js';import {config}from'../../config/env-config.js';const convertHotelName = name => {
|
|
2
|
+
return name.toLowerCase().replace(/[^a-z0-9\s-]/g, '').replace(/[\s-]+/g, '-').replace(/-+/g, '-');
|
|
3
|
+
};
|
|
4
|
+
const generateHref = (room, from, to, adults, children) => {
|
|
5
|
+
switch (room.__typename) {
|
|
6
|
+
case 'AirbnbProperty':
|
|
7
|
+
return `https://www.airbnb.com/rooms/${room.id}?check_in=${from}&check_out=${to}&guests=${adults + children || 1}`;
|
|
8
|
+
case 'BookingProperty':
|
|
9
|
+
return `https://www.booking.com/hotel/${room.address.city.state.country.id}/${convertHotelName(room.name)}.html`;
|
|
10
|
+
case 'PricelineProperty':
|
|
11
|
+
const propertyId = room.metadata?.id_t;
|
|
12
|
+
const cityId = room?.metadata?.city?.id || '';
|
|
13
|
+
const checkInDate = typeof from === 'string' ? from : format(new Date(from), 'yyyyMMdd');
|
|
14
|
+
const checkOutDate = typeof to === 'string' ? to : format(new Date(to), 'yyyyMMdd');
|
|
15
|
+
const roomCount = 1;
|
|
16
|
+
const adultCount = adults;
|
|
17
|
+
return `https://www.priceline.com/relax/at/${propertyId}/from/${checkInDate}/to/${checkOutDate}/rooms/${roomCount}/adults/${adultCount}?cityId=${cityId}&cur=USD&psl=${propertyId}`;
|
|
18
|
+
default:
|
|
19
|
+
return `/property/${room.id}`;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const DealCard = ({
|
|
23
|
+
site,
|
|
24
|
+
price
|
|
25
|
+
}) => jsxs("div", {
|
|
26
|
+
className: "flex flex-col items-center p-2 rounded-md",
|
|
27
|
+
children: [jsx("span", {
|
|
28
|
+
className: "text-xs font-bold text-gray-700",
|
|
29
|
+
children: site
|
|
30
|
+
}), jsx("span", {
|
|
31
|
+
className: "text-base font-bold text-black",
|
|
32
|
+
children: typeof price === 'number' ? price.toLocaleString() : price
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
function calculateDuration(checkIn, checkOut) {
|
|
36
|
+
const checkInDate = new Date(checkIn);
|
|
37
|
+
const checkOutDate = new Date(checkOut);
|
|
38
|
+
const duration = Math.ceil((checkOutDate.getTime() - checkInDate.getTime()) / (1000 * 60 * 60 * 24));
|
|
39
|
+
return duration;
|
|
40
|
+
}
|
|
41
|
+
function formatDuration(days) {
|
|
42
|
+
if (days < 7) {
|
|
43
|
+
return `${days} ${days === 1 ? 'day' : 'days'}`;
|
|
44
|
+
} else {
|
|
45
|
+
const weeks = Math.floor(days / 7);
|
|
46
|
+
const remainingDays = days % 7;
|
|
47
|
+
let result = `${weeks} ${weeks === 1 ? 'week' : 'weeks'}`;
|
|
48
|
+
if (remainingDays > 0) {
|
|
49
|
+
result += `, ${remainingDays} ${remainingDays === 1 ? 'day' : 'days'}`;
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const PropertyCard = ({
|
|
55
|
+
item,
|
|
56
|
+
isSaved,
|
|
57
|
+
setFocus,
|
|
58
|
+
setBlur,
|
|
59
|
+
handleLike,
|
|
60
|
+
likeBtnLoading,
|
|
61
|
+
propertyTypes,
|
|
62
|
+
authenticated,
|
|
63
|
+
extraIcons = [],
|
|
64
|
+
...props
|
|
65
|
+
}) => {
|
|
66
|
+
const images = useMemo(() => item?.images?.data.map(({
|
|
67
|
+
url
|
|
68
|
+
}) => ({
|
|
69
|
+
src: url
|
|
70
|
+
})), [item]);
|
|
71
|
+
const [didLike, setDidLike] = useState(false);
|
|
72
|
+
useMemo(() => item?.totalReview == 0 ? 0 : item?.totalStar / item?.totalReview || 0, [item]);
|
|
73
|
+
const {
|
|
74
|
+
isDark,
|
|
75
|
+
grayColor
|
|
76
|
+
} = useTailwindTheme();
|
|
77
|
+
const {
|
|
78
|
+
t
|
|
79
|
+
} = useTranslation(['common', 'property-types']);
|
|
80
|
+
const types = useMemo(() => propertyTypes?.filter(type => item?.types?.includes(type.id)), [item, propertyTypes]);
|
|
81
|
+
const {
|
|
82
|
+
fetchCurrentLatLong,
|
|
83
|
+
location} = useGetCurrentLongLat();
|
|
84
|
+
const locationUrl = useLocation();
|
|
85
|
+
const params = new URLSearchParams(locationUrl.search);
|
|
86
|
+
const checkIn = params.get('checkIn') || params.get('from') || '';
|
|
87
|
+
const checkOut = params.get('checkOut') || params.get('to') || '';
|
|
88
|
+
const duration = calculateDuration(checkIn, checkOut);
|
|
89
|
+
const formattedDuration = formatDuration(duration);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
fetchCurrentLatLong();
|
|
92
|
+
}, []);
|
|
93
|
+
const getPriceType = useCallback(room => {
|
|
94
|
+
const type = room.preferences?.property?.pricing?.option?.priceType;
|
|
95
|
+
if (type === 'HOUR') {
|
|
96
|
+
return t('property.hr');
|
|
97
|
+
}
|
|
98
|
+
return t('property.night');
|
|
99
|
+
}, [t]);
|
|
100
|
+
useCallback(address => {
|
|
101
|
+
if (!location || !address) return null;
|
|
102
|
+
if (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.LatLng) {
|
|
103
|
+
const point1 = new window.google.maps.LatLng(location.latitude, location.longitude);
|
|
104
|
+
const point2 = new window.google.maps.LatLng(address.latitude_around, address.longitude_around);
|
|
105
|
+
if (window.google.maps.geometry && window.google.maps.geometry.spherical) {
|
|
106
|
+
const distance = window.google.maps.geometry.spherical.computeDistanceBetween(point1, point2);
|
|
107
|
+
const distanceInMiles = distance * 0.000621371;
|
|
108
|
+
return Math.floor(distanceInMiles);
|
|
109
|
+
} else {
|
|
110
|
+
console.error('Google Maps geometry library is not loaded.');
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}, [location]);
|
|
117
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
118
|
+
const adults = parseInt(searchParams.get('adults') || '0', 10) || 1;
|
|
119
|
+
const children = parseInt(searchParams.get('children') || '0', 10);
|
|
120
|
+
const amenities = item?.preferences?.property?.amenities;
|
|
121
|
+
const displayedIcons = amenities ? Object.entries(amenities)?.flatMap(([key, value]) => {
|
|
122
|
+
const enabledAmenities = Object.entries(value ?? {})?.filter(([key1, value1]) => value1?.enable && value1?.icon);
|
|
123
|
+
const displayedAmenities = enabledAmenities.slice(0, 8);
|
|
124
|
+
return displayedAmenities.length > 0 ? displayedAmenities.map(([key1, value1]) => renderDynamicIcon({
|
|
125
|
+
name: value1.icon,
|
|
126
|
+
style: {
|
|
127
|
+
iconColor: grayColor,
|
|
128
|
+
w: '20px',
|
|
129
|
+
h: '20px'
|
|
130
|
+
}
|
|
131
|
+
})) : [];
|
|
132
|
+
}) : [];
|
|
133
|
+
const LikeButton = () => jsx(Fragment, {
|
|
134
|
+
children: likeBtnLoading ? jsx("div", {
|
|
135
|
+
className: "w-12 h-12 border-4 border-t-blue-500 rounded-full animate-spin border-gray-200"
|
|
136
|
+
}) : jsx("button", {
|
|
137
|
+
className: `w-7 h-9.5 rounded-full flex items-center justify-center ${didLike ? 'bg-blue-400' : isDark ? 'bg-gray-800' : 'bg-white'}`,
|
|
138
|
+
onClick: () => handleLike(item.id),
|
|
139
|
+
"aria-label": "Select as your favourite",
|
|
140
|
+
children: jsx(BsHeart, {
|
|
141
|
+
className: isDark ? 'text-white' : 'text-gray-800'
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
WithAuthentication(LikeButton);
|
|
146
|
+
return jsx(Fragment, {
|
|
147
|
+
children: jsxs("div", {
|
|
148
|
+
className: "flex flex-row p-2 relative",
|
|
149
|
+
onMouseEnter: () => setFocus(item.id),
|
|
150
|
+
onMouseLeave: () => setBlur(item.id),
|
|
151
|
+
...props,
|
|
152
|
+
children: [item?.status === 'pending' && jsxs(Fragment, {
|
|
153
|
+
children: [jsx("div", {
|
|
154
|
+
className: "absolute w-full h-full bg-black bg-opacity-60 rounded-2xl z-10"
|
|
155
|
+
}), jsx("div", {
|
|
156
|
+
className: "absolute left-1/2 top-1/2 transform -translate-x-1/2 translate-y-1/2 text-white z-20",
|
|
157
|
+
children: jsx("p", {
|
|
158
|
+
className: "text-lg font-normal",
|
|
159
|
+
children: t('property.coming_soon')
|
|
160
|
+
})
|
|
161
|
+
})]
|
|
162
|
+
}), jsx("div", {
|
|
163
|
+
className: "w-full max-w-[350px] border border-solid border-gray-200 rounded-2xl overflow-hidden shadow-md transition-all duration-300 hover:transform hover:-translate-y-1 hover:shadow-lg",
|
|
164
|
+
children: jsxs("div", {
|
|
165
|
+
className: "w-full h-full flex flex-col justify-between space-y-4",
|
|
166
|
+
children: [jsxs("div", {
|
|
167
|
+
className: "relative w-full h-full rounded-xl",
|
|
168
|
+
children: [jsx("div", {
|
|
169
|
+
className: "absolute top-2 left-2 bg-green-600 text-white px-3 py-1 rounded-md text-sm font-bold shadow-md z-10",
|
|
170
|
+
children: "Breakfast included"
|
|
171
|
+
}), jsxs(Splide, {
|
|
172
|
+
"aria-label": "Property Images",
|
|
173
|
+
options: {
|
|
174
|
+
type: 'slide',
|
|
175
|
+
drag: 'free',
|
|
176
|
+
perPage: 1,
|
|
177
|
+
perMove: 1,
|
|
178
|
+
lazyLoad: 'sequential',
|
|
179
|
+
wheel: true,
|
|
180
|
+
releaseWheel: true,
|
|
181
|
+
pagination: false,
|
|
182
|
+
speed: 800
|
|
183
|
+
},
|
|
184
|
+
children: [jsx("div", {
|
|
185
|
+
className: "absolute top-2.5 right-2.5 z-10",
|
|
186
|
+
children: jsx(LikeButton, {})
|
|
187
|
+
}), images.map((image, i) => jsx(SplideSlide, {
|
|
188
|
+
children: jsx("a", {
|
|
189
|
+
href: generateHref(item, checkIn, checkOut, adults, children),
|
|
190
|
+
target: "_blank",
|
|
191
|
+
rel: "noopener noreferrer",
|
|
192
|
+
children: jsx("div", {
|
|
193
|
+
className: "w-full h-full rounded-xl",
|
|
194
|
+
children: jsx("img", {
|
|
195
|
+
src: image.src,
|
|
196
|
+
className: "rounded-xl h-[250px] w-full max-w-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
|
|
197
|
+
loading: "lazy",
|
|
198
|
+
alt: `Property ${i + 1}`
|
|
199
|
+
}, 'image_' + i)
|
|
200
|
+
}, 'sliderImage_' + i)
|
|
201
|
+
})
|
|
202
|
+
}, 'sliderslide_' + i))]
|
|
203
|
+
})]
|
|
204
|
+
}), jsxs("div", {
|
|
205
|
+
className: "w-full px-4 flex flex-col pt-2",
|
|
206
|
+
children: [jsxs("div", {
|
|
207
|
+
className: "flex flex-wrap items-center space-x-2 mb-2",
|
|
208
|
+
children: [jsxs("span", {
|
|
209
|
+
className: "text-sm font-medium",
|
|
210
|
+
children: [t('property.property_type'), ":"]
|
|
211
|
+
}), types?.map((item, index) => jsx("span", {
|
|
212
|
+
className: "bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded-full capitalize",
|
|
213
|
+
children: t(`property-types:${item.description}`)
|
|
214
|
+
}, index))]
|
|
215
|
+
}), jsx("h3", {
|
|
216
|
+
className: "text-lg font-medium mb-2 line-clamp-2",
|
|
217
|
+
children: item?.title
|
|
218
|
+
}), item?.address && item?.address.city && item?.address.city.state && jsxs("div", {
|
|
219
|
+
className: "flex items-center text-sm text-gray-500 mb-2",
|
|
220
|
+
children: [jsx(LocationIcon, {
|
|
221
|
+
w: "16px",
|
|
222
|
+
h: "20px"
|
|
223
|
+
}), jsxs("span", {
|
|
224
|
+
className: "truncate",
|
|
225
|
+
children: [item?.address.city.name + ', ' + item?.address.city.state.name, item?.address?.number ? ' · ' + item?.address?.number : '']
|
|
226
|
+
})]
|
|
227
|
+
}), displayedIcons.length > 0 && jsx("div", {
|
|
228
|
+
className: "flex space-x-3 mt-2 mb-3",
|
|
229
|
+
children: displayedIcons
|
|
230
|
+
}), jsxs("div", {
|
|
231
|
+
className: "flex flex-wrap space-x-2 mt-1 mb-3",
|
|
232
|
+
children: [item?.preferences?.property?.booking?.policy?.instantBookingEnabled && jsx("span", {
|
|
233
|
+
className: "bg-blue-100 text-blue-800 px-2 py-1 rounded-md text-xs capitalize",
|
|
234
|
+
children: t('property.instant_book')
|
|
235
|
+
}), item?.preferences?.property?.booking?.policy?.cancellation && jsx("span", {
|
|
236
|
+
className: "bg-green-100 text-green-800 px-2 py-1 rounded-md text-xs capitalize",
|
|
237
|
+
children: t('property.cancellation_policy')
|
|
238
|
+
})]
|
|
239
|
+
}), jsxs("div", {
|
|
240
|
+
className: "flex items-center mb-4",
|
|
241
|
+
children: [jsx(FaUserAlt, {
|
|
242
|
+
className: "text-gray-500"
|
|
243
|
+
}), jsxs("span", {
|
|
244
|
+
className: "text-sm text-gray-600 ml-2",
|
|
245
|
+
children: [item?.preferences?.property?.boarding?.maxPeople, " ", t('property.guests')]
|
|
246
|
+
})]
|
|
247
|
+
})]
|
|
248
|
+
}), config.ENABLE_PROPERTY_PRICE_COMPARISON && jsx("div", {
|
|
249
|
+
className: "px-4 w-full",
|
|
250
|
+
children: jsxs("div", {
|
|
251
|
+
className: "w-fit flex gap-4",
|
|
252
|
+
children: [jsx("hr", {
|
|
253
|
+
className: "w-full border-t border-gray-200"
|
|
254
|
+
}), jsxs("div", {
|
|
255
|
+
className: "flex flex-row",
|
|
256
|
+
children: [jsx(DealCard, {
|
|
257
|
+
site: "Vio.com",
|
|
258
|
+
price: 41387
|
|
259
|
+
}), jsx(DealCard, {
|
|
260
|
+
site: "Expedia.com",
|
|
261
|
+
price: 46369
|
|
262
|
+
}), jsx(DealCard, {
|
|
263
|
+
site: "More Deals",
|
|
264
|
+
price: 'View all'
|
|
265
|
+
})]
|
|
266
|
+
}), jsx("hr", {
|
|
267
|
+
className: "w-full border-t border-gray-200"
|
|
268
|
+
})]
|
|
269
|
+
})
|
|
270
|
+
}), jsxs("div", {
|
|
271
|
+
className: "flex flex-col sm:flex-row px-4 pb-4 w-full justify-between items-start sm:items-center",
|
|
272
|
+
children: [jsxs("div", {
|
|
273
|
+
className: "flex flex-col space-y-1 mb-3 sm:mb-0 w-full sm:w-auto",
|
|
274
|
+
children: [jsxs("div", {
|
|
275
|
+
className: "flex items-center",
|
|
276
|
+
children: [jsx(BsStarFill, {
|
|
277
|
+
className: "text-yellow-500 w-3 h-3 mr-1"
|
|
278
|
+
}), jsxs("span", {
|
|
279
|
+
className: "text-[0.832rem] font-bold text-gray-600",
|
|
280
|
+
children: [item?.reviewsOverview ? item.reviewsOverview.rating : 0, " (", item.reviewsOverview ? item.reviewsOverview.ratingCount : 0, ' ', t('property.reviews'), ")"]
|
|
281
|
+
})]
|
|
282
|
+
}), item?.__typename && jsxs("span", {
|
|
283
|
+
className: "text-[0.832rem] text-gray-500",
|
|
284
|
+
children: ["Booking through ", startCase(item.__typename.replace('Property', ''))]
|
|
285
|
+
})]
|
|
286
|
+
}), jsxs("div", {
|
|
287
|
+
className: "flex flex-col items-end space-y-2 w-full sm:w-auto",
|
|
288
|
+
children: [jsxs("div", {
|
|
289
|
+
className: "flex flex-col items-end space-y-1 w-full",
|
|
290
|
+
children: [jsxs("span", {
|
|
291
|
+
className: "text-[0.688rem] text-gray-500 text-right w-full",
|
|
292
|
+
children: [formattedDuration, ", ", adults + children, ' ', adults + children === 1 ? 'guest' : 'guests']
|
|
293
|
+
}), jsxs("div", {
|
|
294
|
+
className: "flex flex-col items-end space-y-0 w-full",
|
|
295
|
+
children: [item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.total !== item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount && jsxs("div", {
|
|
296
|
+
className: "flex items-center group relative",
|
|
297
|
+
children: [jsx("span", {
|
|
298
|
+
className: "text-xs text-gray-500",
|
|
299
|
+
children: "from"
|
|
300
|
+
}), jsx("span", {
|
|
301
|
+
className: "text-sm font-semibold text-gray-500 line-through ml-1 cursor-help hover:text-gray-600 group-hover:text-gray-600",
|
|
302
|
+
children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount
|
|
303
|
+
}), jsx("div", {
|
|
304
|
+
className: "hidden group-hover:block absolute top-0 right-0 transform -translate-y-full mt-2 w-[300px] shadow-lg bg-white rounded-md p-4 z-50",
|
|
305
|
+
children: jsxs("div", {
|
|
306
|
+
className: "flex flex-col space-y-2",
|
|
307
|
+
children: [item.preferences?.property?.pricing?.price?.price_breakdown?.details?.discounts?.items.map((charge, index) => jsxs("div", {
|
|
308
|
+
className: "flex flex-col",
|
|
309
|
+
children: [jsxs("div", {
|
|
310
|
+
className: "flex justify-between",
|
|
311
|
+
children: [jsx("span", {
|
|
312
|
+
className: "mr-4",
|
|
313
|
+
children: charge.name
|
|
314
|
+
}), jsx("span", {
|
|
315
|
+
className: "font-medium",
|
|
316
|
+
children: charge?.amount_rounded
|
|
317
|
+
})]
|
|
318
|
+
}), charge.details && jsx("span", {
|
|
319
|
+
className: "text-sm font-normal",
|
|
320
|
+
children: charge?.details
|
|
321
|
+
})]
|
|
322
|
+
}, index)), jsxs("div", {
|
|
323
|
+
className: "flex justify-between pt-2 border-t border-gray-200 font-bold",
|
|
324
|
+
children: [jsx("span", {
|
|
325
|
+
children: "Total discount"
|
|
326
|
+
}), jsx("span", {
|
|
327
|
+
children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.savings
|
|
328
|
+
})]
|
|
329
|
+
})]
|
|
330
|
+
})
|
|
331
|
+
})]
|
|
332
|
+
}), jsxs("div", {
|
|
333
|
+
className: "relative group",
|
|
334
|
+
children: [jsx("span", {
|
|
335
|
+
className: "text-2xl font-semibold text-right underline cursor-help",
|
|
336
|
+
children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.total
|
|
337
|
+
}), jsxs("div", {
|
|
338
|
+
className: "hidden group-hover:block absolute bottom-0 right-0 transform translate-y-full mt-2 w-[300px] shadow-lg bg-white rounded-md z-50",
|
|
339
|
+
children: [jsx("div", {
|
|
340
|
+
className: "font-bold border-b border-gray-200 p-3 text-center",
|
|
341
|
+
children: "Price breakdown"
|
|
342
|
+
}), jsx("div", {
|
|
343
|
+
className: "p-4",
|
|
344
|
+
children: jsx("div", {
|
|
345
|
+
className: "flex flex-col space-y-2",
|
|
346
|
+
children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.charges?.items?.map((item, index) => jsxs("div", {
|
|
347
|
+
className: "flex justify-between",
|
|
348
|
+
children: [jsx("span", {
|
|
349
|
+
children: item.name
|
|
350
|
+
}), jsx("span", {
|
|
351
|
+
children: item?.amount_rounded
|
|
352
|
+
})]
|
|
353
|
+
}, index))
|
|
354
|
+
})
|
|
355
|
+
})]
|
|
356
|
+
})]
|
|
357
|
+
})]
|
|
358
|
+
}), jsxs("span", {
|
|
359
|
+
className: "text-xs text-gray-500 text-right w-full",
|
|
360
|
+
children: [item?.preferences?.property?.pricing?.price?.price_breakdown?.details?.pricing?.basePrice?.perNight, ' ', "per ", getPriceType(item)]
|
|
361
|
+
})]
|
|
362
|
+
}), jsx("button", {
|
|
363
|
+
className: "bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded w-full",
|
|
364
|
+
onClick: () => {
|
|
365
|
+
window.open(generateHref(item, checkIn, checkOut, adults, children), '_blank');
|
|
366
|
+
},
|
|
367
|
+
children: "View deal"
|
|
368
|
+
})]
|
|
369
|
+
})]
|
|
370
|
+
})]
|
|
371
|
+
})
|
|
372
|
+
})]
|
|
373
|
+
}, item.id)
|
|
374
|
+
});
|
|
375
|
+
};export{PropertyCard};//# sourceMappingURL=PropertyCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyCard.js","sources":["../../../src/components/UI/PropertyCard.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"03BAqCA,MAAM,gBAAgB,GAAG,IAAC,IAAwB;AAC9C,EAAA,OAAA,IAAW,CAAA,WAAA,EAAA,CAAA,OAAA,CAAA,eAAA,EAAA,EAAA,CAAA,CAAA,OAAA,CAAA,SAAA,EAAA,GAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA;AACN,CAAA;AACA,MAAA,YAAQ,GAAA,CAAA,IAAA,EAAA,IAAe,EAAE,EAAE,EAAC,MAAA,EAAA,QAAA,KAAA;AAC5B,EAAA,QAAA,IAAA,CAAA,UAAQ;AACR,IAAA,KAAA,gBAAe;AACxB,MAAE,OAAA,CAAA,6BAAA,EAAA,IAAA,CAAA,EAAA,CAAA,UAAA,EAAA,IAAA,CAAA,WAAA,EAAA,EAAA,CAAA,QAAA,EAAA,MAAA,GAAA,QAAA,IAAA,CAAA,CAAA,CAAA;AAEF,IAAA,KAAkB,iBAAQ;AACtB,MAAA,OAAY,CAAA,8BAAc,EAAA,IAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,OAAA,CAAA,EAAA,CAAA,CAAA,EAAA,gBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,KAAA,CAAA;AACtB,IAAA,KAAA,mBAAqB;AACjB,MAAA,MAAA,UAAuC,GAAA,IAAA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AAA,WAAY,IAAK,GAAA,EAAA,EAAA,CAAA;AACjB,EAAA,MAAA,SAAA,GAAA,IAAA,EAAA,WAAA,EAAA,QAAA,EAAK,SAAK;AACb,EAAA,MAAA,cAAA,GAAA,SAAA,GAAA,MAAA,CAAA,OAAA,CAAA,SAEI,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA,GAAS,EAAC,KAAA,CAAA,KAAA;AAgIH,IAAA,MAAA,gBAAA,GAAA,MAAA,CAAA,OAAA,CAAA,KAAA,IAAA,EAAA,CAAA,EAAA,MAAA,CAAA,CAAE,CAAK,IAAA,EAAA,MAAA,CAAA,KAAA,MAAA,EAAA,MAAA,IAAA,MAAA,EAAA,IAAA,CAAA;;AAEH,IAAA,OAAA,kBAAA,CAAA,MAAA,GAAA,CAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,IAAS,EAAA,MAAqB,CAAA,KAAA,iBAClC,CAAA;;AAgC4B,MAAA,KAAA,EAAA;;;AAkDhC,QAAA,CAAA,EAAA;AACJ;AAWpC,KAAE,CAAA,CAAA,GAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Options } from '@cdmbase/react-splide';
|
|
2
|
+
type PropertyCardOnMapProps = {
|
|
3
|
+
room: any;
|
|
4
|
+
isSaved: boolean;
|
|
5
|
+
sliderOptions?: Options;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const PropertyCardOnMap: ({ room, isSaved, sliderOptions, className, ...props }: PropertyCardOnMapProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=PropertyCardOnMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyCardOnMap.d.ts","sourceRoot":"","sources":["../../../src/components/UI/PropertyCardOnMap.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAIrE,KAAK,sBAAsB,GAAG;IAC1B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,uDAM/B,sBAAsB,4CA0FxB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useMemo,useState,useEffect}from'react';import {useTranslation}from'react-i18next';import {Link}from'@remix-run/react';import {BsStarFill}from'@react-icons/all-files/bs/BsStarFill.js';import {Splide,SplideSlide}from'@cdmbase/react-splide';import {useLayoutSettings}from'@admin-layout/client';const PropertyCardOnMap = ({
|
|
2
|
+
room,
|
|
3
|
+
isSaved,
|
|
4
|
+
sliderOptions = {},
|
|
5
|
+
className = '',
|
|
6
|
+
...props
|
|
7
|
+
}) => {
|
|
8
|
+
const images = useMemo(() => room?.images?.data.map(({
|
|
9
|
+
url
|
|
10
|
+
}) => ({
|
|
11
|
+
src: url
|
|
12
|
+
})), [room]);
|
|
13
|
+
const {
|
|
14
|
+
t
|
|
15
|
+
} = useTranslation();
|
|
16
|
+
const {
|
|
17
|
+
settings
|
|
18
|
+
} = useLayoutSettings();
|
|
19
|
+
const [star, setStar] = useState(0);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
let temp = room?.totalReview == 0 ? 0 : room?.totalStar / room?.totalReview;
|
|
22
|
+
setStar(temp);
|
|
23
|
+
}, [room?.totalReview, room?.totalStar]);
|
|
24
|
+
// const { color, grayColor } = useColorTheme();
|
|
25
|
+
return jsxs("div", {
|
|
26
|
+
className: `flex flex-col flex-wrap mt-4 ${className}`,
|
|
27
|
+
children: [jsx("div", {
|
|
28
|
+
className: "w-full",
|
|
29
|
+
children: jsxs(Splide, {
|
|
30
|
+
"aria-label": t('property.property_images'),
|
|
31
|
+
options: {
|
|
32
|
+
type: 'loop',
|
|
33
|
+
drag: 'free',
|
|
34
|
+
height: '230px',
|
|
35
|
+
perPage: 1,
|
|
36
|
+
perMove: 1,
|
|
37
|
+
wheel: true,
|
|
38
|
+
releaseWheel: true,
|
|
39
|
+
pagination: false,
|
|
40
|
+
speed: 500,
|
|
41
|
+
...sliderOptions
|
|
42
|
+
},
|
|
43
|
+
children: [images && images.length == 0 && jsx(SplideSlide, {
|
|
44
|
+
children: jsx("div", {
|
|
45
|
+
className: "w-full h-full",
|
|
46
|
+
children: jsx("img", {
|
|
47
|
+
src: room.thumbnailUrl,
|
|
48
|
+
className: "w-full h-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
|
|
49
|
+
loading: "lazy",
|
|
50
|
+
alt: room.title || 'Property'
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}), images.map((image, i) => {
|
|
54
|
+
return jsx(SplideSlide, {
|
|
55
|
+
children: jsx(Link, {
|
|
56
|
+
to: '/property/' + room.id,
|
|
57
|
+
className: "w-full",
|
|
58
|
+
children: jsx("div", {
|
|
59
|
+
className: "w-full h-full",
|
|
60
|
+
children: jsx("img", {
|
|
61
|
+
src: image.src,
|
|
62
|
+
className: "w-full h-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
|
|
63
|
+
loading: "lazy",
|
|
64
|
+
alt: room.title || 'Property'
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
}, 'sliderImage1_' + i);
|
|
69
|
+
})]
|
|
70
|
+
})
|
|
71
|
+
}), jsxs("div", {
|
|
72
|
+
className: "w-full flex flex-col mt-2",
|
|
73
|
+
children: [jsx("div", {
|
|
74
|
+
className: "font-semibold text-sm",
|
|
75
|
+
style: {
|
|
76
|
+
color: settings?.primaryColor
|
|
77
|
+
},
|
|
78
|
+
children: room?.title
|
|
79
|
+
}), jsxs("div", {
|
|
80
|
+
className: "flex flex-row justify-between",
|
|
81
|
+
children: [jsxs("div", {
|
|
82
|
+
className: "flex flex-col",
|
|
83
|
+
children: [jsx("div", {
|
|
84
|
+
className: "mt-1 flex text-[9px] font-semibold",
|
|
85
|
+
style: {
|
|
86
|
+
color: settings?.primaryColor
|
|
87
|
+
},
|
|
88
|
+
children: room?.address && room?.address.city && room?.address.city.state ? room?.address.city.name + ', ' + room?.address.city.state.name : ''
|
|
89
|
+
}), jsxs("div", {
|
|
90
|
+
className: "flex items-center",
|
|
91
|
+
children: [jsx(BsStarFill, {
|
|
92
|
+
className: "text-yellow-500 w-3 h-3 mr-1"
|
|
93
|
+
}), jsxs("span", {
|
|
94
|
+
className: "text-[0.832rem] font-bold",
|
|
95
|
+
style: {
|
|
96
|
+
color: settings?.secondaryColor
|
|
97
|
+
},
|
|
98
|
+
children: [room?.reviewsOverview ? room.reviewsOverview.rating : 0, " (", room.reviewsOverview ? room.reviewsOverview.ratingCount : 0, " ", t('property.reviews'), ")"]
|
|
99
|
+
})]
|
|
100
|
+
})]
|
|
101
|
+
}), jsx("div", {
|
|
102
|
+
className: "text-lg font-bold mt-auto mb-[-2px]",
|
|
103
|
+
children: room.preferences?.property?.pricing?.price?.price_breakdown?.details?.pricing?.finalPrice?.total
|
|
104
|
+
})]
|
|
105
|
+
})]
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
};export{PropertyCardOnMap};//# sourceMappingURL=PropertyCardOnMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyCardOnMap.js","sources":["../../../src/components/UI/PropertyCardOnMap.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"0VAkBa,iBAAiB,GAAG,CAAC;AAO9B,EAAA,IAAA;AACA,EAAA,OAAA;AACA,EAAA,aAAgB,GAAA,EAAA;WAET,GAAI,EAAA;KACF;;QAEL,MAAO,GAAK,OAAE,CAAA,MAAA,IAAA,EAAA,MAAA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA;IAClB;SAEgD;IAEhD,GAAO,EAAA;AAMa,GAAA,CAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA;AACA,EAAA,MAAA;AACA,IAAA;AACA,GAAA,GAAA,cAAA,EAAA;AACA,EAAA,MAAA;AACA,IAAA;AACA,GAAA,GAAA,iBAAA,EAAA;AACA,EAAA,MAAA,CAAA,IAAA,EAAA,OAAA,CAAA,GAAA,QAAU,EAAE,CAAK;AACjB,EAAA,SAAA,CAAA,MAAA;AACA,IAAA,IAAA,IAAA,GAAA,IAAA,EAAA,WAAgB,IAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAAA,SAAA,GAAA,IAAA,EAAA,WAAA;;6BAgBT,EAAA,SACF,CAAA,CAAA;AAaT;AAWY,EAAA,OAAAA,IAAA,CAAA,KAAA,EAAA;6CACC;AAaD,IAAA,QAAA,EAAA,CAAAC,GAAA,CAAA,KAAA,EAAA;AAOhC,MAAE,SAAA,EAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type VehicleCardProps = {
|
|
3
|
+
car: any;
|
|
4
|
+
isSaved: boolean;
|
|
5
|
+
setFocus: (index: number) => void;
|
|
6
|
+
setBlur: (index: number) => void;
|
|
7
|
+
handleLike: (index: number) => void;
|
|
8
|
+
likeBtnLoading: boolean;
|
|
9
|
+
vehicleTypes: any[];
|
|
10
|
+
authenticated: boolean;
|
|
11
|
+
extraIcons: any[];
|
|
12
|
+
};
|
|
13
|
+
export declare const VehicleCard: ({ car, isSaved, setFocus, setBlur, handleLike, likeBtnLoading, vehicleTypes, authenticated, extraIcons, ...props }: VehicleCardProps & React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=VehicleCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VehicleCard.d.ts","sourceRoot":"","sources":["../../../src/components/UI/VehicleCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAsGzE,KAAK,gBAAgB,GAAG;IACpB,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,GAAG,EAAE,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,oHAWzB,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,4CA6BzD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type VehicleCardListProps = {
|
|
3
|
+
cars?: any[];
|
|
4
|
+
setFocus: (index: number) => void;
|
|
5
|
+
setBlur: (index: number) => void;
|
|
6
|
+
handleLike: (index: number) => void;
|
|
7
|
+
likeBtnLoading: boolean;
|
|
8
|
+
vehicleTypes: any[];
|
|
9
|
+
extraIcons?: any;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const VehicleCardList: React.FC<VehicleCardListProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=VehicleCardList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VehicleCardList.d.ts","sourceRoot":"","sources":["../../../src/components/UI/VehicleCardList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,KAAK,oBAAoB,GAAG;IACxB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0B1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarCardFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/UI/VehicleComponents/CarCardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,kBAAkB;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4DtD,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState}from'react';const CarCardFooter = ({
|
|
2
|
+
price
|
|
3
|
+
}) => {
|
|
4
|
+
const [showPopover, setShowPopover] = useState(false);
|
|
5
|
+
if (!price) return null;
|
|
6
|
+
return jsxs("div", {
|
|
7
|
+
className: "flex flex-col sm:flex-row sm:justify-between items-start sm:items-end mt-4 pt-4 border-t border-gray-100",
|
|
8
|
+
children: [price.discount > 0 && jsxs("div", {
|
|
9
|
+
className: "px-3 py-1 text-sm font-medium text-green-600 bg-[#F1FFF9] rounded-md",
|
|
10
|
+
children: ["Save ", price.currency, " ", price.discount]
|
|
11
|
+
}), jsxs("div", {
|
|
12
|
+
className: "flex flex-col items-end",
|
|
13
|
+
children: [jsxs("div", {
|
|
14
|
+
className: "relative",
|
|
15
|
+
children: [price.originalAmount > price.amount && jsxs("span", {
|
|
16
|
+
className: "line-through text-gray-500 text-lg mr-2",
|
|
17
|
+
children: [price.currency, price.originalAmount]
|
|
18
|
+
}), jsxs("span", {
|
|
19
|
+
className: "text-xl font-semibold text-gray-900 cursor-pointer",
|
|
20
|
+
onMouseEnter: () => setShowPopover(true),
|
|
21
|
+
onMouseLeave: () => setShowPopover(false),
|
|
22
|
+
children: [price.currency, " ", price.amount, " total"]
|
|
23
|
+
}), showPopover && jsx("div", {
|
|
24
|
+
className: "absolute bottom-full right-0 mb-2 p-3 bg-white shadow-lg rounded-lg border border-gray-200 z-10 w-48",
|
|
25
|
+
children: jsxs("div", {
|
|
26
|
+
className: "flex flex-col gap-2 text-sm",
|
|
27
|
+
children: [jsxs("div", {
|
|
28
|
+
className: "flex justify-between",
|
|
29
|
+
children: [jsx("span", {
|
|
30
|
+
className: "text-gray-600",
|
|
31
|
+
children: "Original price:"
|
|
32
|
+
}), jsxs("span", {
|
|
33
|
+
className: "line-through text-gray-500",
|
|
34
|
+
children: [price.currency, " ", price.originalAmount]
|
|
35
|
+
})]
|
|
36
|
+
}), price.discount > 0 && jsxs("div", {
|
|
37
|
+
className: "flex justify-between",
|
|
38
|
+
children: [jsx("span", {
|
|
39
|
+
className: "text-gray-600",
|
|
40
|
+
children: "Discount:"
|
|
41
|
+
}), jsxs("span", {
|
|
42
|
+
className: "text-green-600",
|
|
43
|
+
children: ["-", price.currency, " ", price.discount]
|
|
44
|
+
})]
|
|
45
|
+
}), jsxs("div", {
|
|
46
|
+
className: "flex justify-between font-medium pt-1 border-t border-gray-100",
|
|
47
|
+
children: [jsx("span", {
|
|
48
|
+
children: "Final price:"
|
|
49
|
+
}), jsxs("span", {
|
|
50
|
+
children: [price.currency, " ", price.amount]
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
})
|
|
54
|
+
})]
|
|
55
|
+
}), jsx("span", {
|
|
56
|
+
className: "text-sm text-gray-600",
|
|
57
|
+
children: "Before taxes"
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
};export{CarCardFooter};//# sourceMappingURL=CarCardFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarCardFooter.js","sources":["../../../../src/components/UI/VehicleComponents/CarCardFooter.tsx"],"sourcesContent":[null],"names":["_jsxs"],"mappings":"4EAMa,aAAa,GAAiC,CAAC;;AAGxD,CAAA,KAAA;AAAY,EAAA,MAAA,CAAA,WAAY,EAAA,cAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;MAEjB,CAAA,KACH;AAsDR,EAAE,OAAAA,IAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarCardImage.d.ts","sourceRoot":"","sources":["../../../../src/components/UI/VehicleComponents/CarCardImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,UAAU,iBAAiB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8BpD,CAAC"}
|