@wayke-se/components-react 3.0.0-beta.10 → 3.0.0-beta.11
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/.editorconfig +10 -0
- package/.eslintrc.js +62 -0
- package/.github/workflows/release-to-production.yaml +40 -0
- package/.github/workflows/release-to-test.yaml +40 -0
- package/.prettierrc +12 -0
- package/codegen.yml +19 -0
- package/dist/ajax-loader-BOAPMZMT.gif +0 -0
- package/dist/index.css +241 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +3299 -0
- package/dist/index.js +8952 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +8935 -0
- package/dist/index.mjs.map +7 -0
- package/dist/slick-7CK47X3J.svg +14 -0
- package/dist/slick-EVLS6IWX.eot +0 -0
- package/dist/slick-MU5EZO5G.woff +0 -0
- package/dist/slick-NKQ64RRA.ttf +0 -0
- package/esbuild/build.js +39 -0
- package/esbuild/common.js +15 -0
- package/esbuild/start.js +21 -0
- package/esbuild/www/index.html +32 -0
- package/example/src/@types/global.d.ts +7 -0
- package/example/src/@types/react-panellum.d.ts +1 -0
- package/example/src/App.tsx +77 -0
- package/example/src/assets/style/ecom.css +63 -0
- package/example/src/assets/style/theme.css +83 -0
- package/example/src/index.html +26 -0
- package/example/src/index.tsx +11 -0
- package/example/src/routes/HashRoute/index.tsx +30 -0
- package/example/src/routes/Home/index.tsx +33 -0
- package/example/src/routes/NotFound/index.tsx +5 -0
- package/example/src/routes/PathRoute/index.tsx +35 -0
- package/example/src/routes/Search/index.tsx +28 -0
- package/example/src/routes/SearchItem/index.tsx +28 -0
- package/example/src/routes/index.tsx +25 -0
- package/package.json +66 -26
- package/{dist-types/@types/action.d.ts → src/@types/action.ts} +1 -1
- package/src/@types/codegen/types.ts +366 -0
- package/src/@types/filter.ts +18 -0
- package/src/@types/queryFilter.ts +5 -0
- package/src/@types/react-panellum.d.ts +1 -0
- package/src/@types/search.ts +118 -0
- package/src/@types/theme.d.ts +5 -0
- package/src/@types/vehicle-properties.ts +33 -0
- package/src/State/CentralStorage/CentralStorageContext.ts +10 -0
- package/src/State/CentralStorage/CentralStorageProvider.tsx +21 -0
- package/src/State/CentralStorage/useCentralStorage.ts +37 -0
- package/src/State/Path/PathContext.ts +11 -0
- package/src/State/Path/PathProvider.tsx +66 -0
- package/src/State/Path/reducer.ts +30 -0
- package/src/State/Path/usePath.ts +13 -0
- package/src/State/RelatedSearch/RelatedSearchContext.ts +18 -0
- package/src/State/RelatedSearch/RelatedSearchProvider.tsx +55 -0
- package/src/State/RelatedSearch/useRelatedSearch.ts +20 -0
- package/src/State/Search/SearchContext.ts +27 -0
- package/src/State/Search/SearchProvider.tsx +243 -0
- package/{dist-src/State/Search/useSearch.js → src/State/Search/useSearch.ts} +2 -0
- package/src/State/Settings/SettingsContext.ts +15 -0
- package/src/State/Settings/SettingsProvider.tsx +23 -0
- package/{dist-src/State/Settings/useSettings.js → src/State/Settings/useSettings.ts} +3 -0
- package/src/components/Accordion/index.tsx +57 -0
- package/{dist-src/components/Accordion/wrapper.js → src/components/Accordion/wrapper.tsx} +27 -12
- package/src/components/ActionList/index.tsx +48 -0
- package/src/components/ActionList/toggle-item.tsx +59 -0
- package/src/components/Avatar/index.tsx +12 -0
- package/{dist-src/components/Avatar/wrapper.js → src/components/Avatar/wrapper.tsx} +9 -3
- package/src/components/Badge/index.tsx +12 -0
- package/src/components/Badge/wrapper.tsx +32 -0
- package/src/components/Blockquote/index.tsx +32 -0
- package/{dist-src/components/Blockquote/wrapper.js → src/components/Blockquote/wrapper.tsx} +16 -8
- package/{dist-src/components/Button/index.js → src/components/Button/index.tsx} +55 -24
- package/src/components/CheckMarkList/index.tsx +21 -0
- package/{dist-src/components/CheckMarkList/wrapper.js → src/components/CheckMarkList/wrapper.tsx} +10 -5
- package/src/components/Checklist/index.tsx +51 -0
- package/{dist-src/components/Checklist/wrapper.js → src/components/Checklist/wrapper.tsx} +13 -7
- package/src/components/ColorSelect/index.tsx +63 -0
- package/{dist-src/components/ColorSelect/wrapper.js → src/components/ColorSelect/wrapper.tsx} +22 -9
- package/{dist-src/components/ColumnRow/index.js → src/components/ColumnRow/index.tsx} +5 -2
- package/src/components/Container/index.tsx +11 -0
- package/{dist-src/components/Container/wrapper.js → src/components/Container/wrapper.tsx} +3 -1
- package/src/components/Content/index.tsx +15 -0
- package/{dist-src/components/Content/wrapper.js → src/components/Content/wrapper.tsx} +13 -3
- package/{dist-src/components/ContentLogo/index.js → src/components/ContentLogo/index.tsx} +7 -3
- package/src/components/DataList/index.tsx +25 -0
- package/{dist-src/components/DataList/wrapper.js → src/components/DataList/wrapper.tsx} +10 -5
- package/src/components/DetailBox/index.tsx +34 -0
- package/{dist-src/components/DetailBox/wrapper.js → src/components/DetailBox/wrapper.tsx} +14 -7
- package/src/components/ExtendContent/index.tsx +43 -0
- package/{dist-src/components/ExtendContent/wrapper.js → src/components/ExtendContent/wrapper.tsx} +14 -5
- package/src/components/ExtendInfo/index.tsx +32 -0
- package/{dist-src/components/ExtendInfo/wrapper.js → src/components/ExtendInfo/wrapper.tsx} +14 -7
- package/src/components/Filter/index.tsx +108 -0
- package/{dist-src/components/Filter/wrapper.js → src/components/Filter/wrapper.tsx} +13 -6
- package/src/components/FilterPanel/checkListFacet.tsx +46 -0
- package/src/components/FilterPanel/colorFacet.tsx +47 -0
- package/src/components/FilterPanel/faceSelector.tsx +53 -0
- package/src/components/FilterPanel/index.tsx +79 -0
- package/src/components/FilterPanel/rangeFacet.tsx +128 -0
- package/src/components/FinancialOptions/LoanModal.tsx +223 -0
- package/src/components/FinancialOptions/index.tsx +29 -0
- package/src/components/FinancialOptions/leasing.tsx +77 -0
- package/src/components/FinancialOptions/loan.tsx +87 -0
- package/src/components/Gallery/MediaButton.tsx +19 -0
- package/src/components/Gallery/index.tsx +227 -0
- package/{dist-src/components/Gallery/wrapper.js → src/components/Gallery/wrapper.tsx} +49 -19
- package/src/components/Grid/index.tsx +87 -0
- package/{dist-src/components/Grid/wrapper.js → src/components/Grid/wrapper.tsx} +7 -3
- package/src/components/Heading/index.tsx +72 -0
- package/src/components/Icon/index.tsx +87 -0
- package/src/components/InputCheckbox/index.tsx +30 -0
- package/{dist-src/components/InputCheckbox/wrapper.js → src/components/InputCheckbox/wrapper.tsx} +21 -13
- package/{dist-src/components/InputGroup/index.js → src/components/InputGroup/index.tsx} +5 -2
- package/src/components/InputLabel/index.tsx +14 -0
- package/{dist-src/components/InputLabel/wrapper.js → src/components/InputLabel/wrapper.tsx} +4 -2
- package/src/components/InputSearch/index.tsx +51 -0
- package/{dist-src/components/InputSearch/wrapper.js → src/components/InputSearch/wrapper.tsx} +17 -10
- package/src/components/InputSelect/index.tsx +35 -0
- package/{dist-src/components/InputSelect/wrapper.js → src/components/InputSelect/wrapper.tsx} +11 -5
- package/src/components/InputText/index.tsx +27 -0
- package/{dist-src/components/InputText/wrapper.js → src/components/InputText/wrapper.tsx} +7 -4
- package/src/components/InsuranceOptions/Insurance.tsx +60 -0
- package/src/components/InsuranceOptions/InsuranceFree.tsx +59 -0
- package/src/components/InsuranceOptions/InsuranceFreeModal.tsx +49 -0
- package/src/components/InsuranceOptions/InsuranceModal.tsx +253 -0
- package/src/components/InsuranceOptions/index.tsx +27 -0
- package/src/components/Lightbox/index.tsx +51 -0
- package/{dist-src/components/Lightbox/wrapper.js → src/components/Lightbox/wrapper.tsx} +12 -6
- package/src/components/Loader/index.tsx +18 -0
- package/{dist-src/components/Loader/wrapper.js → src/components/Loader/wrapper.tsx} +21 -8
- package/src/components/LogoBox/index.tsx +22 -0
- package/{dist-src/components/LogoBox/wrapper.js → src/components/LogoBox/wrapper.tsx} +10 -3
- package/src/components/Map/index.tsx +62 -0
- package/{dist-src/components/Map/wrapper.js → src/components/Map/wrapper.tsx} +8 -4
- package/src/components/Modal/index.tsx +51 -0
- package/{dist-src/components/Modal/wrapper.js → src/components/Modal/wrapper.tsx} +30 -16
- package/src/components/OpeningHours/index.tsx +145 -0
- package/src/components/OptionBox/index.tsx +23 -0
- package/{dist-src/components/OptionBox/wrapper.js → src/components/OptionBox/wrapper.tsx} +14 -7
- package/src/components/OverflowBox/index.tsx +11 -0
- package/{dist-src/components/OverflowBox/wrapper.js → src/components/OverflowBox/wrapper.tsx} +2 -1
- package/{dist-src/components/OverflowGrid/index.js → src/components/OverflowGrid/index.tsx} +7 -3
- package/src/components/Page/index.tsx +46 -0
- package/src/components/Panel/index.tsx +50 -0
- package/{dist-src/components/Panel/wrapper.js → src/components/Panel/wrapper.tsx} +28 -16
- package/src/components/Pdf/index.tsx +46 -0
- package/{dist-src/components/Pdf/wrapper.js → src/components/Pdf/wrapper.tsx} +15 -9
- package/src/components/PhoneNumber/index.tsx +33 -0
- package/{dist-types/components/Portal/index.d.ts → src/components/Portal/index.ts} +1 -0
- package/src/components/Portal/portal-element.tsx +9 -0
- package/{dist-src/components/Portal/portal-namespace.js → src/components/Portal/portal-namespace.ts} +0 -0
- package/src/components/Portal/portal.tsx +36 -0
- package/{dist-src/components/Price/index.js → src/components/Price/index.tsx} +5 -3
- package/src/components/PriceTable/index.tsx +34 -0
- package/{dist-src/components/PriceTable/wrapper.js → src/components/PriceTable/wrapper.tsx} +9 -4
- package/src/components/ProductCard/index.tsx +133 -0
- package/{dist-src/components/ProductCard/wrapper.js → src/components/ProductCard/wrapper.tsx} +37 -19
- package/{dist-src/components/ProductPage/index.js → src/components/ProductPage/index.tsx} +20 -6
- package/src/components/ProgressBar/index.tsx +31 -0
- package/{dist-src/components/ProgressBar/wrapper.js → src/components/ProgressBar/wrapper.tsx} +10 -5
- package/src/components/RangeSlider/RangeSliderSimple.tsx +90 -0
- package/src/components/RangeSlider/SliderWithLabel.tsx +62 -0
- package/src/components/RangeSlider/handle.tsx +26 -0
- package/src/components/RangeSlider/index.tsx +132 -0
- package/src/components/RangeSlider/track.tsx +19 -0
- package/{dist-src/components/RangeSlider/wrapper.js → src/components/RangeSlider/wrapper.tsx} +16 -9
- package/src/components/RangeSliderLabel/index.tsx +18 -0
- package/{dist-src/components/RangeSliderLabel/wrapper.js → src/components/RangeSliderLabel/wrapper.tsx} +16 -7
- package/{dist-src/components/Repeat/index.js → src/components/Repeat/index.tsx} +7 -3
- package/src/components/Result/index.tsx +91 -0
- package/{dist-src/components/Result/wrapper.js → src/components/Result/wrapper.tsx} +19 -9
- package/{dist-src/components/Root/index.js → src/components/Root/index.tsx} +4 -2
- package/src/components/SearchBar/index.tsx +48 -0
- package/src/components/SearchFilter/index.tsx +31 -0
- package/src/components/SearchTerm/index.tsx +23 -0
- package/{dist-src/components/SearchTerm/wrapper.js → src/components/SearchTerm/wrapper.tsx} +8 -4
- package/src/components/SectionHeader/index.tsx +25 -0
- package/{dist-src/components/SectionHeader/wrapper.js → src/components/SectionHeader/wrapper.tsx} +7 -3
- package/src/components/Snackbar/index.tsx +35 -0
- package/src/components/Snackbar/wrapper.tsx +65 -0
- package/src/components/SortSelect/index.tsx +35 -0
- package/{dist-src/components/SortSelect/wrapper.js → src/components/SortSelect/wrapper.tsx} +11 -5
- package/src/components/Sphere/Sphere.tsx +49 -0
- package/src/components/Sphere/SphereLightbox.tsx +10 -0
- package/src/components/Sphere/SphereViewer.tsx +81 -0
- package/{dist-src/components/Sphere/wrapper.js → src/components/Sphere/wrapper.tsx} +4 -1
- package/{dist-src/components/SrOnly/index.js → src/components/SrOnly/index.tsx} +2 -1
- package/src/components/SwitchBar/index.tsx +55 -0
- package/{dist-src/components/SwitchBar/wrapper.js → src/components/SwitchBar/wrapper.tsx} +19 -10
- package/{dist-src/components/TableColumn/index.js → src/components/TableColumn/index.tsx} +7 -3
- package/{dist-src/components/TableList/index.js → src/components/TableList/index.tsx} +13 -6
- package/src/components/Tabs/index.tsx +34 -0
- package/{dist-src/components/Tabs/wrapper.js → src/components/Tabs/wrapper.tsx} +22 -8
- package/src/components/ThreeSixty/Rotation.tsx +136 -0
- package/src/components/ThreeSixty/ThreeSixtLightbox.tsx +34 -0
- package/src/components/ThreeSixty/ThreeSixty.tsx +53 -0
- package/src/components/UspList/index.tsx +47 -0
- package/{dist-src/components/UspList/wrapper.js → src/components/UspList/wrapper.tsx} +15 -8
- package/src/components/Utility/index.tsx +17 -0
- package/src/components/Video/CustomPlayer.tsx +28 -0
- package/src/components/Video/EmbeddedVideoLightbox.tsx +31 -0
- package/src/components/Video/EmbededVideo.tsx +72 -0
- package/src/components/Video/QuickNavEmbeded.tsx +35 -0
- package/src/components/Video/QuickNavVideo.tsx +14 -0
- package/src/components/Video/Video.tsx +18 -0
- package/src/components/Video/VimeoPlayer.tsx +21 -0
- package/src/components/Video/YoutubePlayer.tsx +21 -0
- package/src/components/Video/useThumbnail.ts +28 -0
- package/src/components/Video/utils.ts +47 -0
- package/src/components/Video/wrapper.tsx +29 -0
- package/src/hooks/useFetch.ts +88 -0
- package/src/hooks/useHasBeenVisible.ts +17 -0
- package/src/hooks/useHashGuid.ts +33 -0
- package/src/hooks/useInsurance.ts +22 -0
- package/src/hooks/useLoan.ts +21 -0
- package/src/hooks/useOnScreen.ts +20 -0
- package/src/hooks/useOutsideClick.ts +19 -0
- package/src/hooks/usePrevious.ts +11 -0
- package/src/hooks/useSearchItem.ts +11 -0
- package/src/hooks/useSearchItemBranch.ts +14 -0
- package/src/hooks/useSessionStorage.ts +32 -0
- package/src/hooks/useVimeoThumbnail.ts +31 -0
- package/src/images/map/marker.png +0 -0
- package/src/images/placeholders/staticmap.jpg +0 -0
- package/src/index-dev.tsx +42 -0
- package/src/index-esbuild.ts +74 -0
- package/src/index.ts +72 -0
- package/src/layout/helpers.tsx +6 -0
- package/{dist-src/layout/keyframes.js → src/layout/keyframes.tsx} +6 -3
- package/src/layout/theme.ts +60 -0
- package/src/layouts/WaykeComposite.tsx +64 -0
- package/src/layouts/WaykeCompositeWithProvider.tsx +17 -0
- package/src/layouts/search/index.tsx +124 -0
- package/src/layouts/searchItem/Branch.tsx +97 -0
- package/src/layouts/searchItem/BranchModal.tsx +67 -0
- package/src/layouts/searchItem/CheckList.tsx +146 -0
- package/src/layouts/searchItem/ManufacturerPackagesOption.tsx +54 -0
- package/src/layouts/searchItem/MetadataItem.tsx +74 -0
- package/src/layouts/searchItem/PackageOptionModal.tsx +54 -0
- package/src/layouts/searchItem/PackageOptions.tsx +58 -0
- package/{dist-src/layouts/searchItem/Page404.js → src/layouts/searchItem/Page404.tsx} +12 -4
- package/{dist-src/layouts/searchItem/PageLoading.js → src/layouts/searchItem/PageLoading.tsx} +12 -4
- package/src/layouts/searchItem/Property.tsx +134 -0
- package/src/layouts/searchItem/Related.tsx +120 -0
- package/src/layouts/searchItem/index.tsx +342 -0
- package/src/providers/WaykeItemProvidet.tsx +63 -0
- package/src/providers/WaykeProvider.tsx +75 -0
- package/src/providers/graphqlProvider.tsx +9 -0
- package/src/providers/themeProvider.tsx +15 -0
- package/{dist-src/queries/INSURANCE_CALCULATION.js → src/queries/INSURANCE_CALCULATION.ts} +3 -1
- package/{dist-src/queries/LOAN_CALCULATION.js → src/queries/LOAN_CALCULATION.ts} +5 -2
- package/{dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js → src/queries/SEARCH_ITEM_BRANCH_QUERY.ts} +5 -2
- package/{dist-src/queries/SEARCH_ITEM_QUERY.js → src/queries/SEARCH_ITEM_QUERY.ts} +7 -3
- package/src/utils/constants.ts +34 -0
- package/src/utils/converters.ts +45 -0
- package/{dist-src/utils/deep-copy.js → src/utils/deep-copy.ts} +2 -1
- package/src/utils/formats.ts +83 -0
- package/src/utils/metadata.min.ts +87 -0
- package/src/utils/phonenumbers.ts +17 -0
- package/src/utils/pubsub/Actions.ts +20 -0
- package/src/utils/pubsub/Events.ts +79 -0
- package/src/utils/pubsub/pubsub.ts +151 -0
- package/src/utils/regex.ts +13 -0
- package/src/utils/sortOptions.ts +36 -0
- package/src/utils/specification.ts +581 -0
- package/src/utils/ssn.ts +1 -0
- package/{dist-src/utils/url.js → src/utils/url.ts} +0 -0
- package/src/utils/vehicle-properties/compare-basic-properties.ts +63 -0
- package/src/utils/vehicle-properties/compare-categories.ts +45 -0
- package/src/utils/vehicle-properties/compare-properties.ts +5 -0
- package/src/utils/vehicle-properties/custom-property-adder.ts +163 -0
- package/src/utils/vehicle-properties/property-hint-enricher.ts +230 -0
- package/src/utils/vehicle-properties/property-remover.ts +28 -0
- package/src/utils/vehicle-properties/property-tree-creator.ts +171 -0
- package/src/utils/vehicle-properties/property-tree-sorter.ts +20 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.eslint.json +11 -0
- package/tsconfig.json +18 -0
- package/webpack.analyze.js +10 -0
- package/webpack.config.js +95 -0
- package/dist-node/index.js +0 -9130
- package/dist-node/index.js.map +0 -1
- package/dist-src/@types/action.js +0 -1
- package/dist-src/@types/codegen/types.js +0 -14
- package/dist-src/@types/filter.js +0 -1
- package/dist-src/@types/queryFilter.js +0 -1
- package/dist-src/@types/search.js +0 -1
- package/dist-src/@types/vehicle-properties.js +0 -1
- package/dist-src/State/CentralStorage/CentralStorageContext.js +0 -4
- package/dist-src/State/CentralStorage/CentralStorageProvider.js +0 -9
- package/dist-src/State/CentralStorage/useCentralStorage.js +0 -29
- package/dist-src/State/Path/PathContext.js +0 -2
- package/dist-src/State/Path/PathProvider.js +0 -47
- package/dist-src/State/Path/reducer.js +0 -15
- package/dist-src/State/Path/usePath.js +0 -10
- package/dist-src/State/RelatedSearch/RelatedSearchContext.js +0 -8
- package/dist-src/State/RelatedSearch/RelatedSearchProvider.js +0 -27
- package/dist-src/State/RelatedSearch/useRelatedSearch.js +0 -15
- package/dist-src/State/Search/SearchContext.js +0 -12
- package/dist-src/State/Search/SearchProvider.js +0 -176
- package/dist-src/State/Settings/SettingsContext.js +0 -2
- package/dist-src/State/Settings/SettingsProvider.js +0 -4
- package/dist-src/components/Accordion/index.js +0 -18
- package/dist-src/components/ActionList/index.js +0 -18
- package/dist-src/components/ActionList/toggle-item.js +0 -27
- package/dist-src/components/Avatar/index.js +0 -4
- package/dist-src/components/Badge/index.js +0 -4
- package/dist-src/components/Badge/wrapper.js +0 -24
- package/dist-src/components/Blockquote/index.js +0 -12
- package/dist-src/components/CheckMarkList/index.js +0 -9
- package/dist-src/components/Checklist/index.js +0 -14
- package/dist-src/components/ColorSelect/index.js +0 -18
- package/dist-src/components/Container/index.js +0 -4
- package/dist-src/components/Content/index.js +0 -4
- package/dist-src/components/DataList/index.js +0 -6
- package/dist-src/components/DetailBox/index.js +0 -17
- package/dist-src/components/ExtendContent/index.js +0 -24
- package/dist-src/components/ExtendInfo/index.js +0 -15
- package/dist-src/components/Filter/index.js +0 -62
- package/dist-src/components/FilterPanel/checkListFacet.js +0 -29
- package/dist-src/components/FilterPanel/colorFacet.js +0 -29
- package/dist-src/components/FilterPanel/faceSelector.js +0 -31
- package/dist-src/components/FilterPanel/index.js +0 -24
- package/dist-src/components/FilterPanel/rangeFacet.js +0 -82
- package/dist-src/components/FinancialOptions/LoanModal.js +0 -127
- package/dist-src/components/FinancialOptions/index.js +0 -12
- package/dist-src/components/FinancialOptions/leasing.js +0 -55
- package/dist-src/components/FinancialOptions/loan.js +0 -54
- package/dist-src/components/Gallery/MediaButton.js +0 -7
- package/dist-src/components/Gallery/index.js +0 -119
- package/dist-src/components/Grid/index.js +0 -44
- package/dist-src/components/Heading/index.js +0 -54
- package/dist-src/components/Icon/index.js +0 -36
- package/dist-src/components/InputCheckbox/index.js +0 -10
- package/dist-src/components/InputLabel/index.js +0 -4
- package/dist-src/components/InputSearch/index.js +0 -12
- package/dist-src/components/InputSelect/index.js +0 -10
- package/dist-src/components/InputText/index.js +0 -5
- package/dist-src/components/InsuranceOptions/Insurance.js +0 -26
- package/dist-src/components/InsuranceOptions/InsuranceFree.js +0 -30
- package/dist-src/components/InsuranceOptions/InsuranceFreeModal.js +0 -19
- package/dist-src/components/InsuranceOptions/InsuranceModal.js +0 -105
- package/dist-src/components/InsuranceOptions/index.js +0 -15
- package/dist-src/components/Lightbox/index.js +0 -30
- package/dist-src/components/Loader/index.js +0 -7
- package/dist-src/components/LogoBox/index.js +0 -10
- package/dist-src/components/Map/index.js +0 -27
- package/dist-src/components/Modal/index.js +0 -20
- package/dist-src/components/OpeningHours/index.js +0 -97
- package/dist-src/components/OptionBox/index.js +0 -7
- package/dist-src/components/OverflowBox/index.js +0 -4
- package/dist-src/components/Page/index.js +0 -30
- package/dist-src/components/Panel/index.js +0 -20
- package/dist-src/components/Pdf/index.js +0 -11
- package/dist-src/components/PhoneNumber/index.js +0 -13
- package/dist-src/components/Portal/index.js +0 -4
- package/dist-src/components/Portal/portal-element.js +0 -3
- package/dist-src/components/Portal/portal.js +0 -25
- package/dist-src/components/PriceTable/index.js +0 -20
- package/dist-src/components/ProductCard/index.js +0 -38
- package/dist-src/components/ProgressBar/index.js +0 -16
- package/dist-src/components/RangeSlider/RangeSliderSimple.js +0 -26
- package/dist-src/components/RangeSlider/SliderWithLabel.js +0 -21
- package/dist-src/components/RangeSlider/handle.js +0 -5
- package/dist-src/components/RangeSlider/index.js +0 -50
- package/dist-src/components/RangeSlider/track.js +0 -6
- package/dist-src/components/RangeSliderLabel/index.js +0 -6
- package/dist-src/components/Result/index.js +0 -40
- package/dist-src/components/SearchBar/index.js +0 -18
- package/dist-src/components/SearchFilter/index.js +0 -23
- package/dist-src/components/SearchTerm/index.js +0 -8
- package/dist-src/components/SectionHeader/index.js +0 -9
- package/dist-src/components/Snackbar/index.js +0 -21
- package/dist-src/components/Snackbar/wrapper.js +0 -56
- package/dist-src/components/SortSelect/index.js +0 -10
- package/dist-src/components/Sphere/Sphere.js +0 -21
- package/dist-src/components/Sphere/SphereLightbox.js +0 -4
- package/dist-src/components/Sphere/SphereViewer.js +0 -54
- package/dist-src/components/SwitchBar/index.js +0 -23
- package/dist-src/components/Tabs/index.js +0 -6
- package/dist-src/components/ThreeSixty/Rotation.js +0 -95
- package/dist-src/components/ThreeSixty/ThreeSixtLightbox.js +0 -15
- package/dist-src/components/ThreeSixty/ThreeSixty.js +0 -25
- package/dist-src/components/UspList/index.js +0 -18
- package/dist-src/components/Utility/index.js +0 -13
- package/dist-src/components/Video/CustomPlayer.js +0 -8
- package/dist-src/components/Video/EmbeddedVideoLightbox.js +0 -18
- package/dist-src/components/Video/EmbededVideo.js +0 -38
- package/dist-src/components/Video/QuickNavEmbeded.js +0 -17
- package/dist-src/components/Video/QuickNavVideo.js +0 -6
- package/dist-src/components/Video/Video.js +0 -8
- package/dist-src/components/Video/VimeoPlayer.js +0 -6
- package/dist-src/components/Video/YoutubePlayer.js +0 -6
- package/dist-src/components/Video/useThumbnail.js +0 -25
- package/dist-src/components/Video/utils.js +0 -35
- package/dist-src/components/Video/wrapper.js +0 -19
- package/dist-src/hooks/useFetch.js +0 -69
- package/dist-src/hooks/useHasBeenVisible.js +0 -13
- package/dist-src/hooks/useHashGuid.js +0 -28
- package/dist-src/hooks/useInsurance.js +0 -12
- package/dist-src/hooks/useLoan.js +0 -12
- package/dist-src/hooks/useOnScreen.js +0 -15
- package/dist-src/hooks/useOutsideClick.js +0 -15
- package/dist-src/hooks/usePrevious.js +0 -9
- package/dist-src/hooks/useSearchItem.js +0 -7
- package/dist-src/hooks/useSearchItemBranch.js +0 -7
- package/dist-src/hooks/useSessionStorage.js +0 -23
- package/dist-src/hooks/useVimeoThumbnail.js +0 -18
- package/dist-src/index.js +0 -10
- package/dist-src/layout/helpers.js +0 -5
- package/dist-src/layout/theme.js +0 -57
- package/dist-src/layouts/WaykeComposite.js +0 -23
- package/dist-src/layouts/WaykeCompositeWithProvider.js +0 -6
- package/dist-src/layouts/search/index.js +0 -55
- package/dist-src/layouts/searchItem/Branch.js +0 -53
- package/dist-src/layouts/searchItem/BranchModal.js +0 -36
- package/dist-src/layouts/searchItem/CheckList.js +0 -65
- package/dist-src/layouts/searchItem/ManufacturerPackagesOption.js +0 -25
- package/dist-src/layouts/searchItem/MetadataItem.js +0 -34
- package/dist-src/layouts/searchItem/PackageOptionModal.js +0 -15
- package/dist-src/layouts/searchItem/PackageOptions.js +0 -25
- package/dist-src/layouts/searchItem/Property.js +0 -51
- package/dist-src/layouts/searchItem/Related.js +0 -64
- package/dist-src/layouts/searchItem/index.js +0 -181
- package/dist-src/providers/WaykeItemProvidet.js +0 -16
- package/dist-src/providers/WaykeProvider.js +0 -18
- package/dist-src/providers/graphqlProvider.js +0 -7
- package/dist-src/providers/themeProvider.js +0 -5
- package/dist-src/utils/constants.js +0 -30
- package/dist-src/utils/converters.js +0 -31
- package/dist-src/utils/formats.js +0 -60
- package/dist-src/utils/metadata.min.js +0 -86
- package/dist-src/utils/phonenumbers.js +0 -12
- package/dist-src/utils/pubsub/Actions.js +0 -1
- package/dist-src/utils/pubsub/Events.js +0 -1
- package/dist-src/utils/pubsub/pubsub.js +0 -93
- package/dist-src/utils/regex.js +0 -10
- package/dist-src/utils/sortOptions.js +0 -26
- package/dist-src/utils/specification.js +0 -495
- package/dist-src/utils/ssn.js +0 -1
- package/dist-src/utils/vehicle-properties/compare-basic-properties.js +0 -36
- package/dist-src/utils/vehicle-properties/compare-categories.js +0 -27
- package/dist-src/utils/vehicle-properties/compare-properties.js +0 -3
- package/dist-src/utils/vehicle-properties/custom-property-adder.js +0 -143
- package/dist-src/utils/vehicle-properties/property-hint-enricher.js +0 -190
- package/dist-src/utils/vehicle-properties/property-remover.js +0 -20
- package/dist-src/utils/vehicle-properties/property-tree-creator.js +0 -127
- package/dist-src/utils/vehicle-properties/property-tree-sorter.js +0 -18
- package/dist-types/@types/codegen/types.d.ts +0 -343
- package/dist-types/@types/filter.d.ts +0 -5
- package/dist-types/@types/queryFilter.d.ts +0 -5
- package/dist-types/@types/search.d.ts +0 -105
- package/dist-types/@types/vehicle-properties.d.ts +0 -29
- package/dist-types/State/CentralStorage/CentralStorageContext.d.ts +0 -6
- package/dist-types/State/CentralStorage/CentralStorageProvider.d.ts +0 -6
- package/dist-types/State/CentralStorage/useCentralStorage.d.ts +0 -6
- package/dist-types/State/Path/PathContext.d.ts +0 -9
- package/dist-types/State/Path/PathProvider.d.ts +0 -6
- package/dist-types/State/Path/reducer.d.ts +0 -14
- package/dist-types/State/Path/usePath.d.ts +0 -3
- package/dist-types/State/RelatedSearch/RelatedSearchContext.d.ts +0 -10
- package/dist-types/State/RelatedSearch/RelatedSearchProvider.d.ts +0 -9
- package/dist-types/State/RelatedSearch/useRelatedSearch.d.ts +0 -2
- package/dist-types/State/Search/SearchContext.d.ts +0 -15
- package/dist-types/State/Search/SearchProvider.d.ts +0 -10
- package/dist-types/State/Search/useSearch.d.ts +0 -2
- package/dist-types/State/Settings/SettingsContext.d.ts +0 -13
- package/dist-types/State/Settings/SettingsProvider.d.ts +0 -10
- package/dist-types/State/Settings/useSettings.d.ts +0 -2
- package/dist-types/components/Accordion/index.d.ts +0 -13
- package/dist-types/components/Accordion/wrapper.d.ts +0 -16
- package/dist-types/components/ActionList/index.d.ts +0 -8
- package/dist-types/components/ActionList/toggle-item.d.ts +0 -10
- package/dist-types/components/Avatar/index.d.ts +0 -7
- package/dist-types/components/Avatar/wrapper.d.ts +0 -7
- package/dist-types/components/Badge/index.d.ts +0 -7
- package/dist-types/components/Badge/wrapper.d.ts +0 -7
- package/dist-types/components/Blockquote/index.d.ts +0 -9
- package/dist-types/components/Blockquote/wrapper.d.ts +0 -9
- package/dist-types/components/Button/index.d.ts +0 -52
- package/dist-types/components/CheckMarkList/index.d.ts +0 -7
- package/dist-types/components/CheckMarkList/wrapper.d.ts +0 -6
- package/dist-types/components/Checklist/index.d.ts +0 -13
- package/dist-types/components/Checklist/wrapper.d.ts +0 -11
- package/dist-types/components/ColorSelect/index.d.ts +0 -14
- package/dist-types/components/ColorSelect/wrapper.d.ts +0 -11
- package/dist-types/components/ColumnRow/index.d.ts +0 -2
- package/dist-types/components/Container/index.d.ts +0 -6
- package/dist-types/components/Container/wrapper.d.ts +0 -1
- package/dist-types/components/Content/index.d.ts +0 -6
- package/dist-types/components/Content/wrapper.d.ts +0 -4
- package/dist-types/components/ContentLogo/index.d.ts +0 -3
- package/dist-types/components/DataList/index.d.ts +0 -10
- package/dist-types/components/DataList/wrapper.d.ts +0 -6
- package/dist-types/components/DetailBox/index.d.ts +0 -8
- package/dist-types/components/DetailBox/wrapper.d.ts +0 -13
- package/dist-types/components/ExtendContent/index.d.ts +0 -8
- package/dist-types/components/ExtendContent/wrapper.d.ts +0 -6
- package/dist-types/components/ExtendInfo/index.d.ts +0 -7
- package/dist-types/components/ExtendInfo/wrapper.d.ts +0 -10
- package/dist-types/components/Filter/index.d.ts +0 -7
- package/dist-types/components/Filter/wrapper.d.ts +0 -8
- package/dist-types/components/FilterPanel/checkListFacet.d.ts +0 -7
- package/dist-types/components/FilterPanel/colorFacet.d.ts +0 -7
- package/dist-types/components/FilterPanel/faceSelector.d.ts +0 -7
- package/dist-types/components/FilterPanel/index.d.ts +0 -18
- package/dist-types/components/FilterPanel/rangeFacet.d.ts +0 -9
- package/dist-types/components/FinancialOptions/LoanModal.d.ts +0 -9
- package/dist-types/components/FinancialOptions/index.d.ts +0 -8
- package/dist-types/components/FinancialOptions/leasing.d.ts +0 -7
- package/dist-types/components/FinancialOptions/loan.d.ts +0 -8
- package/dist-types/components/Gallery/MediaButton.d.ts +0 -7
- package/dist-types/components/Gallery/index.d.ts +0 -8
- package/dist-types/components/Gallery/wrapper.d.ts +0 -26
- package/dist-types/components/Grid/index.d.ts +0 -11
- package/dist-types/components/Grid/wrapper.d.ts +0 -3
- package/dist-types/components/Heading/index.d.ts +0 -24
- package/dist-types/components/Icon/index.d.ts +0 -16
- package/dist-types/components/InputCheckbox/index.d.ts +0 -7
- package/dist-types/components/InputCheckbox/wrapper.d.ts +0 -13
- package/dist-types/components/InputGroup/index.d.ts +0 -2
- package/dist-types/components/InputLabel/index.d.ts +0 -7
- package/dist-types/components/InputLabel/wrapper.d.ts +0 -3
- package/dist-types/components/InputSearch/index.d.ts +0 -11
- package/dist-types/components/InputSearch/wrapper.d.ts +0 -15
- package/dist-types/components/InputSelect/index.d.ts +0 -14
- package/dist-types/components/InputSelect/wrapper.d.ts +0 -6
- package/dist-types/components/InputText/index.d.ts +0 -8
- package/dist-types/components/InputText/wrapper.d.ts +0 -5
- package/dist-types/components/InsuranceOptions/Insurance.d.ts +0 -9
- package/dist-types/components/InsuranceOptions/InsuranceFree.d.ts +0 -7
- package/dist-types/components/InsuranceOptions/InsuranceFreeModal.d.ts +0 -8
- package/dist-types/components/InsuranceOptions/InsuranceModal.d.ts +0 -10
- package/dist-types/components/InsuranceOptions/index.d.ts +0 -9
- package/dist-types/components/Lightbox/index.d.ts +0 -9
- package/dist-types/components/Lightbox/wrapper.d.ts +0 -9
- package/dist-types/components/Loader/index.d.ts +0 -7
- package/dist-types/components/Loader/wrapper.d.ts +0 -9
- package/dist-types/components/LogoBox/index.d.ts +0 -9
- package/dist-types/components/LogoBox/wrapper.d.ts +0 -4
- package/dist-types/components/Map/index.d.ts +0 -7
- package/dist-types/components/Map/wrapper.d.ts +0 -4
- package/dist-types/components/Modal/index.d.ts +0 -9
- package/dist-types/components/Modal/wrapper.d.ts +0 -21
- package/dist-types/components/OpeningHours/index.d.ts +0 -7
- package/dist-types/components/OptionBox/index.d.ts +0 -9
- package/dist-types/components/OptionBox/wrapper.d.ts +0 -8
- package/dist-types/components/OverflowBox/index.d.ts +0 -6
- package/dist-types/components/OverflowBox/wrapper.d.ts +0 -1
- package/dist-types/components/OverflowGrid/index.d.ts +0 -3
- package/dist-types/components/Page/index.d.ts +0 -7
- package/dist-types/components/Panel/index.d.ts +0 -10
- package/dist-types/components/Panel/wrapper.d.ts +0 -22
- package/dist-types/components/Pdf/index.d.ts +0 -11
- package/dist-types/components/Pdf/wrapper.d.ts +0 -11
- package/dist-types/components/PhoneNumber/index.d.ts +0 -6
- package/dist-types/components/Portal/portal-element.d.ts +0 -6
- package/dist-types/components/Portal/portal-namespace.d.ts +0 -1
- package/dist-types/components/Portal/portal.d.ts +0 -7
- package/dist-types/components/Price/index.d.ts +0 -4
- package/dist-types/components/PriceTable/index.d.ts +0 -7
- package/dist-types/components/PriceTable/wrapper.d.ts +0 -4
- package/dist-types/components/ProductCard/index.d.ts +0 -18
- package/dist-types/components/ProductCard/wrapper.d.ts +0 -21
- package/dist-types/components/ProductPage/index.d.ts +0 -9
- package/dist-types/components/ProgressBar/index.d.ts +0 -8
- package/dist-types/components/ProgressBar/wrapper.d.ts +0 -6
- package/dist-types/components/RangeSlider/RangeSliderSimple.d.ts +0 -13
- package/dist-types/components/RangeSlider/SliderWithLabel.d.ts +0 -13
- package/dist-types/components/RangeSlider/handle.d.ts +0 -9
- package/dist-types/components/RangeSlider/index.d.ts +0 -13
- package/dist-types/components/RangeSlider/track.d.ts +0 -9
- package/dist-types/components/RangeSlider/wrapper.d.ts +0 -11
- package/dist-types/components/RangeSliderLabel/index.d.ts +0 -8
- package/dist-types/components/RangeSliderLabel/wrapper.d.ts +0 -10
- package/dist-types/components/Repeat/index.d.ts +0 -3
- package/dist-types/components/Result/index.d.ts +0 -6
- package/dist-types/components/Result/wrapper.d.ts +0 -9
- package/dist-types/components/Root/index.d.ts +0 -4
- package/dist-types/components/SearchBar/index.d.ts +0 -8
- package/dist-types/components/SearchFilter/index.d.ts +0 -3
- package/dist-types/components/SearchTerm/index.d.ts +0 -8
- package/dist-types/components/SearchTerm/wrapper.d.ts +0 -7
- package/dist-types/components/SectionHeader/index.d.ts +0 -8
- package/dist-types/components/SectionHeader/wrapper.d.ts +0 -3
- package/dist-types/components/Snackbar/index.d.ts +0 -9
- package/dist-types/components/Snackbar/wrapper.d.ts +0 -11
- package/dist-types/components/SortSelect/index.d.ts +0 -14
- package/dist-types/components/SortSelect/wrapper.d.ts +0 -6
- package/dist-types/components/Sphere/Sphere.d.ts +0 -10
- package/dist-types/components/Sphere/SphereLightbox.d.ts +0 -6
- package/dist-types/components/Sphere/SphereViewer.d.ts +0 -10
- package/dist-types/components/Sphere/wrapper.d.ts +0 -1
- package/dist-types/components/SrOnly/index.d.ts +0 -1
- package/dist-types/components/SwitchBar/index.d.ts +0 -10
- package/dist-types/components/SwitchBar/wrapper.d.ts +0 -14
- package/dist-types/components/TableColumn/index.d.ts +0 -3
- package/dist-types/components/TableList/index.d.ts +0 -6
- package/dist-types/components/Tabs/index.d.ts +0 -12
- package/dist-types/components/Tabs/wrapper.d.ts +0 -12
- package/dist-types/components/ThreeSixty/Rotation.d.ts +0 -6
- package/dist-types/components/ThreeSixty/ThreeSixtLightbox.d.ts +0 -6
- package/dist-types/components/ThreeSixty/ThreeSixty.d.ts +0 -9
- package/dist-types/components/UspList/index.d.ts +0 -11
- package/dist-types/components/UspList/wrapper.d.ts +0 -11
- package/dist-types/components/Utility/index.d.ts +0 -8
- package/dist-types/components/Video/CustomPlayer.d.ts +0 -10
- package/dist-types/components/Video/EmbeddedVideoLightbox.d.ts +0 -8
- package/dist-types/components/Video/EmbededVideo.d.ts +0 -8
- package/dist-types/components/Video/QuickNavEmbeded.d.ts +0 -7
- package/dist-types/components/Video/QuickNavVideo.d.ts +0 -7
- package/dist-types/components/Video/Video.d.ts +0 -5
- package/dist-types/components/Video/VimeoPlayer.d.ts +0 -7
- package/dist-types/components/Video/YoutubePlayer.d.ts +0 -7
- package/dist-types/components/Video/useThumbnail.d.ts +0 -2
- package/dist-types/components/Video/utils.d.ts +0 -9
- package/dist-types/components/Video/wrapper.d.ts +0 -11
- package/dist-types/hooks/useFetch.d.ts +0 -7
- package/dist-types/hooks/useHasBeenVisible.d.ts +0 -2
- package/dist-types/hooks/useHashGuid.d.ts +0 -2
- package/dist-types/hooks/useInsurance.d.ts +0 -4
- package/dist-types/hooks/useLoan.d.ts +0 -4
- package/dist-types/hooks/useOnScreen.d.ts +0 -2
- package/dist-types/hooks/useOutsideClick.d.ts +0 -2
- package/dist-types/hooks/usePrevious.d.ts +0 -2
- package/dist-types/hooks/useSearchItem.d.ts +0 -4
- package/dist-types/hooks/useSearchItemBranch.d.ts +0 -4
- package/dist-types/hooks/useSessionStorage.d.ts +0 -7
- package/dist-types/hooks/useVimeoThumbnail.d.ts +0 -2
- package/dist-types/index.d.ts +0 -18
- package/dist-types/layout/helpers.d.ts +0 -1
- package/dist-types/layout/keyframes.d.ts +0 -3
- package/dist-types/layout/theme.d.ts +0 -40
- package/dist-types/layouts/WaykeComposite.d.ts +0 -6
- package/dist-types/layouts/WaykeCompositeWithProvider.d.ts +0 -9
- package/dist-types/layouts/search/index.d.ts +0 -15
- package/dist-types/layouts/searchItem/Branch.d.ts +0 -8
- package/dist-types/layouts/searchItem/BranchModal.d.ts +0 -9
- package/dist-types/layouts/searchItem/CheckList.d.ts +0 -13
- package/dist-types/layouts/searchItem/ManufacturerPackagesOption.d.ts +0 -7
- package/dist-types/layouts/searchItem/MetadataItem.d.ts +0 -10
- package/dist-types/layouts/searchItem/PackageOptionModal.d.ts +0 -17
- package/dist-types/layouts/searchItem/PackageOptions.d.ts +0 -7
- package/dist-types/layouts/searchItem/Page404.d.ts +0 -3
- package/dist-types/layouts/searchItem/PageLoading.d.ts +0 -3
- package/dist-types/layouts/searchItem/Property.d.ts +0 -8
- package/dist-types/layouts/searchItem/Related.d.ts +0 -9
- package/dist-types/layouts/searchItem/index.d.ts +0 -12
- package/dist-types/providers/WaykeItemProvidet.d.ts +0 -22
- package/dist-types/providers/WaykeProvider.d.ts +0 -24
- package/dist-types/providers/graphqlProvider.d.ts +0 -6
- package/dist-types/providers/themeProvider.d.ts +0 -6
- package/dist-types/queries/INSURANCE_CALCULATION.d.ts +0 -2
- package/dist-types/queries/LOAN_CALCULATION.d.ts +0 -2
- package/dist-types/queries/SEARCH_ITEM_BRANCH_QUERY.d.ts +0 -2
- package/dist-types/queries/SEARCH_ITEM_QUERY.d.ts +0 -2
- package/dist-types/utils/constants.d.ts +0 -62
- package/dist-types/utils/converters.d.ts +0 -1
- package/dist-types/utils/deep-copy.d.ts +0 -5
- package/dist-types/utils/formats.d.ts +0 -8
- package/dist-types/utils/metadata.min.d.ts +0 -11
- package/dist-types/utils/phonenumbers.d.ts +0 -1
- package/dist-types/utils/pubsub/Actions.d.ts +0 -16
- package/dist-types/utils/pubsub/Events.d.ts +0 -51
- package/dist-types/utils/pubsub/pubsub.d.ts +0 -32
- package/dist-types/utils/regex.d.ts +0 -3
- package/dist-types/utils/sortOptions.d.ts +0 -11
- package/dist-types/utils/specification.d.ts +0 -28
- package/dist-types/utils/ssn.d.ts +0 -1
- package/dist-types/utils/url.d.ts +0 -1
- package/dist-types/utils/vehicle-properties/compare-basic-properties.d.ts +0 -3
- package/dist-types/utils/vehicle-properties/compare-categories.d.ts +0 -3
- package/dist-types/utils/vehicle-properties/compare-properties.d.ts +0 -3
- package/dist-types/utils/vehicle-properties/custom-property-adder.d.ts +0 -12
- package/dist-types/utils/vehicle-properties/property-hint-enricher.d.ts +0 -10
- package/dist-types/utils/vehicle-properties/property-remover.d.ts +0 -7
- package/dist-types/utils/vehicle-properties/property-tree-creator.d.ts +0 -31
- package/dist-types/utils/vehicle-properties/property-tree-sorter.d.ts +0 -3
- package/dist-web/index.js +0 -7555
- package/dist-web/index.js.map +0 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
import OptionBox from '../OptionBox/index';
|
|
4
|
+
import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
|
|
5
|
+
import { UtilityTextPrimary } from '../Utility/index';
|
|
6
|
+
import { ButtonInline } from '../Button/index';
|
|
7
|
+
import { numberSeparator } from '../../utils/formats';
|
|
8
|
+
import Modal from '../Modal/index';
|
|
9
|
+
import { Image, ModalFoldout, ModalFoldoutBody } from '../Modal/wrapper';
|
|
10
|
+
import Content from '../Content/index';
|
|
11
|
+
import DataList from '../DataList/index';
|
|
12
|
+
import { FinancialOption } from '../../@types/codegen/types';
|
|
13
|
+
|
|
14
|
+
interface LeasingProps {
|
|
15
|
+
financialOption: FinancialOption;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Leasing = ({ financialOption }: LeasingProps) => {
|
|
19
|
+
const [modal, setModal] = useState(false);
|
|
20
|
+
const toggleModal = useCallback(() => setModal(!modal), [modal]);
|
|
21
|
+
|
|
22
|
+
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
{modal && (
|
|
27
|
+
<Modal title="Privatleasing" onClose={toggleModal}>
|
|
28
|
+
{image && <Image src={image} alt="Privatleasing" />}
|
|
29
|
+
{description && <Content dangerouslySetInnerHTML={{ __html: description }} />}
|
|
30
|
+
<ModalFoldout>
|
|
31
|
+
<ModalFoldoutBody>
|
|
32
|
+
<DataList
|
|
33
|
+
items={[
|
|
34
|
+
{
|
|
35
|
+
label: 'Månadskostnad',
|
|
36
|
+
value: `${numberSeparator(monthlyCost || 0)} kr/mån`,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Bindningstid',
|
|
40
|
+
value: `${duration?.current} månader`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Årlig körsträcka',
|
|
44
|
+
value: `${numberSeparator(mileage?.current || 0)} mil/år`,
|
|
45
|
+
},
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
48
|
+
</ModalFoldoutBody>
|
|
49
|
+
</ModalFoldout>
|
|
50
|
+
</Modal>
|
|
51
|
+
)}
|
|
52
|
+
<OptionBox>
|
|
53
|
+
<>
|
|
54
|
+
{monthlyCost !== null && monthlyCost !== undefined && (
|
|
55
|
+
<OptionBoxHeading>{`ca ${numberSeparator(monthlyCost)} kr/mån`}</OptionBoxHeading>
|
|
56
|
+
)}
|
|
57
|
+
</>
|
|
58
|
+
<OptionBoxContent>
|
|
59
|
+
<p>
|
|
60
|
+
Privatleasing{' '}
|
|
61
|
+
{mileage?.current && duration?.current && (
|
|
62
|
+
<>
|
|
63
|
+
<UtilityTextPrimary>{numberSeparator(mileage?.current)} mil/år</UtilityTextPrimary>{' '}
|
|
64
|
+
i <UtilityTextPrimary>{duration?.current} mån</UtilityTextPrimary>.{' '}
|
|
65
|
+
</>
|
|
66
|
+
)}
|
|
67
|
+
</p>
|
|
68
|
+
<p>
|
|
69
|
+
<ButtonInline onClick={toggleModal}>Läs mer</ButtonInline>
|
|
70
|
+
</p>
|
|
71
|
+
</OptionBoxContent>
|
|
72
|
+
</OptionBox>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default Leasing;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
import OptionBox from '../OptionBox/index';
|
|
4
|
+
import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
|
|
5
|
+
import { UtilityTextPrimary } from '../Utility/index';
|
|
6
|
+
import { ButtonInline } from '../Button/index';
|
|
7
|
+
import { numberSeparator } from '../../utils/formats';
|
|
8
|
+
import useLoanCalculation from '../../hooks/useLoan';
|
|
9
|
+
import { FinancialOption } from '../../@types/codegen/types';
|
|
10
|
+
import LoanModal from './LoanModal';
|
|
11
|
+
|
|
12
|
+
interface LoanProps {
|
|
13
|
+
id: string;
|
|
14
|
+
financialOption: FinancialOption;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Loan = ({ id, financialOption }: LoanProps) => {
|
|
18
|
+
const [modal, setModal] = useState(false);
|
|
19
|
+
const toggleModal = useCallback(() => setModal(!modal), [modal]);
|
|
20
|
+
|
|
21
|
+
const { data } = useLoanCalculation(
|
|
22
|
+
id,
|
|
23
|
+
financialOption.duration?.current,
|
|
24
|
+
financialOption.downPayment?.current,
|
|
25
|
+
financialOption.residual?.current
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const interest = data?.loan?.interest;
|
|
29
|
+
const duration = data?.loan?.duration?.current;
|
|
30
|
+
const monthlyCost = data?.loan?.monthlyCost;
|
|
31
|
+
|
|
32
|
+
const logo = financialOption?.logotype || 'https://placehold.it/67x10';
|
|
33
|
+
|
|
34
|
+
// Skeleton?
|
|
35
|
+
if (
|
|
36
|
+
financialOption.loanAmount === undefined ||
|
|
37
|
+
financialOption.loanAmount === null ||
|
|
38
|
+
interest === undefined ||
|
|
39
|
+
duration === undefined ||
|
|
40
|
+
monthlyCost === undefined ||
|
|
41
|
+
interest === null ||
|
|
42
|
+
duration === null ||
|
|
43
|
+
monthlyCost === null
|
|
44
|
+
) {
|
|
45
|
+
return (
|
|
46
|
+
<OptionBox logo={logo} logoAlt="Logotyp">
|
|
47
|
+
<OptionBoxHeading>Laddar...</OptionBoxHeading>
|
|
48
|
+
|
|
49
|
+
<OptionBoxContent>
|
|
50
|
+
<p>Laddar...</p>
|
|
51
|
+
</OptionBoxContent>
|
|
52
|
+
</OptionBox>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
{modal && <LoanModal id={id} financialOption={financialOption} onClose={toggleModal} />}
|
|
59
|
+
<OptionBox logo={logo} logoAlt="Logotyp">
|
|
60
|
+
<>
|
|
61
|
+
<OptionBoxHeading>{`${numberSeparator(monthlyCost)} kr/mån*`}</OptionBoxHeading>
|
|
62
|
+
|
|
63
|
+
<OptionBoxContent>
|
|
64
|
+
<p>
|
|
65
|
+
Delbetala{' '}
|
|
66
|
+
{financialOption.loanAmount && duration && (
|
|
67
|
+
<>
|
|
68
|
+
<UtilityTextPrimary>
|
|
69
|
+
{numberSeparator(financialOption.loanAmount)} kr
|
|
70
|
+
</UtilityTextPrimary>{' '}
|
|
71
|
+
i <UtilityTextPrimary>{duration} mån</UtilityTextPrimary>.
|
|
72
|
+
</>
|
|
73
|
+
)}
|
|
74
|
+
</p>
|
|
75
|
+
|
|
76
|
+
<p>
|
|
77
|
+
{`*Beräknat på ${(interest * 100).toFixed(2)}% ränta. `}
|
|
78
|
+
<ButtonInline onClick={toggleModal}>Läs mer</ButtonInline>
|
|
79
|
+
</p>
|
|
80
|
+
</OptionBoxContent>
|
|
81
|
+
</>
|
|
82
|
+
</OptionBox>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default Loan;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { MediaButtonWrapper } from './wrapper';
|
|
4
|
+
import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
5
|
+
|
|
6
|
+
interface MediaButtonProps {
|
|
7
|
+
text: string;
|
|
8
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const MediaButton = ({ text, onClick }: MediaButtonProps) => (
|
|
12
|
+
<MediaButtonWrapper>
|
|
13
|
+
<ButtonSecondary onClick={onClick} title={text}>
|
|
14
|
+
<ButtonContent>{text}</ButtonContent>
|
|
15
|
+
</ButtonSecondary>
|
|
16
|
+
</MediaButtonWrapper>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default MediaButton;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import React, { useState, useCallback, useRef, useMemo } from 'react';
|
|
2
|
+
import Slider from 'react-slick';
|
|
3
|
+
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Wrapper,
|
|
7
|
+
SliderWrapper,
|
|
8
|
+
Item,
|
|
9
|
+
Image,
|
|
10
|
+
ArrowLeft,
|
|
11
|
+
ArrowRight,
|
|
12
|
+
Main,
|
|
13
|
+
Alt,
|
|
14
|
+
QuickNav,
|
|
15
|
+
QuickNavItem,
|
|
16
|
+
QuickNavBtn,
|
|
17
|
+
QuickNavImg,
|
|
18
|
+
EnableNavigationButton,
|
|
19
|
+
} from './wrapper';
|
|
20
|
+
import { IconChevronLeft, IconChevronRight } from '../Icon/index';
|
|
21
|
+
import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
22
|
+
import Lightbox from '../Lightbox/index';
|
|
23
|
+
import EmbededVideo from '../Video/EmbededVideo';
|
|
24
|
+
import QuickNavEmbeded from '../Video/QuickNavEmbeded';
|
|
25
|
+
import Sphere from '../Sphere/Sphere';
|
|
26
|
+
import { notEmpty } from '../../utils/formats';
|
|
27
|
+
import ThreeSixty from '../ThreeSixty/ThreeSixty';
|
|
28
|
+
import { Media } from '../../@types/codegen/types';
|
|
29
|
+
import PubSub from '../../utils/pubsub/pubsub';
|
|
30
|
+
import { DEFAULT_PLACEHOLDER_IMAGE } from '../../utils/constants';
|
|
31
|
+
|
|
32
|
+
interface GalleryProps {
|
|
33
|
+
media?: Media[];
|
|
34
|
+
placeholderImage?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const sliderSettings = {
|
|
38
|
+
dots: false,
|
|
39
|
+
arrows: false,
|
|
40
|
+
infinite: true,
|
|
41
|
+
speed: 300,
|
|
42
|
+
slidesToShow: 1,
|
|
43
|
+
slidesToScroll: 1,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const Gallery = ({ media, placeholderImage }: GalleryProps) => {
|
|
47
|
+
const slider = useRef<Slider>(null);
|
|
48
|
+
const quickNavRef = useRef<HTMLUListElement>(null);
|
|
49
|
+
const isDragging = useRef(false);
|
|
50
|
+
const [index, setIndex] = useState(0);
|
|
51
|
+
const [lightbox, setLightbox] = useState(false);
|
|
52
|
+
const [navigationDisabled, setNavigationDisabled] = useState(false);
|
|
53
|
+
|
|
54
|
+
const beforeChange = useCallback((_: number, newIndex: number) => {
|
|
55
|
+
const element = quickNavRef.current?.querySelectorAll('li')?.[newIndex];
|
|
56
|
+
if (element) {
|
|
57
|
+
scrollIntoView(element, { scrollMode: 'if-needed', block: 'nearest', inline: 'nearest' });
|
|
58
|
+
}
|
|
59
|
+
setIndex(newIndex);
|
|
60
|
+
}, []);
|
|
61
|
+
|
|
62
|
+
const onMouseDown = useCallback(() => {
|
|
63
|
+
if (isDragging.current) {
|
|
64
|
+
isDragging.current = false;
|
|
65
|
+
}
|
|
66
|
+
}, []);
|
|
67
|
+
const onMouseMove = useCallback(() => {
|
|
68
|
+
if (!isDragging.current) {
|
|
69
|
+
isDragging.current = true;
|
|
70
|
+
}
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
const onClick = useCallback(() => {
|
|
74
|
+
PubSub.publish('ImagesClick');
|
|
75
|
+
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
76
|
+
setLightbox(true);
|
|
77
|
+
}
|
|
78
|
+
}, [lightbox, media]);
|
|
79
|
+
|
|
80
|
+
const nextImage = useCallback((): void => {
|
|
81
|
+
if (!slider || !slider.current) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
slider.current.slickNext();
|
|
85
|
+
}, [slider]);
|
|
86
|
+
|
|
87
|
+
const prevImage = useCallback((): void => {
|
|
88
|
+
if (!slider || !slider.current) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
slider.current.slickPrev();
|
|
92
|
+
}, [slider]);
|
|
93
|
+
|
|
94
|
+
const goTo = (target: number) => {
|
|
95
|
+
if (!slider || !slider.current) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (slider.current) {
|
|
99
|
+
setIndex(target);
|
|
100
|
+
slider.current.slickGoTo(target);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const onDisableNavigation = () => {
|
|
105
|
+
if (!isDragging.current) setNavigationDisabled(true);
|
|
106
|
+
};
|
|
107
|
+
const onEnableNavigation = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
isDragging.current = false;
|
|
110
|
+
setNavigationDisabled(false);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const onToggleLightbox = useCallback(() => setLightbox(!lightbox), [lightbox]);
|
|
114
|
+
|
|
115
|
+
const mediaLength = media?.length || 0;
|
|
116
|
+
const placeholder = useMemo(
|
|
117
|
+
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
118
|
+
[placeholderImage]
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
<Wrapper>
|
|
124
|
+
<Main>
|
|
125
|
+
<SliderWrapper onMouseDown={onMouseDown} onMouseMove={onMouseMove} onClick={onClick}>
|
|
126
|
+
<Slider
|
|
127
|
+
{...sliderSettings}
|
|
128
|
+
swipe={!navigationDisabled}
|
|
129
|
+
touchMove={!navigationDisabled}
|
|
130
|
+
swipeToSlide={!navigationDisabled}
|
|
131
|
+
ref={slider}
|
|
132
|
+
beforeChange={beforeChange}
|
|
133
|
+
>
|
|
134
|
+
{!!media?.length ? (
|
|
135
|
+
media.map((m, i) => (
|
|
136
|
+
<Item key={m.files[0].url || i}>
|
|
137
|
+
{m.type === 'image' && (
|
|
138
|
+
<Image
|
|
139
|
+
src={
|
|
140
|
+
m.files[0].formats.filter(notEmpty).find((x) => x.format === '1170x')?.url
|
|
141
|
+
}
|
|
142
|
+
alt={`Bild ${i + 1}`}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
145
|
+
{m.type === 'threesixty' && (
|
|
146
|
+
<ThreeSixty
|
|
147
|
+
urls={m.files.map((x) => x.url)}
|
|
148
|
+
visible={i === index}
|
|
149
|
+
onDisableNavigation={onDisableNavigation}
|
|
150
|
+
navigationDisabled={navigationDisabled}
|
|
151
|
+
/>
|
|
152
|
+
)}
|
|
153
|
+
{m.type === 'embedded' && <EmbededVideo src={m.files[0].url} index={i + 1} />}
|
|
154
|
+
{m.type === 'sphere' && (
|
|
155
|
+
<Sphere
|
|
156
|
+
visible={i === index}
|
|
157
|
+
url={m.files[0].url}
|
|
158
|
+
preview={m.files[0].url}
|
|
159
|
+
onDisableNavigation={onDisableNavigation}
|
|
160
|
+
navigationDisabled={navigationDisabled}
|
|
161
|
+
/>
|
|
162
|
+
)}
|
|
163
|
+
</Item>
|
|
164
|
+
))
|
|
165
|
+
) : (
|
|
166
|
+
<Item key={placeholder}>
|
|
167
|
+
<Image src={placeholder} alt={`Bild 1`} />
|
|
168
|
+
</Item>
|
|
169
|
+
)}
|
|
170
|
+
</Slider>
|
|
171
|
+
{navigationDisabled && mediaLength > 1 && (
|
|
172
|
+
<EnableNavigationButton>
|
|
173
|
+
<ButtonSecondary onClick={onEnableNavigation} title="Stäng">
|
|
174
|
+
<ButtonContent>Stäng</ButtonContent>
|
|
175
|
+
</ButtonSecondary>
|
|
176
|
+
</EnableNavigationButton>
|
|
177
|
+
)}
|
|
178
|
+
</SliderWrapper>
|
|
179
|
+
{!navigationDisabled && mediaLength > 1 && (
|
|
180
|
+
<>
|
|
181
|
+
<ArrowLeft onClick={prevImage} title="Föregående bild">
|
|
182
|
+
<IconChevronLeft block />
|
|
183
|
+
</ArrowLeft>
|
|
184
|
+
<ArrowRight onClick={nextImage} title="Nästa bild">
|
|
185
|
+
<IconChevronRight block />
|
|
186
|
+
</ArrowRight>
|
|
187
|
+
</>
|
|
188
|
+
)}
|
|
189
|
+
</Main>
|
|
190
|
+
<Alt>
|
|
191
|
+
<QuickNav ref={quickNavRef}>
|
|
192
|
+
{!!media?.length ? (
|
|
193
|
+
media.map((m, i) => {
|
|
194
|
+
const src =
|
|
195
|
+
m.files[0].formats.filter(notEmpty).find((x) => x.format === '225x150')?.url ||
|
|
196
|
+
m.files[0].url;
|
|
197
|
+
return (
|
|
198
|
+
<QuickNavItem key={src || i} active={index === i}>
|
|
199
|
+
<QuickNavBtn onClick={() => goTo(i)} title={`Gå till bild ${i + 1}`}>
|
|
200
|
+
{m.type === 'image' && <QuickNavImg src={src} alt={`Bild ${i + 1}`} />}
|
|
201
|
+
{m.type === 'threesixty' && <QuickNavImg src={src} alt={`Bild ${i + 1}`} />}
|
|
202
|
+
{m.type === 'embedded' && <QuickNavEmbeded src={src} index={i} />}
|
|
203
|
+
{m.type === 'sphere' && (
|
|
204
|
+
<QuickNavImg src={m.files[0].url} alt={`Bild ${i + 1}`} />
|
|
205
|
+
)}
|
|
206
|
+
</QuickNavBtn>
|
|
207
|
+
</QuickNavItem>
|
|
208
|
+
);
|
|
209
|
+
})
|
|
210
|
+
) : (
|
|
211
|
+
<QuickNavItem key={placeholder} active>
|
|
212
|
+
<QuickNavBtn onClick={() => goTo(0)} title={`Gå till bild 0`}>
|
|
213
|
+
<QuickNavImg src={placeholder} alt={`Bild 1`} />
|
|
214
|
+
</QuickNavBtn>
|
|
215
|
+
</QuickNavItem>
|
|
216
|
+
)}
|
|
217
|
+
</QuickNav>
|
|
218
|
+
</Alt>
|
|
219
|
+
</Wrapper>
|
|
220
|
+
{lightbox && !!media?.length && (
|
|
221
|
+
<Lightbox media={media} index={index} onClose={onToggleLightbox} />
|
|
222
|
+
)}
|
|
223
|
+
</>
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export default Gallery;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
2
3
|
import { size } from '../../layout/helpers';
|
|
3
4
|
import { ButtonReset } from '../Button/index';
|
|
4
5
|
import { Wrapper as Container } from '../Container/wrapper';
|
|
6
|
+
|
|
5
7
|
const quickNavWidth = 83; // 75px + 8px
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
export const Wrapper = styled.div`
|
|
7
10
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
8
11
|
${Container} & {
|
|
9
12
|
margin-left: ${size(-3)};
|
|
@@ -23,7 +26,8 @@ export const Wrapper = styled.div `
|
|
|
23
26
|
padding-right: ${quickNavWidth}px;
|
|
24
27
|
}
|
|
25
28
|
`;
|
|
26
|
-
|
|
29
|
+
|
|
30
|
+
export const Main = styled.div`
|
|
27
31
|
position: relative;
|
|
28
32
|
height: 0;
|
|
29
33
|
padding-bottom: 66.66666667%;
|
|
@@ -48,7 +52,8 @@ export const Main = styled.div `
|
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
`;
|
|
51
|
-
|
|
55
|
+
|
|
56
|
+
export const Alt = styled.div`
|
|
52
57
|
position: absolute;
|
|
53
58
|
top: 0;
|
|
54
59
|
bottom: 0;
|
|
@@ -71,7 +76,8 @@ export const Alt = styled.div `
|
|
|
71
76
|
pointer-events: none;
|
|
72
77
|
}
|
|
73
78
|
`;
|
|
74
|
-
|
|
79
|
+
|
|
80
|
+
export const Item = styled.div`
|
|
75
81
|
position: relative;
|
|
76
82
|
width: 100%;
|
|
77
83
|
height: 100%;
|
|
@@ -86,7 +92,8 @@ export const Item = styled.div `
|
|
|
86
92
|
transition: border-radius 150ms ease;
|
|
87
93
|
}
|
|
88
94
|
`;
|
|
89
|
-
|
|
95
|
+
|
|
96
|
+
export const SliderWrapper = styled.div`
|
|
90
97
|
position: absolute;
|
|
91
98
|
top: 0;
|
|
92
99
|
bottom: 0;
|
|
@@ -126,7 +133,8 @@ export const SliderWrapper = styled.div `
|
|
|
126
133
|
}
|
|
127
134
|
}
|
|
128
135
|
`;
|
|
129
|
-
|
|
136
|
+
|
|
137
|
+
export const Image = styled.img`
|
|
130
138
|
display: block;
|
|
131
139
|
position: absolute;
|
|
132
140
|
left: 0;
|
|
@@ -139,7 +147,8 @@ export const Image = styled.img `
|
|
|
139
147
|
object-fit: cover;
|
|
140
148
|
cursor: pointer;
|
|
141
149
|
`;
|
|
142
|
-
|
|
150
|
+
|
|
151
|
+
export const ImageFull = styled.img`
|
|
143
152
|
display: block;
|
|
144
153
|
position: absolute;
|
|
145
154
|
top: 0;
|
|
@@ -148,8 +157,10 @@ export const ImageFull = styled.img `
|
|
|
148
157
|
height: 100%;
|
|
149
158
|
object-fit: cover;
|
|
150
159
|
`;
|
|
160
|
+
|
|
151
161
|
// Arrow Nav
|
|
152
|
-
|
|
162
|
+
|
|
163
|
+
const Arrow = styled(ButtonReset)`
|
|
153
164
|
position: absolute;
|
|
154
165
|
top: 50%;
|
|
155
166
|
transform: translateY(-50%);
|
|
@@ -195,14 +206,18 @@ const Arrow = styled(ButtonReset) `
|
|
|
195
206
|
display: none;
|
|
196
207
|
}
|
|
197
208
|
`;
|
|
198
|
-
|
|
209
|
+
|
|
210
|
+
export const ArrowLeft = styled(Arrow)`
|
|
199
211
|
left: ${size(2)};
|
|
200
212
|
`;
|
|
201
|
-
|
|
213
|
+
|
|
214
|
+
export const ArrowRight = styled(Arrow)`
|
|
202
215
|
right: ${size(2)};
|
|
203
216
|
`;
|
|
217
|
+
|
|
204
218
|
// Quick Nav
|
|
205
|
-
|
|
219
|
+
|
|
220
|
+
export const QuickNav = styled.ul`
|
|
206
221
|
position: relative;
|
|
207
222
|
max-height: 100%;
|
|
208
223
|
list-style: none;
|
|
@@ -211,17 +226,26 @@ export const QuickNav = styled.ul `
|
|
|
211
226
|
overflow: auto;
|
|
212
227
|
-webkit-overflow-scrolling: touch;
|
|
213
228
|
`;
|
|
229
|
+
|
|
230
|
+
type QuickNavItemProps = React.DetailedHTMLProps<
|
|
231
|
+
React.HTMLAttributes<HTMLLIElement>,
|
|
232
|
+
HTMLLIElement
|
|
233
|
+
> & {
|
|
234
|
+
active?: boolean;
|
|
235
|
+
};
|
|
236
|
+
|
|
214
237
|
export const QuickNavItem = styled.li.attrs(() => ({
|
|
215
|
-
|
|
216
|
-
}))
|
|
238
|
+
className: 'wayke__theme wayke__color--primary-text',
|
|
239
|
+
}))<QuickNavItemProps>`
|
|
217
240
|
position: relative;
|
|
218
241
|
|
|
219
242
|
& + & {
|
|
220
243
|
margin-top: ${size(1)};
|
|
221
244
|
}
|
|
222
245
|
|
|
223
|
-
${({ active }) =>
|
|
224
|
-
|
|
246
|
+
${({ active }) =>
|
|
247
|
+
active &&
|
|
248
|
+
css`
|
|
225
249
|
:before {
|
|
226
250
|
content: '';
|
|
227
251
|
position: absolute;
|
|
@@ -234,7 +258,8 @@ export const QuickNavItem = styled.li.attrs(() => ({
|
|
|
234
258
|
}
|
|
235
259
|
`}
|
|
236
260
|
`;
|
|
237
|
-
|
|
261
|
+
|
|
262
|
+
export const QuickNavBtn = styled(ButtonReset)`
|
|
238
263
|
position: relative;
|
|
239
264
|
display: block;
|
|
240
265
|
width: 100%;
|
|
@@ -266,7 +291,8 @@ export const QuickNavBtn = styled(ButtonReset) `
|
|
|
266
291
|
transform: scale(0.95);
|
|
267
292
|
}
|
|
268
293
|
`;
|
|
269
|
-
|
|
294
|
+
|
|
295
|
+
export const QuickNavImg = styled.img`
|
|
270
296
|
display: block;
|
|
271
297
|
position: absolute;
|
|
272
298
|
top: 0;
|
|
@@ -275,16 +301,20 @@ export const QuickNavImg = styled.img `
|
|
|
275
301
|
height: 100%;
|
|
276
302
|
object-fit: cover;
|
|
277
303
|
`;
|
|
304
|
+
|
|
278
305
|
// Media Button
|
|
279
|
-
|
|
306
|
+
|
|
307
|
+
export const MediaButtonWrapper = styled.div`
|
|
280
308
|
position: absolute;
|
|
281
309
|
bottom: ${size(2)};
|
|
282
310
|
left: 50%;
|
|
283
311
|
transform: translateX(-50%);
|
|
284
312
|
z-index: 1;
|
|
285
313
|
`;
|
|
314
|
+
|
|
286
315
|
// Sphere Close Button
|
|
287
|
-
|
|
316
|
+
|
|
317
|
+
export const EnableNavigationButton = styled.div`
|
|
288
318
|
position: absolute;
|
|
289
319
|
bottom: ${size(2)};
|
|
290
320
|
left: 50%;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Wrapper, List, Item } from './wrapper';
|
|
4
|
+
import ProductCard from '../ProductCard/index';
|
|
5
|
+
import { Document } from '../../@types/search';
|
|
6
|
+
import { numberSeparator } from '../../utils/formats';
|
|
7
|
+
|
|
8
|
+
const resolveImage = (document: Document) => {
|
|
9
|
+
const img = document.featuredImage?.files?.[0]?.url;
|
|
10
|
+
if (img) {
|
|
11
|
+
return `${img}?w=567&q=72`;
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
interface GridProps {
|
|
17
|
+
documents?: Document[];
|
|
18
|
+
hashRoute?: boolean;
|
|
19
|
+
pathRoute?: string;
|
|
20
|
+
placeholderImage?: string;
|
|
21
|
+
onClickItem?: (id: string) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }: GridProps) => {
|
|
25
|
+
if (!documents) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Wrapper>
|
|
31
|
+
<List>
|
|
32
|
+
{documents.map((document) => {
|
|
33
|
+
const _path = pathRoute?.replace(/^\/|\/$/g, '');
|
|
34
|
+
|
|
35
|
+
const prefix = _path ? `/${_path}/` : '/';
|
|
36
|
+
|
|
37
|
+
const pathRouteUrl =
|
|
38
|
+
window.location.pathname === '/'
|
|
39
|
+
? `${prefix}${document._id}`
|
|
40
|
+
: `${window.location.pathname}${prefix}${document._id}`;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Item key={document._id}>
|
|
44
|
+
<ProductCard
|
|
45
|
+
id={document._id}
|
|
46
|
+
onClick={onClickItem}
|
|
47
|
+
title={document.title}
|
|
48
|
+
pathRoute={pathRoute}
|
|
49
|
+
href={pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined}
|
|
50
|
+
image={resolveImage(document)}
|
|
51
|
+
placeholderImage={placeholderImage}
|
|
52
|
+
description={document.shortDescription}
|
|
53
|
+
uspList={[
|
|
54
|
+
{
|
|
55
|
+
title: document.modelYear,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: `${numberSeparator(document.mileage)} mil`,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
title: document.gearboxType,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: document.fuelType,
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
price={`${numberSeparator(document.price)} kr`}
|
|
68
|
+
leasingPrice={
|
|
69
|
+
document.leasingPrice !== undefined
|
|
70
|
+
? `${numberSeparator(document.leasingPrice)} kr`
|
|
71
|
+
: undefined
|
|
72
|
+
}
|
|
73
|
+
oldPrice={
|
|
74
|
+
document.oldPrice !== undefined && document.price < document.oldPrice
|
|
75
|
+
? `${numberSeparator(document.oldPrice)} kr`
|
|
76
|
+
: undefined
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
</Item>
|
|
80
|
+
);
|
|
81
|
+
})}
|
|
82
|
+
</List>
|
|
83
|
+
</Wrapper>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default Grid;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
+
|
|
2
3
|
import { size } from '../../layout/helpers';
|
|
3
|
-
|
|
4
|
-
export const
|
|
4
|
+
|
|
5
|
+
export const Wrapper = styled.div``;
|
|
6
|
+
|
|
7
|
+
export const List = styled.ul`
|
|
5
8
|
display: flex;
|
|
6
9
|
flex-wrap: wrap;
|
|
7
10
|
list-style: none;
|
|
8
11
|
padding: 0;
|
|
9
12
|
margin: ${size(-2)} ${size(-1)};
|
|
10
13
|
`;
|
|
11
|
-
|
|
14
|
+
|
|
15
|
+
export const Item = styled.li`
|
|
12
16
|
flex: 1 1 auto;
|
|
13
17
|
width: 100%;
|
|
14
18
|
max-width: 100%;
|