@wayke-se/components-react 3.5.0 → 3.5.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 +5 -1
- package/dist-node/index.js +72 -23
- package/dist-node/index.js.map +1 -1
- package/dist-src/State/RelatedSearch/useRelatedSearch.js +4 -1
- package/dist-src/components/ActionList/toggle-item.js +1 -4
- package/dist-src/components/FinancialOptions/index.js +1 -1
- package/dist-src/components/FinancialOptions/leasing.js +7 -6
- package/dist-src/components/Grid/index.js +2 -2
- package/dist-src/components/ProductCard/index.js +3 -2
- package/dist-src/components/ProductCard/wrapper.js +6 -1
- package/dist-src/layouts/WaykeComposite.js +2 -2
- package/dist-src/layouts/search/index.js +2 -2
- package/dist-src/layouts/searchItem/Branch.js +6 -4
- package/dist-src/layouts/searchItem/Related.js +3 -3
- package/dist-src/layouts/searchItem/index.js +3 -9
- package/dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js +1 -0
- package/dist-src/utils/sortOptions.js +6 -0
- package/dist-src/utils/vehicle-properties/property-hint-enricher.js +2 -0
- package/dist-types/@types/codegen/types.d.ts +46 -41
- package/dist-types/@types/filter.d.ts +2 -2
- package/dist-types/State/Path/reducer.d.ts +2 -2
- package/dist-types/State/RelatedSearch/useRelatedSearch.d.ts +1 -1
- package/dist-types/components/Content/index.d.ts +1 -1
- package/dist-types/components/Grid/index.d.ts +2 -1
- package/dist-types/components/Icon/index.d.ts +2 -2
- package/dist-types/components/InputCheckbox/index.d.ts +1 -1
- package/dist-types/components/InputSearch/index.d.ts +2 -2
- package/dist-types/components/InputText/index.d.ts +1 -1
- package/dist-types/components/ProductCard/index.d.ts +2 -1
- package/dist-types/components/ProductCard/wrapper.d.ts +1 -0
- package/dist-types/components/Sphere/Sphere.d.ts +1 -1
- package/dist-types/components/Sphere/SphereLightbox.d.ts +1 -1
- package/dist-types/components/Sphere/SphereViewer.d.ts +1 -1
- package/dist-types/components/ThreeSixty/Rotation.d.ts +1 -1
- package/dist-types/components/ThreeSixty/ThreeSixtLightbox.d.ts +1 -1
- package/dist-types/components/ThreeSixty/ThreeSixty.d.ts +1 -1
- package/dist-types/components/Video/CustomPlayer.d.ts +1 -1
- package/dist-types/components/Video/EmbeddedVideoLightbox.d.ts +1 -1
- package/dist-types/components/Video/VimeoPlayer.d.ts +1 -1
- package/dist-types/components/Video/YoutubePlayer.d.ts +1 -1
- package/dist-types/layout/theme.d.ts +1 -1
- package/dist-types/layouts/WaykeComposite.d.ts +2 -2
- package/dist-types/layouts/search/index.d.ts +2 -1
- package/dist-types/layouts/searchItem/Branch.d.ts +2 -1
- package/dist-types/layouts/searchItem/Related.d.ts +3 -1
- package/dist-types/layouts/searchItem/index.d.ts +2 -1
- package/dist-types/providers/WaykeItemProvidet.d.ts +1 -1
- package/dist-types/providers/WaykeProvider.d.ts +1 -1
- package/dist-types/utils/pubsub/Actions.d.ts +5 -5
- package/dist-types/utils/pubsub/Events.d.ts +7 -7
- package/dist-types/utils/pubsub/pubsub.d.ts +2 -2
- package/dist-types/utils/sortOptions.d.ts +3 -1
- package/dist-types/utils/specification.d.ts +1 -1
- package/dist-web/index.js +48 -31
- package/dist-web/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useEffect } from 'react';
|
|
2
2
|
import { RelatedSearchContext } from './RelatedSearchContext';
|
|
3
|
-
const useRelatedSearch = (id) => {
|
|
3
|
+
const useRelatedSearch = (id, authorizedReseller) => {
|
|
4
4
|
const data = useContext(RelatedSearchContext);
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
const searchParams = new URLSearchParams();
|
|
@@ -8,6 +8,9 @@ const useRelatedSearch = (id) => {
|
|
|
8
8
|
if (data.moreLikeThisUrl && id) {
|
|
9
9
|
searchParams.set('id', id);
|
|
10
10
|
}
|
|
11
|
+
if (authorizedReseller) {
|
|
12
|
+
searchParams.set('isAuthorizedResellerForManufacturer', 'true');
|
|
13
|
+
}
|
|
11
14
|
data.fetchRelated(searchParams);
|
|
12
15
|
}, [id]);
|
|
13
16
|
return data;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
2
|
import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
3
3
|
import { RepeatTiny } from '../Repeat/index';
|
|
4
|
-
const initialValue = {};
|
|
5
|
-
const getInitialValue = (title) => title && !!initialValue[title];
|
|
6
4
|
const ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
7
|
-
const [visible, setVisible] = useState(
|
|
5
|
+
const [visible, setVisible] = useState(false);
|
|
8
6
|
const _onClickValue = useCallback(() => {
|
|
9
7
|
if (onClickValue) {
|
|
10
8
|
onClickValue();
|
|
@@ -12,7 +10,6 @@ const ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
|
12
10
|
}, []);
|
|
13
11
|
const onClick = useCallback(() => {
|
|
14
12
|
if (!visible) {
|
|
15
|
-
initialValue[type] = true;
|
|
16
13
|
setVisible(true);
|
|
17
14
|
if (onClickVisible) {
|
|
18
15
|
onClickVisible();
|
|
@@ -7,6 +7,6 @@ const FinancialOptions = ({ id, financialOptions }) => (React.createElement(Repe
|
|
|
7
7
|
React.createElement(RepeatTiny, null,
|
|
8
8
|
React.createElement(VisualHeading, null, "Andra finansieringsalternativ")),
|
|
9
9
|
React.createElement(RepeatTiny, null, financialOptions.map((financialOption, index) => (React.createElement(Fragment, { key: index },
|
|
10
|
-
financialOption.type === 'leasing' && React.createElement(Leasing, { financialOption: financialOption }),
|
|
10
|
+
(financialOption.type === 'leasing' || financialOption.type === 'business-leasing') && (React.createElement(Leasing, { financialOption: financialOption })),
|
|
11
11
|
financialOption.type === 'loan' && React.createElement(Loan, { id: id, financialOption: financialOption })))))));
|
|
12
12
|
export default FinancialOptions;
|
|
@@ -11,10 +11,11 @@ import DataList from '../DataList/index';
|
|
|
11
11
|
const Leasing = ({ financialOption }) => {
|
|
12
12
|
const [modal, setModal] = useState(false);
|
|
13
13
|
const toggleModal = useCallback(() => setModal(!modal), [modal]);
|
|
14
|
-
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
14
|
+
const { image, description, monthlyCost, duration, mileage, type, name } = financialOption;
|
|
15
|
+
const title = type === 'leasing' ? 'Privatleasa' : type === 'business-leasing' ? 'Företagsleasa' : type;
|
|
15
16
|
return (React.createElement(React.Fragment, null,
|
|
16
|
-
modal && (React.createElement(Modal, { title:
|
|
17
|
-
image && React.createElement(Image, { src: image, alt:
|
|
17
|
+
modal && (React.createElement(Modal, { title: title, onClose: toggleModal },
|
|
18
|
+
image && React.createElement(Image, { src: image, alt: title }),
|
|
18
19
|
description && React.createElement(Content, { dangerouslySetInnerHTML: { __html: description } }),
|
|
19
20
|
React.createElement(ModalFoldout, null,
|
|
20
21
|
React.createElement(ModalFoldoutBody, null,
|
|
@@ -36,7 +37,7 @@ const Leasing = ({ financialOption }) => {
|
|
|
36
37
|
React.createElement(React.Fragment, null, monthlyCost !== null && monthlyCost !== undefined && (React.createElement(OptionBoxHeading, null, `ca ${numberSeparator(monthlyCost)} kr/mån`))),
|
|
37
38
|
React.createElement(OptionBoxContent, null,
|
|
38
39
|
React.createElement("p", null,
|
|
39
|
-
|
|
40
|
+
title,
|
|
40
41
|
' ',
|
|
41
42
|
mileage?.current && duration?.current && (React.createElement(React.Fragment, null,
|
|
42
43
|
React.createElement(UtilityTextPrimary, null,
|
|
@@ -49,7 +50,7 @@ const Leasing = ({ financialOption }) => {
|
|
|
49
50
|
" m\u00E5n"),
|
|
50
51
|
".",
|
|
51
52
|
' '))),
|
|
52
|
-
React.createElement("p", null,
|
|
53
|
-
React.createElement(ButtonInline, { onClick: toggleModal }, "L\u00E4s mer"))))));
|
|
53
|
+
name && (React.createElement("p", null,
|
|
54
|
+
React.createElement(ButtonInline, { onClick: toggleModal }, "L\u00E4s mer")))))));
|
|
54
55
|
};
|
|
55
56
|
export default Leasing;
|
|
@@ -9,7 +9,7 @@ const resolveImage = (document) => {
|
|
|
9
9
|
}
|
|
10
10
|
return undefined;
|
|
11
11
|
};
|
|
12
|
-
const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }) => {
|
|
12
|
+
const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, displayBranchName, onClickItem, }) => {
|
|
13
13
|
if (!documents) {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
@@ -36,7 +36,7 @@ const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }
|
|
|
36
36
|
*/
|
|
37
37
|
const _pathRoute = pathRoute ? `${pathRoute}/${document._id}` : undefined;
|
|
38
38
|
return (React.createElement(Item, { key: document._id },
|
|
39
|
-
React.createElement(ProductCard, { id: document._id, onClick: onClickItem, title: document.title, pathRoute: pathRoute, href: _pathRoute ? _pathRoute : hashRoute ? `#${document._id}` : undefined, image: resolveImage(document), placeholderImage: placeholderImage, description: document.shortDescription, uspList: [
|
|
39
|
+
React.createElement(ProductCard, { id: document._id, onClick: onClickItem, title: document.title, pathRoute: pathRoute, href: _pathRoute ? _pathRoute : hashRoute ? `#${document._id}` : undefined, image: resolveImage(document), placeholderImage: placeholderImage, description: document.shortDescription, branchName: displayBranchName ? document.branches?.[0]?.name : undefined, uspList: [
|
|
40
40
|
{
|
|
41
41
|
title: document.modelYear,
|
|
42
42
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import LazyLoad from 'react-lazyload';
|
|
3
|
-
import { Wrapper, Image, Picture, Source, Img, Content, ContentBody, ContentFooter, Heading, Link, Description, Usp, Price, CurrentPrice, OldPrice, PriceCell, Label, } from './wrapper';
|
|
3
|
+
import { Wrapper, Image, Picture, Source, Img, Content, ContentBody, ContentFooter, Heading, Link, Description, Usp, Price, CurrentPrice, OldPrice, PriceCell, Label, PreHeading, } from './wrapper';
|
|
4
4
|
import UspList from '../UspList/index';
|
|
5
5
|
import { DEFAULT_PLACEHOLDER_IMAGE } from '../../utils/constants';
|
|
6
6
|
import usePath from '../../State/Path/usePath';
|
|
7
|
-
const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, description, uspList, price, oldPrice, leasingPrice, businessLeasingPrice, onClick, }) => {
|
|
7
|
+
const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, branchName, description, uspList, price, oldPrice, leasingPrice, businessLeasingPrice, onClick, }) => {
|
|
8
8
|
const { pushState } = usePath();
|
|
9
9
|
const _onClick = useMemo(() => (onClick ? () => onClick(id) : undefined), [id]);
|
|
10
10
|
const onHrefClick = useCallback((e) => {
|
|
@@ -25,6 +25,7 @@ const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, desc
|
|
|
25
25
|
React.createElement(Img, { src: placeholderImage || DEFAULT_PLACEHOLDER_IMAGE }))))),
|
|
26
26
|
React.createElement(Content, null,
|
|
27
27
|
React.createElement(ContentBody, null,
|
|
28
|
+
branchName && React.createElement(PreHeading, null, branchName),
|
|
28
29
|
React.createElement(Heading, null, href ? (React.createElement(Link, { onClick: onHrefClick, href: href, title: title, "aria-label": title }, title)) : (title)),
|
|
29
30
|
description && React.createElement(Description, null, description),
|
|
30
31
|
uspList && (React.createElement(Usp, null,
|
|
@@ -61,6 +61,11 @@ export const ContentFooter = styled.div `
|
|
|
61
61
|
margin-top: auto;
|
|
62
62
|
padding-top: ${size(1)};
|
|
63
63
|
`;
|
|
64
|
+
export const PreHeading = styled.div `
|
|
65
|
+
margin-bottom: ${size(0.25)};
|
|
66
|
+
color: ${(props) => props.theme.color.textDarkLighten};
|
|
67
|
+
font-size: 0.75rem;
|
|
68
|
+
`;
|
|
64
69
|
export const Heading = styled.h1.attrs(() => ({
|
|
65
70
|
className: 'wayke__theme wayke__font--bold',
|
|
66
71
|
})) `
|
|
@@ -125,5 +130,5 @@ export const OldPrice = styled.div `
|
|
|
125
130
|
`;
|
|
126
131
|
export const Label = styled.label `
|
|
127
132
|
color: ${(props) => props.theme.color.disabledText};
|
|
128
|
-
font-size: 0.
|
|
133
|
+
font-size: 0.75rem;
|
|
129
134
|
`;
|
|
@@ -4,7 +4,7 @@ import PubSub from '../utils/pubsub/pubsub';
|
|
|
4
4
|
import WaykeSearch from './search/index';
|
|
5
5
|
import WaykeSearchItem from './searchItem/index';
|
|
6
6
|
import usePath from '../State/Path/usePath';
|
|
7
|
-
const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, }) => {
|
|
7
|
+
const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, displayBranchName, }) => {
|
|
8
8
|
const hashId = useHashGuid();
|
|
9
9
|
const { id: pathId } = usePath();
|
|
10
10
|
useEffect(() => {
|
|
@@ -18,6 +18,6 @@ const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, remov
|
|
|
18
18
|
}
|
|
19
19
|
}, [hashId]);
|
|
20
20
|
const id = pathId || hashId;
|
|
21
|
-
return (React.createElement(React.Fragment, null, id ? (React.createElement(WaykeSearchItem, { id: id, hashRoute: !pathRoute, disableResetScrollOnInit: disableResetScrollOnInit, placeholderImage: placeholderImage, pathRoute: pathRoute, modifyDocumentTitleItem: modifyDocumentTitleItem })) : (React.createElement(WaykeSearch, { filterList: filterList, initialQueryParams: initialQueryParams, removeSearchBar: removeSearchBar, hashRoute: !pathRoute, placeholderImage: placeholderImage, pathRoute: pathRoute, removeFilterOptions: removeFilterOptions, modifyDocumentTitleSearch: modifyDocumentTitleSearch }))));
|
|
21
|
+
return (React.createElement(React.Fragment, null, id ? (React.createElement(WaykeSearchItem, { id: id, hashRoute: !pathRoute, disableResetScrollOnInit: disableResetScrollOnInit, placeholderImage: placeholderImage, pathRoute: pathRoute, modifyDocumentTitleItem: modifyDocumentTitleItem, displayBranchName: displayBranchName })) : (React.createElement(WaykeSearch, { filterList: filterList, initialQueryParams: initialQueryParams, removeSearchBar: removeSearchBar, hashRoute: !pathRoute, placeholderImage: placeholderImage, pathRoute: pathRoute, removeFilterOptions: removeFilterOptions, modifyDocumentTitleSearch: modifyDocumentTitleSearch, displayBranchName: displayBranchName }))));
|
|
22
22
|
};
|
|
23
23
|
export default WaykeComposite;
|
|
@@ -10,7 +10,7 @@ import SearchFilter from '../../components/SearchFilter/index';
|
|
|
10
10
|
import Snackbar from '../../components/Snackbar/index';
|
|
11
11
|
import useSearch from '../../State/Search/useSearch';
|
|
12
12
|
import PubSub from '../../utils/pubsub/pubsub';
|
|
13
|
-
const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, onClickSearchItem, }) => {
|
|
13
|
+
const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, displayBranchName, onClickSearchItem, }) => {
|
|
14
14
|
const { error, documents, queryFilter, onFilterUpdate, onInitialize } = useSearch();
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
if (modifyDocumentTitleSearch) {
|
|
@@ -48,7 +48,7 @@ const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, rem
|
|
|
48
48
|
React.createElement(Result, null,
|
|
49
49
|
React.createElement(React.Fragment, null,
|
|
50
50
|
error && (React.createElement(Snackbar, { severity: "error", icon: true, heading: "Ett fel har intr\u00E4ffat" }, "V\u00E4nligen f\u00F6rs\u00F6k igen.")),
|
|
51
|
-
!error && documents && documents.length > 0 && (React.createElement(Grid, { hashRoute: hashRoute, pathRoute: pathRoute, onClickItem: onItemClicked, documents: documents, placeholderImage: placeholderImage })),
|
|
51
|
+
!error && documents && documents.length > 0 && (React.createElement(Grid, { hashRoute: hashRoute, pathRoute: pathRoute, onClickItem: onItemClicked, documents: documents, placeholderImage: placeholderImage, displayBranchName: displayBranchName })),
|
|
52
52
|
!error && documents && documents.length === 0 && (React.createElement(Snackbar, { severity: "warning", icon: true, heading: "Inga resultat" }, "Det finns inga resultat som matchar din s\u00F6kning."))))))),
|
|
53
53
|
React.createElement(PortalElement, { id: PortalNamespace.DefaultPortal })));
|
|
54
54
|
};
|
|
@@ -10,7 +10,7 @@ import PhoneNumber from '../../components/PhoneNumber/index';
|
|
|
10
10
|
import Map from '../../components/Map/index';
|
|
11
11
|
import BranchModal from './BranchModal';
|
|
12
12
|
import { formatPhonenumber } from '../../utils/phonenumbers';
|
|
13
|
-
const Branch = ({ branch, loading }) => {
|
|
13
|
+
const Branch = ({ branch, loading, displayBranchName }) => {
|
|
14
14
|
const [modal, setModal] = useState(false);
|
|
15
15
|
const openModal = useCallback(() => setModal(true), []);
|
|
16
16
|
const closeModal = useCallback(() => setModal(false), []);
|
|
@@ -25,9 +25,11 @@ const Branch = ({ branch, loading }) => {
|
|
|
25
25
|
return (React.createElement(React.Fragment, null,
|
|
26
26
|
modal && (React.createElement(BranchModal, { loading: loading, connections: branch?.connections, onClose: closeModal })),
|
|
27
27
|
React.createElement(Repeat, null,
|
|
28
|
-
React.createElement(H2, { noMargin: true },
|
|
29
|
-
? `Den här bilen finns på
|
|
30
|
-
:
|
|
28
|
+
React.createElement(H2, { noMargin: true }, displayBranchName
|
|
29
|
+
? `Den här bilen finns på ${branch.name}`
|
|
30
|
+
: branch?.location?.city
|
|
31
|
+
? `Den här bilen finns på vår anläggning i ${branch?.location?.city}`
|
|
32
|
+
: 'Kontakt')),
|
|
31
33
|
React.createElement(Repeat, null,
|
|
32
34
|
React.createElement(Map, { position: branch?.location?.position })),
|
|
33
35
|
(branch?.connections?.length || 0) > 1 && (React.createElement(Repeat, null,
|
|
@@ -11,8 +11,8 @@ import Loader from '../../components/Loader/index';
|
|
|
11
11
|
import { numberSeparator } from '../../utils/formats';
|
|
12
12
|
import PubSub from '../../utils/pubsub/pubsub';
|
|
13
13
|
import { regexPathGuid } from '../../utils/regex';
|
|
14
|
-
const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
15
|
-
const { loading, response, moreLikeThisUrl } = useRelatedSearch(id);
|
|
14
|
+
const Related = ({ id, hashRoute, pathRoute, authorizedReseller, displayBranchName, onClickSearchItem, }) => {
|
|
15
|
+
const { loading, response, moreLikeThisUrl } = useRelatedSearch(id, !!authorizedReseller);
|
|
16
16
|
const onItemClicked = useCallback((id) => {
|
|
17
17
|
PubSub.publish('ItemClicked', id);
|
|
18
18
|
if (onClickSearchItem) {
|
|
@@ -43,7 +43,7 @@ const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
43
43
|
? window.location.pathname.replace(r, document._id)
|
|
44
44
|
: `${window.location.pathname}${prefix}${document._id}`;
|
|
45
45
|
return (React.createElement(OverflowGridItem, { key: document._id },
|
|
46
|
-
React.createElement(ProductCard, { id: document._id, onClick: onItemClicked, title: document.title, href: pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined, image: document.featuredImage?.files?.[0]?.url, description: document.shortDescription, uspList: [
|
|
46
|
+
React.createElement(ProductCard, { id: document._id, onClick: onItemClicked, title: document.title, href: pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined, image: document.featuredImage?.files?.[0]?.url, description: document.shortDescription, branchName: displayBranchName ? document.branches?.[0]?.name : undefined, uspList: [
|
|
47
47
|
{
|
|
48
48
|
title: document.modelYear,
|
|
49
49
|
},
|
|
@@ -18,7 +18,6 @@ import { IconChevronLeft } from '../../components/Icon/index';
|
|
|
18
18
|
import useSearchItem from '../../hooks/useSearchItem';
|
|
19
19
|
import { notEmpty, numberSeparator, dateTimeFormat } from '../../utils/formats';
|
|
20
20
|
import { PortalNamespace, PortalElement } from '../../components/Portal/index';
|
|
21
|
-
import Modal from '../../components/Modal/index';
|
|
22
21
|
import FinancialOptions from '../../components/FinancialOptions/index';
|
|
23
22
|
import InsuranceOptions from '../../components/InsuranceOptions/index';
|
|
24
23
|
import ManufacturerPackageOption from './ManufacturerPackagesOption';
|
|
@@ -34,7 +33,7 @@ import Property from './Property';
|
|
|
34
33
|
import DemoCarModal from './DemoCarModal';
|
|
35
34
|
import useSettings from '../../State/Settings/useSettings';
|
|
36
35
|
import Documents from './Documents';
|
|
37
|
-
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }) => {
|
|
36
|
+
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, displayBranchName, onClickSearchItem, }) => {
|
|
38
37
|
const { ecomSettings } = useSettings();
|
|
39
38
|
const ecomContext = useRef();
|
|
40
39
|
const { loading, data: result } = useSearchItem(id);
|
|
@@ -167,17 +166,12 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
167
166
|
React.createElement(UspList, { items: options }))))),
|
|
168
167
|
React.createElement(Documents, { documents: documents }),
|
|
169
168
|
React.createElement(ProductPageMainSection, null,
|
|
170
|
-
React.createElement(Branch, { branch: branch, loading: loadingCentralStorageVehicle }),
|
|
169
|
+
React.createElement(Branch, { branch: branch, displayBranchName: displayBranchName, loading: loadingCentralStorageVehicle }),
|
|
171
170
|
ecommerce && ecommerce.enabled && (React.createElement(Repeat, null,
|
|
172
171
|
React.createElement(ButtonPrimary, { disabled: !!ecommerce.reserved, title: "K\u00F6p bilen online", onClick: () => ecomContext.current?.start() }, "K\u00F6p bilen online")))),
|
|
173
172
|
React.createElement(PackageOptions, { packageOptions: packageOptions }),
|
|
174
173
|
React.createElement(ManufacturerPackageOption, { packageOption: manufacturer?.packageOption }))))),
|
|
175
|
-
React.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, onClickSearchItem: onClickSearchItem })),
|
|
176
|
-
false && (React.createElement(Modal, { title: "Modal", onClose: () => { } },
|
|
177
|
-
React.createElement(Content, null,
|
|
178
|
-
React.createElement("p", null,
|
|
179
|
-
"Priset \u00E4r ett cirkapris och baserat p\u00E5 ditt avtals antal m\u00E5nader och din ber\u00E4knade \u00E5rliga k\u00F6rstr\u00E4cka. Kostnad f\u00F6r f\u00F6rs\u00E4kring och serviceavtal tillkommer. Kontakta s\u00E4ljare f\u00F6r komplett kostnadsf\u00F6rslag.",
|
|
180
|
-
' ')))),
|
|
174
|
+
React.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, authorizedReseller: !!branch?.flags?.authorizedReseller, displayBranchName: displayBranchName, onClickSearchItem: onClickSearchItem })),
|
|
181
175
|
React.createElement(PortalElement, { id: PortalNamespace.DefaultPortal }),
|
|
182
176
|
demoCarModal && React.createElement(DemoCarModal, { onClose: onToggleDemoCarModal })));
|
|
183
177
|
};
|
|
@@ -5,6 +5,8 @@ const SortOptionDisplayName = {
|
|
|
5
5
|
Pricedesc: 'price-desc',
|
|
6
6
|
ModelAsc: 'model-asc',
|
|
7
7
|
Modeldesc: 'model-desc',
|
|
8
|
+
MileageAsc: 'mileage-asc',
|
|
9
|
+
Mileagedesc: 'mileage-desc',
|
|
8
10
|
};
|
|
9
11
|
export const getTranslatedSortOptionDisplayName = (str) => {
|
|
10
12
|
switch (str) {
|
|
@@ -20,6 +22,10 @@ export const getTranslatedSortOptionDisplayName = (str) => {
|
|
|
20
22
|
return 'Årsmodell äldst';
|
|
21
23
|
case SortOptionDisplayName.Modeldesc:
|
|
22
24
|
return 'Årsmodell nyast';
|
|
25
|
+
case SortOptionDisplayName.MileageAsc:
|
|
26
|
+
return 'Miltal lägst';
|
|
27
|
+
case SortOptionDisplayName.Mileagedesc:
|
|
28
|
+
return 'Miltal högst';
|
|
23
29
|
default:
|
|
24
30
|
return str;
|
|
25
31
|
}
|
|
@@ -70,6 +70,8 @@ export const HINTS = Object.freeze({
|
|
|
70
70
|
finish: '',
|
|
71
71
|
fuelConsumptionCityDriving: 'Bränsleförbrukning vid stadskörning.',
|
|
72
72
|
fuelConsumptionCountryRoadDriving: 'Bränsleförbrukning vid landsvägskörning.',
|
|
73
|
+
fuelConsumptionMixedDrivingNEDC: 'Bränsleförbrukning vid blandad körning.',
|
|
74
|
+
fuelConsumptionMixedDrivingWLTP: 'Bränsleförbrukning vid blandad körning.',
|
|
73
75
|
fuelConsumptionMixedDriving: 'Bränsleförbrukning vid blandad körning. Dvs. stadskörning och landsvägskörning under en och samma färd.',
|
|
74
76
|
fuelType: 'Vad bilen ska tankas med och drivs av.',
|
|
75
77
|
gearboxName: '',
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type Maybe<T> = T | null;
|
|
2
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
+
export type Exact<T extends {
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
}> = {
|
|
6
6
|
[K in keyof T]: T[K];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
9
9
|
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
12
12
|
[SubKey in K]: Maybe<T[SubKey]>;
|
|
13
13
|
};
|
|
14
14
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
15
|
-
export
|
|
15
|
+
export type Scalars = {
|
|
16
16
|
ID: string;
|
|
17
17
|
String: string;
|
|
18
18
|
Boolean: boolean;
|
|
@@ -36,7 +36,7 @@ export declare type Scalars = {
|
|
|
36
36
|
};
|
|
37
37
|
VehicleDataPropertySet: any;
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type Branch = {
|
|
40
40
|
__typename?: 'Branch';
|
|
41
41
|
connections: Array<BranchConnection>;
|
|
42
42
|
contact?: Maybe<ContactOptions>;
|
|
@@ -52,19 +52,20 @@ export declare type Branch = {
|
|
|
52
52
|
promos: Array<Promo>;
|
|
53
53
|
services: Array<Service>;
|
|
54
54
|
};
|
|
55
|
-
export
|
|
55
|
+
export type BranchConnection = {
|
|
56
56
|
__typename?: 'BranchConnection';
|
|
57
57
|
id: Scalars['ID'];
|
|
58
58
|
location?: Maybe<Location>;
|
|
59
59
|
name?: Maybe<Scalars['String']>;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type BranchFlags = {
|
|
62
62
|
__typename?: 'BranchFlags';
|
|
63
|
+
authorizedReseller?: Maybe<Scalars['Boolean']>;
|
|
63
64
|
centralStorage?: Maybe<Scalars['Boolean']>;
|
|
64
65
|
ecommerce?: Maybe<Scalars['Boolean']>;
|
|
65
66
|
mrf?: Maybe<Scalars['Boolean']>;
|
|
66
67
|
};
|
|
67
|
-
export
|
|
68
|
+
export type ContactOptions = {
|
|
68
69
|
__typename?: 'ContactOptions';
|
|
69
70
|
avatar?: Maybe<Scalars['URL']>;
|
|
70
71
|
email?: Maybe<Scalars['Email']>;
|
|
@@ -78,14 +79,14 @@ export declare enum DrivingDistance {
|
|
|
78
79
|
Between2000And2500 = "BETWEEN2000AND2500",
|
|
79
80
|
Over2500 = "OVER2500"
|
|
80
81
|
}
|
|
81
|
-
export
|
|
82
|
+
export type Ecommerce = {
|
|
82
83
|
__typename?: 'Ecommerce';
|
|
83
84
|
enabled?: Maybe<Scalars['Boolean']>;
|
|
84
85
|
reserved?: Maybe<Scalars['Boolean']>;
|
|
85
86
|
withHomeDelivery?: Maybe<Scalars['Boolean']>;
|
|
86
87
|
withTradeIn?: Maybe<Scalars['Boolean']>;
|
|
87
88
|
};
|
|
88
|
-
export
|
|
89
|
+
export type FinancialOption = {
|
|
89
90
|
__typename?: 'FinancialOption';
|
|
90
91
|
administrationFee?: Maybe<Scalars['Float']>;
|
|
91
92
|
description?: Maybe<Scalars['String']>;
|
|
@@ -110,7 +111,7 @@ export declare type FinancialOption = {
|
|
|
110
111
|
type: Scalars['String'];
|
|
111
112
|
url?: Maybe<Scalars['URL']>;
|
|
112
113
|
};
|
|
113
|
-
export
|
|
114
|
+
export type FinancialOptionDetail = {
|
|
114
115
|
__typename?: 'FinancialOptionDetail';
|
|
115
116
|
current: Scalars['Float'];
|
|
116
117
|
default: Scalars['Float'];
|
|
@@ -123,12 +124,12 @@ export declare enum FinancialOptionInclusion {
|
|
|
123
124
|
IncludesService = "INCLUDES_SERVICE",
|
|
124
125
|
IncludesWintertires = "INCLUDES_WINTERTIRES"
|
|
125
126
|
}
|
|
126
|
-
export
|
|
127
|
+
export type HoursOpen = {
|
|
127
128
|
__typename?: 'HoursOpen';
|
|
128
129
|
from?: Maybe<Scalars['Time']>;
|
|
129
130
|
until?: Maybe<Scalars['Time']>;
|
|
130
131
|
};
|
|
131
|
-
export
|
|
132
|
+
export type Insurance = {
|
|
132
133
|
__typename?: 'Insurance';
|
|
133
134
|
addons: Array<InsuranceAddon>;
|
|
134
135
|
description: Scalars['String'];
|
|
@@ -141,7 +142,7 @@ export declare type Insurance = {
|
|
|
141
142
|
unit: Scalars['String'];
|
|
142
143
|
url?: Maybe<Scalars['URL']>;
|
|
143
144
|
};
|
|
144
|
-
export
|
|
145
|
+
export type InsuranceAddon = {
|
|
145
146
|
__typename?: 'InsuranceAddon';
|
|
146
147
|
description?: Maybe<Scalars['String']>;
|
|
147
148
|
exclusions: Array<Scalars['String']>;
|
|
@@ -150,17 +151,17 @@ export declare type InsuranceAddon = {
|
|
|
150
151
|
title?: Maybe<Scalars['String']>;
|
|
151
152
|
unit: Scalars['String'];
|
|
152
153
|
};
|
|
153
|
-
export
|
|
154
|
+
export type InsuranceItem = {
|
|
154
155
|
__typename?: 'InsuranceItem';
|
|
155
156
|
description?: Maybe<Scalars['String']>;
|
|
156
157
|
name?: Maybe<Scalars['String']>;
|
|
157
158
|
};
|
|
158
|
-
export
|
|
159
|
+
export type InsuranceLegality = {
|
|
159
160
|
__typename?: 'InsuranceLegality';
|
|
160
161
|
description?: Maybe<Scalars['String']>;
|
|
161
162
|
url?: Maybe<Scalars['URL']>;
|
|
162
163
|
};
|
|
163
|
-
export
|
|
164
|
+
export type InsuranceOption = {
|
|
164
165
|
__typename?: 'InsuranceOption';
|
|
165
166
|
description?: Maybe<Scalars['String']>;
|
|
166
167
|
identifier?: Maybe<Scalars['String']>;
|
|
@@ -176,12 +177,12 @@ export declare type InsuranceOption = {
|
|
|
176
177
|
terms?: Maybe<Scalars['URL']>;
|
|
177
178
|
url?: Maybe<Scalars['URL']>;
|
|
178
179
|
};
|
|
179
|
-
export
|
|
180
|
+
export type Link = {
|
|
180
181
|
__typename?: 'Link';
|
|
181
182
|
title?: Maybe<Scalars['String']>;
|
|
182
183
|
url?: Maybe<Scalars['URL']>;
|
|
183
184
|
};
|
|
184
|
-
export
|
|
185
|
+
export type Location = {
|
|
185
186
|
__typename?: 'Location';
|
|
186
187
|
city?: Maybe<Scalars['String']>;
|
|
187
188
|
county?: Maybe<Scalars['String']>;
|
|
@@ -189,29 +190,29 @@ export declare type Location = {
|
|
|
189
190
|
postalCode?: Maybe<Scalars['String']>;
|
|
190
191
|
streetAddress?: Maybe<Scalars['String']>;
|
|
191
192
|
};
|
|
192
|
-
export
|
|
193
|
+
export type Manufacturer = {
|
|
193
194
|
__typename?: 'Manufacturer';
|
|
194
195
|
description?: Maybe<Scalars['String']>;
|
|
195
196
|
logotype?: Maybe<Scalars['URL']>;
|
|
196
197
|
name: Scalars['String'];
|
|
197
198
|
packageOption?: Maybe<PackageOption>;
|
|
198
199
|
};
|
|
199
|
-
export
|
|
200
|
+
export type Media = {
|
|
200
201
|
__typename?: 'Media';
|
|
201
202
|
files: Array<MediaFile>;
|
|
202
203
|
type: Scalars['String'];
|
|
203
204
|
};
|
|
204
|
-
export
|
|
205
|
+
export type MediaFile = {
|
|
205
206
|
__typename?: 'MediaFile';
|
|
206
207
|
formats: Array<Maybe<MediaFileFormat>>;
|
|
207
208
|
url: Scalars['URL'];
|
|
208
209
|
};
|
|
209
|
-
export
|
|
210
|
+
export type MediaFileFormat = {
|
|
210
211
|
__typename?: 'MediaFileFormat';
|
|
211
212
|
format: Scalars['String'];
|
|
212
213
|
url: Scalars['URL'];
|
|
213
214
|
};
|
|
214
|
-
export
|
|
215
|
+
export type OpeningHours = {
|
|
215
216
|
__typename?: 'OpeningHours';
|
|
216
217
|
friday?: Maybe<HoursOpen>;
|
|
217
218
|
monday?: Maybe<HoursOpen>;
|
|
@@ -221,7 +222,7 @@ export declare type OpeningHours = {
|
|
|
221
222
|
tuesday?: Maybe<HoursOpen>;
|
|
222
223
|
wednesday?: Maybe<HoursOpen>;
|
|
223
224
|
};
|
|
224
|
-
export
|
|
225
|
+
export type Organization = {
|
|
225
226
|
__typename?: 'Organization';
|
|
226
227
|
branches: Array<Maybe<Branch>>;
|
|
227
228
|
contact?: Maybe<ContactOptions>;
|
|
@@ -233,65 +234,65 @@ export declare type Organization = {
|
|
|
233
234
|
name?: Maybe<Scalars['String']>;
|
|
234
235
|
parent?: Maybe<Branch>;
|
|
235
236
|
};
|
|
236
|
-
export
|
|
237
|
+
export type PackageOption = {
|
|
237
238
|
__typename?: 'PackageOption';
|
|
238
239
|
description?: Maybe<Scalars['String']>;
|
|
239
240
|
image?: Maybe<Scalars['URL']>;
|
|
240
241
|
link?: Maybe<Link>;
|
|
241
242
|
title?: Maybe<Scalars['String']>;
|
|
242
243
|
};
|
|
243
|
-
export
|
|
244
|
+
export type Position = {
|
|
244
245
|
__typename?: 'Position';
|
|
245
246
|
latitude?: Maybe<Scalars['Float']>;
|
|
246
247
|
longitude?: Maybe<Scalars['Float']>;
|
|
247
248
|
};
|
|
248
|
-
export
|
|
249
|
+
export type Promo = {
|
|
249
250
|
__typename?: 'Promo';
|
|
250
251
|
description?: Maybe<Scalars['String']>;
|
|
251
252
|
image?: Maybe<Scalars['URL']>;
|
|
252
253
|
link?: Maybe<Link>;
|
|
253
254
|
title?: Maybe<Scalars['String']>;
|
|
254
255
|
};
|
|
255
|
-
export
|
|
256
|
+
export type Query = {
|
|
256
257
|
__typename?: 'Query';
|
|
257
258
|
branch?: Maybe<Branch>;
|
|
258
259
|
insurances: Array<Insurance>;
|
|
259
260
|
loan?: Maybe<FinancialOption>;
|
|
260
261
|
vehicle?: Maybe<Vehicle>;
|
|
261
262
|
};
|
|
262
|
-
export
|
|
263
|
+
export type QueryBranchArgs = {
|
|
263
264
|
id: Scalars['ID'];
|
|
264
265
|
};
|
|
265
|
-
export
|
|
266
|
+
export type QueryInsurancesArgs = {
|
|
266
267
|
branch?: InputMaybe<Scalars['ID']>;
|
|
267
268
|
drivingDistance: DrivingDistance;
|
|
268
269
|
id: Scalars['ID'];
|
|
269
270
|
personalNumber: Scalars['PersonalNumber'];
|
|
270
271
|
};
|
|
271
|
-
export
|
|
272
|
+
export type QueryLoanArgs = {
|
|
272
273
|
branch?: InputMaybe<Scalars['ID']>;
|
|
273
274
|
downPayment: Scalars['Int'];
|
|
274
275
|
duration: Scalars['Int'];
|
|
275
276
|
id: Scalars['ID'];
|
|
276
277
|
residual: Scalars['Float'];
|
|
277
278
|
};
|
|
278
|
-
export
|
|
279
|
+
export type QueryVehicleArgs = {
|
|
279
280
|
branch?: InputMaybe<Scalars['ID']>;
|
|
280
281
|
id: Scalars['ID'];
|
|
281
282
|
};
|
|
282
|
-
export
|
|
283
|
+
export type SafetyOption = {
|
|
283
284
|
__typename?: 'SafetyOption';
|
|
284
285
|
content?: Maybe<Scalars['String']>;
|
|
285
286
|
image?: Maybe<Scalars['URL']>;
|
|
286
287
|
name?: Maybe<Scalars['String']>;
|
|
287
288
|
title?: Maybe<Scalars['String']>;
|
|
288
289
|
};
|
|
289
|
-
export
|
|
290
|
+
export type Service = {
|
|
290
291
|
__typename?: 'Service';
|
|
291
292
|
markdown?: Maybe<Scalars['String']>;
|
|
292
293
|
title?: Maybe<Scalars['String']>;
|
|
293
294
|
};
|
|
294
|
-
export
|
|
295
|
+
export type Vehicle = {
|
|
295
296
|
__typename?: 'Vehicle';
|
|
296
297
|
availableFrom?: Maybe<Scalars['DateTime']>;
|
|
297
298
|
branch?: Maybe<Branch>;
|
|
@@ -315,7 +316,7 @@ export declare type Vehicle = {
|
|
|
315
316
|
shortDescription?: Maybe<Scalars['String']>;
|
|
316
317
|
title: Scalars['String'];
|
|
317
318
|
};
|
|
318
|
-
export
|
|
319
|
+
export type VehicleData = {
|
|
319
320
|
__typename?: 'VehicleData';
|
|
320
321
|
enginePower?: Maybe<Scalars['Float']>;
|
|
321
322
|
equipmentLevel?: Maybe<Scalars['String']>;
|
|
@@ -335,13 +336,17 @@ export declare type VehicleData = {
|
|
|
335
336
|
salesName?: Maybe<Scalars['String']>;
|
|
336
337
|
vin?: Maybe<Scalars['String']>;
|
|
337
338
|
};
|
|
338
|
-
export
|
|
339
|
+
export type VehicleDataPropertySetArgs = {
|
|
339
340
|
category?: InputMaybe<Scalars['String']>;
|
|
340
341
|
properties?: InputMaybe<Array<Scalars['String']>>;
|
|
341
342
|
};
|
|
342
|
-
export
|
|
343
|
+
export type VehicleFlags = {
|
|
343
344
|
__typename?: 'VehicleFlags';
|
|
344
345
|
auction?: Maybe<Scalars['Boolean']>;
|
|
345
346
|
demoVersion?: Maybe<Scalars['Boolean']>;
|
|
346
347
|
testDrive?: Maybe<Scalars['Boolean']>;
|
|
347
348
|
};
|
|
349
|
+
export type _Service = {
|
|
350
|
+
__typename?: '_Service';
|
|
351
|
+
sdl: Scalars['String'];
|
|
352
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type SearchFilterNameTypes = 'manufacturer' | 'modelSeries' | 'fuelType' | 'gearboxType' | 'branch' | 'color' | 'environmentClass' | 'properties.segment' | 'drivingWheel' | 'price' | 'mileage' | 'modelYear' | 'leasingPrice' | 'businessLeasingPrice';
|
|
2
|
+
export type SearchFilterTypes = {
|
|
3
3
|
filterName: SearchFilterNameTypes;
|
|
4
4
|
displayName?: string;
|
|
5
5
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseAction } from '../../@types/action';
|
|
2
2
|
export declare const SET_PATH = "SET_PATH";
|
|
3
|
-
|
|
3
|
+
type SET_PATH_TYPE = BaseAction<typeof SET_PATH> & {
|
|
4
4
|
path: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type PathAction = SET_PATH_TYPE;
|
|
7
7
|
interface PathState {
|
|
8
8
|
path: string;
|
|
9
9
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useRelatedSearch: (id: string) => import("./RelatedSearchContext").RelatedSearchContextProps;
|
|
1
|
+
declare const useRelatedSearch: (id: string, authorizedReseller?: boolean) => import("./RelatedSearchContext").RelatedSearchContextProps;
|
|
2
2
|
export default useRelatedSearch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
3
3
|
small?: boolean;
|
|
4
4
|
};
|
|
5
5
|
declare const Content: ({ children, small, dangerouslySetInnerHTML }: Props) => JSX.Element;
|
|
@@ -5,7 +5,8 @@ interface GridProps {
|
|
|
5
5
|
hashRoute?: boolean;
|
|
6
6
|
pathRoute?: string;
|
|
7
7
|
placeholderImage?: string;
|
|
8
|
+
displayBranchName?: boolean;
|
|
8
9
|
onClickItem?: (id: string) => void;
|
|
9
10
|
}
|
|
10
|
-
declare const Grid: ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }: GridProps) => JSX.Element | null;
|
|
11
|
+
declare const Grid: ({ documents, placeholderImage, hashRoute, pathRoute, displayBranchName, onClickItem, }: GridProps) => JSX.Element | null;
|
|
11
12
|
export default Grid;
|