@wayke-se/components-react 3.4.0 → 3.5.1
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 +8 -4
- package/dist-node/index.js +62 -21
- 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/Filter/index.js +3 -1
- package/dist-src/components/FilterPanel/faceSelector.js +2 -1
- package/dist-src/components/Grid/index.js +7 -5
- package/dist-src/components/ProductCard/index.js +8 -4
- 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 +7 -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/constants.js +1 -0
- package/dist-src/utils/formats.js +3 -1
- 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 +5 -0
- package/dist-types/@types/filter.d.ts +1 -1
- package/dist-types/@types/search.d.ts +1 -0
- package/dist-types/State/RelatedSearch/useRelatedSearch.d.ts +1 -1
- package/dist-types/components/Grid/index.d.ts +2 -1
- package/dist-types/components/ProductCard/index.d.ts +3 -1
- package/dist-types/components/ProductCard/wrapper.d.ts +1 -0
- package/dist-types/layouts/WaykeComposite.d.ts +1 -1
- 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/utils/constants.d.ts +1 -0
- package/dist-types/utils/sortOptions.d.ts +3 -1
- package/dist-web/index.js +60 -29
- package/dist-web/index.js.map +1 -1
- package/package.json +1 -1
package/dist-web/index.js
CHANGED
|
@@ -476,6 +476,7 @@ const PRICE = 'price';
|
|
|
476
476
|
const MILEAGE = 'mileage';
|
|
477
477
|
const MODEL_YEAR = 'modelYear';
|
|
478
478
|
const LEASING_PRICE = 'leasingPrice';
|
|
479
|
+
const BUSINESS_LEASING_PRICE = 'businessLeasingPrice';
|
|
479
480
|
const COLOR_WHITE = { displayName: 'Vit', hex: '#ffffff' };
|
|
480
481
|
const COLOR_BLACK = { displayName: 'Svart', hex: '#000000' };
|
|
481
482
|
const COLOR_GRAY = { displayName: 'Grå', hex: '#808080' };
|
|
@@ -532,6 +533,8 @@ const FacetIdToTitle = (f) => {
|
|
|
532
533
|
return 'Modellår';
|
|
533
534
|
case LEASING_PRICE:
|
|
534
535
|
return 'Privatleasing';
|
|
536
|
+
case BUSINESS_LEASING_PRICE:
|
|
537
|
+
return 'Företagsleasing';
|
|
535
538
|
default:
|
|
536
539
|
return f;
|
|
537
540
|
}
|
|
@@ -662,6 +665,8 @@ const SortOptionDisplayName = {
|
|
|
662
665
|
Pricedesc: 'price-desc',
|
|
663
666
|
ModelAsc: 'model-asc',
|
|
664
667
|
Modeldesc: 'model-desc',
|
|
668
|
+
MileageAsc: 'mileage-asc',
|
|
669
|
+
Mileagedesc: 'mileage-desc',
|
|
665
670
|
};
|
|
666
671
|
const getTranslatedSortOptionDisplayName = (str) => {
|
|
667
672
|
switch (str) {
|
|
@@ -677,6 +682,10 @@ const getTranslatedSortOptionDisplayName = (str) => {
|
|
|
677
682
|
return 'Årsmodell äldst';
|
|
678
683
|
case SortOptionDisplayName.Modeldesc:
|
|
679
684
|
return 'Årsmodell nyast';
|
|
685
|
+
case SortOptionDisplayName.MileageAsc:
|
|
686
|
+
return 'Miltal lägst';
|
|
687
|
+
case SortOptionDisplayName.Mileagedesc:
|
|
688
|
+
return 'Miltal högst';
|
|
680
689
|
default:
|
|
681
690
|
return str;
|
|
682
691
|
}
|
|
@@ -1609,6 +1618,7 @@ const FacetSelector = ({ facet }) => {
|
|
|
1609
1618
|
return React__default.createElement(ColorSelectFacet, { facet: facet });
|
|
1610
1619
|
case PRICE:
|
|
1611
1620
|
return React__default.createElement(RangeFacet, { facet: facet, unit: "kr", formatValues: true });
|
|
1621
|
+
case BUSINESS_LEASING_PRICE:
|
|
1612
1622
|
case LEASING_PRICE:
|
|
1613
1623
|
return React__default.createElement(RangeFacet, { facet: facet, unit: "kr/m\u00E5n", formatValues: true });
|
|
1614
1624
|
case MILEAGE:
|
|
@@ -1641,6 +1651,8 @@ const isSelected = (f, searchParams) => {
|
|
|
1641
1651
|
switch (f.id) {
|
|
1642
1652
|
case PRICE:
|
|
1643
1653
|
case MILEAGE:
|
|
1654
|
+
case LEASING_PRICE:
|
|
1655
|
+
case BUSINESS_LEASING_PRICE:
|
|
1644
1656
|
case MODEL_YEAR:
|
|
1645
1657
|
return searchParams.has(`${f.id}.min`) || searchParams.has(`${f.id}.max`) ? 1 : 0;
|
|
1646
1658
|
default:
|
|
@@ -1779,6 +1791,11 @@ const ContentFooter = styled.div `
|
|
|
1779
1791
|
margin-top: auto;
|
|
1780
1792
|
padding-top: ${size(1)};
|
|
1781
1793
|
`;
|
|
1794
|
+
const PreHeading = styled.div `
|
|
1795
|
+
margin-bottom: ${size(0.25)};
|
|
1796
|
+
color: ${(props) => props.theme.color.textDarkLighten};
|
|
1797
|
+
font-size: 0.75rem;
|
|
1798
|
+
`;
|
|
1782
1799
|
const Heading$2 = styled.h1.attrs(() => ({
|
|
1783
1800
|
className: 'wayke__theme wayke__font--bold',
|
|
1784
1801
|
})) `
|
|
@@ -1843,7 +1860,7 @@ const OldPrice = styled.div `
|
|
|
1843
1860
|
`;
|
|
1844
1861
|
const Label$3 = styled.label `
|
|
1845
1862
|
color: ${(props) => props.theme.color.disabledText};
|
|
1846
|
-
font-size: 0.
|
|
1863
|
+
font-size: 0.75rem;
|
|
1847
1864
|
`;
|
|
1848
1865
|
|
|
1849
1866
|
const Item$5 = styled.li `
|
|
@@ -1954,7 +1971,7 @@ const usePath = () => {
|
|
|
1954
1971
|
return context;
|
|
1955
1972
|
};
|
|
1956
1973
|
|
|
1957
|
-
const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, description, uspList, price, oldPrice, leasingPrice, onClick, }) => {
|
|
1974
|
+
const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, branchName, description, uspList, price, oldPrice, leasingPrice, businessLeasingPrice, onClick, }) => {
|
|
1958
1975
|
const { pushState } = usePath();
|
|
1959
1976
|
const _onClick = useMemo(() => (onClick ? () => onClick(id) : undefined), [id]);
|
|
1960
1977
|
const onHrefClick = useCallback((e) => {
|
|
@@ -1975,6 +1992,7 @@ const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, desc
|
|
|
1975
1992
|
React__default.createElement(Img, { src: placeholderImage || DEFAULT_PLACEHOLDER_IMAGE }))))),
|
|
1976
1993
|
React__default.createElement(Content, null,
|
|
1977
1994
|
React__default.createElement(ContentBody, null,
|
|
1995
|
+
branchName && React__default.createElement(PreHeading, null, branchName),
|
|
1978
1996
|
React__default.createElement(Heading$2, null, href ? (React__default.createElement(Link, { onClick: onHrefClick, href: href, title: title, "aria-label": title }, title)) : (title)),
|
|
1979
1997
|
description && React__default.createElement(Description$1, null, description),
|
|
1980
1998
|
uspList && (React__default.createElement(Usp, null,
|
|
@@ -1985,8 +2003,11 @@ const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, desc
|
|
|
1985
2003
|
oldPrice ? React__default.createElement(OldPrice, null, oldPrice) : React__default.createElement(Label$3, null, "Pris"),
|
|
1986
2004
|
React__default.createElement(CurrentPrice, null, price)),
|
|
1987
2005
|
leasingPrice && (React__default.createElement(PriceCell, null,
|
|
1988
|
-
React__default.createElement(Label$3, null, "
|
|
1989
|
-
React__default.createElement(CurrentPrice, null, leasingPrice)))
|
|
2006
|
+
React__default.createElement(Label$3, null, "Privatleasing"),
|
|
2007
|
+
React__default.createElement(CurrentPrice, null, leasingPrice))),
|
|
2008
|
+
businessLeasingPrice && (React__default.createElement(PriceCell, null,
|
|
2009
|
+
React__default.createElement(Label$3, null, "F\u00F6retagsleasing"),
|
|
2010
|
+
React__default.createElement(CurrentPrice, null, businessLeasingPrice))))))));
|
|
1990
2011
|
};
|
|
1991
2012
|
|
|
1992
2013
|
const resolveImage = (document) => {
|
|
@@ -1996,7 +2017,7 @@ const resolveImage = (document) => {
|
|
|
1996
2017
|
}
|
|
1997
2018
|
return undefined;
|
|
1998
2019
|
};
|
|
1999
|
-
const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }) => {
|
|
2020
|
+
const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, displayBranchName, onClickItem, }) => {
|
|
2000
2021
|
if (!documents) {
|
|
2001
2022
|
return null;
|
|
2002
2023
|
}
|
|
@@ -2023,7 +2044,7 @@ const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }
|
|
|
2023
2044
|
*/
|
|
2024
2045
|
const _pathRoute = pathRoute ? `${pathRoute}/${document._id}` : undefined;
|
|
2025
2046
|
return (React__default.createElement(Item$4, { key: document._id },
|
|
2026
|
-
React__default.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: [
|
|
2047
|
+
React__default.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: [
|
|
2027
2048
|
{
|
|
2028
2049
|
title: document.modelYear,
|
|
2029
2050
|
},
|
|
@@ -2036,10 +2057,12 @@ const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }
|
|
|
2036
2057
|
{
|
|
2037
2058
|
title: document.fuelType,
|
|
2038
2059
|
},
|
|
2039
|
-
], price: `${numberSeparator(document.price)} kr`,
|
|
2040
|
-
? `${numberSeparator(document.leasingPrice)} kr`
|
|
2041
|
-
: undefined, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
|
|
2060
|
+
], price: `${numberSeparator(document.price)} kr`, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
|
|
2042
2061
|
? `${numberSeparator(document.oldPrice)} kr`
|
|
2062
|
+
: undefined, leasingPrice: document.leasingPrice !== undefined
|
|
2063
|
+
? `${numberSeparator(document.leasingPrice)} kr/mån`
|
|
2064
|
+
: undefined, businessLeasingPrice: document.businessLeasingPrice !== undefined
|
|
2065
|
+
? `${numberSeparator(document.businessLeasingPrice)} kr/mån`
|
|
2043
2066
|
: undefined })));
|
|
2044
2067
|
}))));
|
|
2045
2068
|
};
|
|
@@ -2421,7 +2444,7 @@ PubSub.publish = (eventName, ...args) => {
|
|
|
2421
2444
|
}
|
|
2422
2445
|
};
|
|
2423
2446
|
|
|
2424
|
-
const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, onClickSearchItem, }) => {
|
|
2447
|
+
const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, displayBranchName, onClickSearchItem, }) => {
|
|
2425
2448
|
const { error, documents, queryFilter, onFilterUpdate, onInitialize } = useSearch();
|
|
2426
2449
|
useEffect(() => {
|
|
2427
2450
|
if (modifyDocumentTitleSearch) {
|
|
@@ -2459,7 +2482,7 @@ const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, rem
|
|
|
2459
2482
|
React__default.createElement(Result, null,
|
|
2460
2483
|
React__default.createElement(React__default.Fragment, null,
|
|
2461
2484
|
error && (React__default.createElement(Snackbar, { severity: "error", icon: true, heading: "Ett fel har intr\u00E4ffat" }, "V\u00E4nligen f\u00F6rs\u00F6k igen.")),
|
|
2462
|
-
!error && documents && documents.length > 0 && (React__default.createElement(Grid, { hashRoute: hashRoute, pathRoute: pathRoute, onClickItem: onItemClicked, documents: documents, placeholderImage: placeholderImage })),
|
|
2485
|
+
!error && documents && documents.length > 0 && (React__default.createElement(Grid, { hashRoute: hashRoute, pathRoute: pathRoute, onClickItem: onItemClicked, documents: documents, placeholderImage: placeholderImage, displayBranchName: displayBranchName })),
|
|
2463
2486
|
!error && documents && documents.length === 0 && (React__default.createElement(Snackbar, { severity: "warning", icon: true, heading: "Inga resultat" }, "Det finns inga resultat som matchar din s\u00F6kning."))))))),
|
|
2464
2487
|
React__default.createElement(PortalElement, { id: DefaultPortal })));
|
|
2465
2488
|
};
|
|
@@ -5332,10 +5355,8 @@ const ManufacturerPackageOption = ({ packageOption }) => {
|
|
|
5332
5355
|
React__default.createElement(LogoBox, { logo: packageOption.image, alt: "Logotyp", wide: true })))));
|
|
5333
5356
|
};
|
|
5334
5357
|
|
|
5335
|
-
const initialValue = {};
|
|
5336
|
-
const getInitialValue = (title) => title && !!initialValue[title];
|
|
5337
5358
|
const ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
5338
|
-
const [visible, setVisible] = useState(
|
|
5359
|
+
const [visible, setVisible] = useState(false);
|
|
5339
5360
|
const _onClickValue = useCallback(() => {
|
|
5340
5361
|
if (onClickValue) {
|
|
5341
5362
|
onClickValue();
|
|
@@ -5343,7 +5364,6 @@ const ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
|
5343
5364
|
}, []);
|
|
5344
5365
|
const onClick = useCallback(() => {
|
|
5345
5366
|
if (!visible) {
|
|
5346
|
-
initialValue[type] = true;
|
|
5347
5367
|
setVisible(true);
|
|
5348
5368
|
if (onClickVisible) {
|
|
5349
5369
|
onClickVisible();
|
|
@@ -5877,7 +5897,7 @@ const RelatedSearchContext = createContext({
|
|
|
5877
5897
|
fetchRelated: (_) => { },
|
|
5878
5898
|
});
|
|
5879
5899
|
|
|
5880
|
-
const useRelatedSearch = (id) => {
|
|
5900
|
+
const useRelatedSearch = (id, authorizedReseller) => {
|
|
5881
5901
|
const data = useContext(RelatedSearchContext);
|
|
5882
5902
|
useEffect(() => {
|
|
5883
5903
|
const searchParams = new URLSearchParams();
|
|
@@ -5885,6 +5905,9 @@ const useRelatedSearch = (id) => {
|
|
|
5885
5905
|
if (data.moreLikeThisUrl && id) {
|
|
5886
5906
|
searchParams.set('id', id);
|
|
5887
5907
|
}
|
|
5908
|
+
if (authorizedReseller) {
|
|
5909
|
+
searchParams.set('isAuthorizedResellerForManufacturer', 'true');
|
|
5910
|
+
}
|
|
5888
5911
|
data.fetchRelated(searchParams);
|
|
5889
5912
|
}, [id]);
|
|
5890
5913
|
return data;
|
|
@@ -5900,8 +5923,8 @@ const regexPathGuid = (path) => {
|
|
|
5900
5923
|
return r;
|
|
5901
5924
|
};
|
|
5902
5925
|
|
|
5903
|
-
const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
5904
|
-
const { loading, response, moreLikeThisUrl } = useRelatedSearch(id);
|
|
5926
|
+
const Related = ({ id, hashRoute, pathRoute, authorizedReseller, displayBranchName, onClickSearchItem, }) => {
|
|
5927
|
+
const { loading, response, moreLikeThisUrl } = useRelatedSearch(id, !!authorizedReseller);
|
|
5905
5928
|
const onItemClicked = useCallback((id) => {
|
|
5906
5929
|
PubSub.publish('ItemClicked', id);
|
|
5907
5930
|
if (onClickSearchItem) {
|
|
@@ -5932,7 +5955,7 @@ const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
5932
5955
|
? window.location.pathname.replace(r, document._id)
|
|
5933
5956
|
: `${window.location.pathname}${prefix}${document._id}`;
|
|
5934
5957
|
return (React__default.createElement(OverflowGridItem, { key: document._id },
|
|
5935
|
-
React__default.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: [
|
|
5958
|
+
React__default.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: [
|
|
5936
5959
|
{
|
|
5937
5960
|
title: document.modelYear,
|
|
5938
5961
|
},
|
|
@@ -5947,6 +5970,10 @@ const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
5947
5970
|
},
|
|
5948
5971
|
], price: `${numberSeparator(document.price)} kr`, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
|
|
5949
5972
|
? `${numberSeparator(document.oldPrice)} kr`
|
|
5973
|
+
: undefined, leasingPrice: document.leasingPrice !== undefined
|
|
5974
|
+
? `${numberSeparator(document.leasingPrice)} kr/mån`
|
|
5975
|
+
: undefined, businessLeasingPrice: document.businessLeasingPrice !== undefined
|
|
5976
|
+
? `${numberSeparator(document.businessLeasingPrice)} kr/mån`
|
|
5950
5977
|
: undefined, pathRoute: pathRoute })));
|
|
5951
5978
|
})))))));
|
|
5952
5979
|
};
|
|
@@ -6159,7 +6186,7 @@ const StaticMap = ({ position }) => {
|
|
|
6159
6186
|
React__default.createElement(ButtonContent, null, "Visa karta")))));
|
|
6160
6187
|
};
|
|
6161
6188
|
|
|
6162
|
-
const Branch = ({ branch, loading }) => {
|
|
6189
|
+
const Branch = ({ branch, loading, displayBranchName }) => {
|
|
6163
6190
|
const [modal, setModal] = useState(false);
|
|
6164
6191
|
const openModal = useCallback(() => setModal(true), []);
|
|
6165
6192
|
const closeModal = useCallback(() => setModal(false), []);
|
|
@@ -6174,9 +6201,11 @@ const Branch = ({ branch, loading }) => {
|
|
|
6174
6201
|
return (React__default.createElement(React__default.Fragment, null,
|
|
6175
6202
|
modal && (React__default.createElement(BranchModal, { loading: loading, connections: branch?.connections, onClose: closeModal })),
|
|
6176
6203
|
React__default.createElement(Repeat, null,
|
|
6177
|
-
React__default.createElement(H2, { noMargin: true },
|
|
6178
|
-
? `Den här bilen finns på
|
|
6179
|
-
:
|
|
6204
|
+
React__default.createElement(H2, { noMargin: true }, displayBranchName
|
|
6205
|
+
? `Den här bilen finns på ${branch.name}`
|
|
6206
|
+
: branch?.location?.city
|
|
6207
|
+
? `Den här bilen finns på vår anläggning i ${branch?.location?.city}`
|
|
6208
|
+
: 'Kontakt')),
|
|
6180
6209
|
React__default.createElement(Repeat, null,
|
|
6181
6210
|
React__default.createElement(StaticMap, { position: branch?.location?.position })),
|
|
6182
6211
|
(branch?.connections?.length || 0) > 1 && (React__default.createElement(Repeat, null,
|
|
@@ -6244,6 +6273,7 @@ const SEARCH_ITEM_BRANCH_QUERY = gql `
|
|
|
6244
6273
|
mrf
|
|
6245
6274
|
centralStorage
|
|
6246
6275
|
ecommerce
|
|
6276
|
+
authorizedReseller
|
|
6247
6277
|
}
|
|
6248
6278
|
logotype
|
|
6249
6279
|
openingHours {
|
|
@@ -6643,6 +6673,8 @@ const HINTS = Object.freeze({
|
|
|
6643
6673
|
finish: '',
|
|
6644
6674
|
fuelConsumptionCityDriving: 'Bränsleförbrukning vid stadskörning.',
|
|
6645
6675
|
fuelConsumptionCountryRoadDriving: 'Bränsleförbrukning vid landsvägskörning.',
|
|
6676
|
+
fuelConsumptionMixedDrivingNEDC: 'Bränsleförbrukning vid blandad körning.',
|
|
6677
|
+
fuelConsumptionMixedDrivingWLTP: 'Bränsleförbrukning vid blandad körning.',
|
|
6646
6678
|
fuelConsumptionMixedDriving: 'Bränsleförbrukning vid blandad körning. Dvs. stadskörning och landsvägskörning under en och samma färd.',
|
|
6647
6679
|
fuelType: 'Vad bilen ska tankas med och drivs av.',
|
|
6648
6680
|
gearboxName: '',
|
|
@@ -7210,7 +7242,7 @@ const Documents = ({ documents }) => {
|
|
|
7210
7242
|
React__default.createElement(DocumentList, { documents: group.documents }))))));
|
|
7211
7243
|
};
|
|
7212
7244
|
|
|
7213
|
-
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }) => {
|
|
7245
|
+
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, displayBranchName, onClickSearchItem, }) => {
|
|
7214
7246
|
const { ecomSettings } = useSettings();
|
|
7215
7247
|
const ecomContext = useRef();
|
|
7216
7248
|
const { loading, data: result } = useSearchItem(id);
|
|
@@ -7343,13 +7375,12 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
7343
7375
|
React__default.createElement(UspList, { items: options }))))),
|
|
7344
7376
|
React__default.createElement(Documents, { documents: documents }),
|
|
7345
7377
|
React__default.createElement(ProductPageMainSection, null,
|
|
7346
|
-
React__default.createElement(Branch, { branch: branch, loading: loadingCentralStorageVehicle }),
|
|
7378
|
+
React__default.createElement(Branch, { branch: branch, displayBranchName: displayBranchName, loading: loadingCentralStorageVehicle }),
|
|
7347
7379
|
ecommerce && ecommerce.enabled && (React__default.createElement(Repeat, null,
|
|
7348
7380
|
React__default.createElement(ButtonPrimary, { disabled: !!ecommerce.reserved, title: "K\u00F6p bilen online", onClick: () => ecomContext.current?.start() }, "K\u00F6p bilen online")))),
|
|
7349
7381
|
React__default.createElement(PackageOptions, { packageOptions: packageOptions }),
|
|
7350
7382
|
React__default.createElement(ManufacturerPackageOption, { packageOption: manufacturer?.packageOption }))))),
|
|
7351
|
-
React__default.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, onClickSearchItem: onClickSearchItem })),
|
|
7352
|
-
false ,
|
|
7383
|
+
React__default.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, authorizedReseller: !!branch?.flags?.authorizedReseller, displayBranchName: displayBranchName, onClickSearchItem: onClickSearchItem })),
|
|
7353
7384
|
React__default.createElement(PortalElement, { id: DefaultPortal }),
|
|
7354
7385
|
demoCarModal && React__default.createElement(DemoCarModal, { onClose: onToggleDemoCarModal })));
|
|
7355
7386
|
};
|
|
@@ -7712,7 +7743,7 @@ const useHashGuid = () => {
|
|
|
7712
7743
|
return id;
|
|
7713
7744
|
};
|
|
7714
7745
|
|
|
7715
|
-
const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, }) => {
|
|
7746
|
+
const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, displayBranchName, }) => {
|
|
7716
7747
|
const hashId = useHashGuid();
|
|
7717
7748
|
const { id: pathId } = usePath();
|
|
7718
7749
|
useEffect(() => {
|
|
@@ -7726,7 +7757,7 @@ const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, remov
|
|
|
7726
7757
|
}
|
|
7727
7758
|
}, [hashId]);
|
|
7728
7759
|
const id = pathId || hashId;
|
|
7729
|
-
return (React__default.createElement(React__default.Fragment, null, id ? (React__default.createElement(WaykeSearchItem, { id: id, hashRoute: !pathRoute, disableResetScrollOnInit: disableResetScrollOnInit, placeholderImage: placeholderImage, pathRoute: pathRoute, modifyDocumentTitleItem: modifyDocumentTitleItem })) : (React__default.createElement(WaykeSearch, { filterList: filterList, initialQueryParams: initialQueryParams, removeSearchBar: removeSearchBar, hashRoute: !pathRoute, placeholderImage: placeholderImage, pathRoute: pathRoute, removeFilterOptions: removeFilterOptions, modifyDocumentTitleSearch: modifyDocumentTitleSearch }))));
|
|
7760
|
+
return (React__default.createElement(React__default.Fragment, null, id ? (React__default.createElement(WaykeSearchItem, { id: id, hashRoute: !pathRoute, disableResetScrollOnInit: disableResetScrollOnInit, placeholderImage: placeholderImage, pathRoute: pathRoute, modifyDocumentTitleItem: modifyDocumentTitleItem, displayBranchName: displayBranchName })) : (React__default.createElement(WaykeSearch, { filterList: filterList, initialQueryParams: initialQueryParams, removeSearchBar: removeSearchBar, hashRoute: !pathRoute, placeholderImage: placeholderImage, pathRoute: pathRoute, removeFilterOptions: removeFilterOptions, modifyDocumentTitleSearch: modifyDocumentTitleSearch, displayBranchName: displayBranchName }))));
|
|
7730
7761
|
};
|
|
7731
7762
|
|
|
7732
7763
|
const WaykeCompositeWithProvider = ({ provider, composite }) => (React__default.createElement(WaykeProvider, { ...provider },
|