@faststore/core 3.67.0 → 3.68.0
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +74 -74
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +86 -71
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1333.js +1 -0
- package/.next/server/chunks/2778.js +2 -2
- package/.next/server/chunks/2792.js +1 -1
- package/.next/server/chunks/3006.js +1 -1
- package/.next/server/chunks/3836.js +1 -1
- package/.next/server/chunks/3918.js +1 -1
- package/.next/server/chunks/3963.js +1 -1
- package/.next/server/chunks/6789.js +1 -1
- package/.next/server/chunks/7178.js +1 -1
- package/.next/server/chunks/7228.js +1 -1
- package/.next/server/chunks/7794.js +1 -1
- package/.next/server/chunks/83.js +1 -1
- package/.next/server/chunks/831.js +1 -1
- package/.next/server/chunks/839.js +1 -0
- package/.next/server/chunks/8569.js +1 -1
- package/.next/server/chunks/8687.js +1 -1
- package/.next/server/chunks/948.js +2 -2
- package/.next/server/chunks/9563.js +2 -2
- package/.next/server/chunks/9630.js +4 -4
- package/.next/server/chunks/UIBannerText.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account/403.js +1 -1
- package/.next/server/pages/account/403.js.nft.json +1 -1
- package/.next/server/pages/account/404.js +1 -1
- package/.next/server/pages/account/404.js.nft.json +1 -1
- package/.next/server/pages/account/[...unknown].js.nft.json +1 -1
- package/.next/server/pages/account/orders/[id].js +1 -1
- package/.next/server/pages/account/orders/[id].js.nft.json +1 -1
- package/.next/server/pages/account/orders.js +1 -1
- package/.next/server/pages/account/orders.js.nft.json +1 -1
- package/.next/server/pages/account/profile.js +1 -1
- package/.next/server/pages/account/profile.js.nft.json +1 -1
- package/.next/server/pages/account/security.js +1 -1
- package/.next/server/pages/account/security.js.nft.json +1 -1
- package/.next/server/pages/account/user-details.js +1 -1
- package/.next/server/pages/account/user-details.js.nft.json +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +2 -2
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/2284.6dd050e60172189a.js +1 -0
- package/.next/static/chunks/3155.243c7558a71f0695.js +1 -0
- package/.next/static/chunks/3166-6af5e854c2f2913a.js +1 -0
- package/.next/static/chunks/3399.93804fb74f79436c.js +1 -0
- package/.next/static/chunks/353.7f2181843462717d.js +1 -0
- package/.next/static/chunks/4803.412bf2a7e15626a6.js +1 -0
- package/.next/static/chunks/5781.28d03feacead66ad.js +1 -0
- package/.next/static/chunks/6355.57d1a07f50ee6cc9.js +1 -0
- package/.next/static/chunks/{6393.361c44eb0818eb7e.js → 6393.53e9ea4f29d1bf23.js} +1 -1
- package/.next/static/chunks/6700.f046aa86e2c83b53.js +1 -0
- package/.next/static/chunks/6857.b2c06171638955ea.js +1 -0
- package/.next/static/chunks/7191-9bdd5f0c18fbd942.js +1 -0
- package/.next/static/chunks/{6410.bd3fa399df59cc80.js → 7351.e90a4cc21797c136.js} +1 -1
- package/.next/static/chunks/7481.3c4ad3642e346232.js +1 -0
- package/.next/static/chunks/7498-0dc4f9a9ed199d3a.js +1 -0
- package/.next/static/chunks/83.ee1fdbe283ac65b6.js +1 -0
- package/.next/static/chunks/9173-88b7ddf38554a5cf.js +1 -0
- package/.next/static/chunks/BannerNewsletter.a9ea51c53885c80f.js +1 -0
- package/.next/static/chunks/{BannerText.695d4d4b6a3f7309.js → BannerText.21f106b180339df1.js} +1 -1
- package/.next/static/chunks/CartSidebar.55cc31a37ffa6ee6.js +1 -0
- package/.next/static/chunks/{Footer.5ed205d931401110.js → Footer.09dddd47ce6c816f.js} +1 -1
- package/.next/static/chunks/Newsletter.2c79d1813e9f9c95.js +1 -0
- package/.next/static/chunks/ProductShelf.299d0989eea49a79.js +1 -0
- package/.next/static/chunks/ProductTiles.ab99b919f3c0215f.js +1 -0
- package/.next/static/chunks/RegionModal.503f063f2e19b936.js +1 -0
- package/.next/static/chunks/RegionSlider.00de4571775d04cc.js +1 -0
- package/.next/static/chunks/Toast.75a18f47eb23b703.js +1 -0
- package/.next/static/chunks/UIBannerText.f4167ceafb96cf67.js +1 -0
- package/.next/static/chunks/UISKUMatrixSidebar.8b6fac58c48f999c.js +1 -0
- package/.next/static/chunks/UIToast.a49584c87d3adc17.js +1 -0
- package/.next/static/chunks/pages/{404-3582ed9196afdf1e.js → 404-dca50618ea3e6fb6.js} +1 -1
- package/.next/static/chunks/pages/{500-1b4eca062588da7f.js → 500-ae6697c7631fb07a.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-debd8b208a0e3d02.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-d782ecb21200f200.js +1 -0
- package/.next/static/chunks/pages/_app-728289774860e9d9.js +1 -0
- package/.next/static/chunks/pages/account/{403-c791997011f970b6.js → 403-a3d8b31b4e9ee8a6.js} +1 -1
- package/.next/static/chunks/pages/account/{404-74e64bb12e8f5a68.js → 404-22b789f04fcdce39.js} +1 -1
- package/.next/static/chunks/pages/account/orders/[id]-a2f44ba3963b81cd.js +1 -0
- package/.next/static/chunks/pages/account/orders-ec040e06c4b516d0.js +1 -0
- package/.next/static/chunks/pages/account/profile-29f93f4c5a55bd87.js +1 -0
- package/.next/static/chunks/pages/account/security-94874fc477520f74.js +1 -0
- package/.next/static/chunks/pages/account/{user-details-6f9fe72e02f5c5df.js → user-details-143cb45d5080d1d9.js} +1 -1
- package/.next/static/chunks/pages/checkout-b0637ee59b1cdca8.js +1 -0
- package/.next/static/chunks/pages/index-b45c9535696b5ab1.js +1 -0
- package/.next/static/chunks/pages/login-bae3a4cdaaed110c.js +1 -0
- package/.next/static/chunks/pages/s-011eedb19dcdccc6.js +1 -0
- package/.next/static/chunks/webpack-8b6c086380cf1398.js +1 -0
- package/.next/static/css/{e4b714970415f2eb.css → 2a4b7072e47636f1.css} +1 -1
- package/.next/static/css/{8a3f440e0ff9cd8e.css → 3d41485722b4e3f5.css} +1 -1
- package/.next/static/css/{2841bab51b99dd53.css → 92960607d6088082.css} +1 -1
- package/.next/static/css/d26cb0a54378b3d9.css +1 -0
- package/.next/static/css/f93cf36b16950027.css +1 -0
- package/.next/static/pRYrZEXsDEpvxbtvEobPH/_buildManifest.js +1 -0
- package/.next/trace +135 -132
- package/.turbo/turbo-build.log +36 -33
- package/.turbo/turbo-test.log +5 -5
- package/@generated/gql.ts +8 -0
- package/@generated/graphql.ts +83 -0
- package/@generated/persisted-documents.json +1 -0
- package/@generated/schema.graphql +51 -0
- package/CHANGELOG.md +6 -0
- package/cms/faststore/content-types.json +238 -1
- package/cms/faststore/sections.json +34 -33
- package/cypress/integration/plp.test.js +2 -2
- package/index.ts +9 -0
- package/package.json +5 -5
- package/src/components/cms/GlobalSections.tsx +1 -0
- package/src/components/cms/RenderSections.tsx +8 -4
- package/src/components/cms/global/Components.ts +8 -0
- package/src/components/navigation/Navbar/Navbar.tsx +5 -6
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +23 -4
- package/src/components/region/RegionBar/RegionBar.tsx +48 -12
- package/src/components/region/RegionFilterButton/RegionFilterButton.tsx +57 -0
- package/src/components/region/RegionFilterButton/index.ts +1 -0
- package/src/components/region/RegionModal/RegionModal.tsx +26 -16
- package/src/components/region/RegionModal/useRegion.ts +12 -11
- package/src/components/region/RegionPopover/RegionPopover.tsx +37 -22
- package/src/components/region/RegionSlider/RegionSlider.tsx +407 -0
- package/src/components/region/RegionSlider/index.ts +1 -0
- package/src/components/region/RegionSlider/section.module.scss +72 -0
- package/src/components/search/Filter/FilterDeliveryMethodFacet.tsx +68 -0
- package/src/components/search/Filter/FilterDesktop.tsx +148 -90
- package/src/components/search/Filter/FilterSlider.tsx +193 -104
- package/src/components/search/Filter/section.module.scss +2 -0
- package/src/components/sections/ProductGallery/section.module.scss +2 -0
- package/src/components/sections/RegionBar/DefaultComponents.ts +1 -0
- package/src/components/sections/RegionBar/RegionBar.tsx +2 -1
- package/src/components/templates/LandingPage/LandingPage.tsx +6 -3
- package/src/components/templates/ProductListingPage/ProductListing.tsx +4 -1
- package/src/components/templates/ProductListingPage/ProductListingPage.tsx +3 -0
- package/src/components/templates/SearchPage/SearchPage.tsx +3 -0
- package/src/components/templates/SearchPage/SearchWrapper.tsx +15 -7
- package/src/components/ui/PickupPoints/PickupPointCard.tsx +39 -0
- package/src/components/ui/PickupPoints/PickupPointCards.tsx +102 -0
- package/src/components/ui/PickupPoints/index.ts +5 -0
- package/src/components/ui/ProductGallery/ProductGallery.tsx +6 -9
- package/src/experimental/index.ts +6 -0
- package/src/pages/404.tsx +15 -6
- package/src/pages/500.tsx +15 -6
- package/src/pages/[...slug].tsx +14 -5
- package/src/pages/[slug]/p.tsx +6 -3
- package/src/pages/_app.tsx +15 -10
- package/src/pages/account/403.tsx +30 -27
- package/src/pages/account/404.tsx +27 -20
- package/src/pages/account/orders/[id].tsx +22 -19
- package/src/pages/account/orders/index.tsx +25 -22
- package/src/pages/account/profile.tsx +27 -23
- package/src/pages/account/security.tsx +28 -23
- package/src/pages/account/user-details.tsx +20 -17
- package/src/pages/checkout.tsx +11 -8
- package/src/pages/index.tsx +7 -4
- package/src/pages/login.tsx +16 -7
- package/src/pages/s.tsx +5 -2
- package/src/sdk/deliveryPromise/index.ts +22 -0
- package/src/sdk/deliveryPromise/provider.tsx +119 -0
- package/src/sdk/deliveryPromise/queries.ts +80 -0
- package/src/sdk/deliveryPromise/reducer.ts +137 -0
- package/src/sdk/deliveryPromise/useDeliveryPromise.ts +419 -0
- package/src/sdk/overrides/PageProvider.tsx +9 -4
- package/src/sdk/product/useLocalizedVariables.ts +20 -6
- package/src/sdk/search/useFilter.ts +12 -1
- package/src/typings/overrides.ts +2 -1
- package/src/utils/globalSettings.ts +74 -0
- package/test/server/index.test.ts +1 -0
- package/.next/server/chunks/6272.js +0 -1
- package/.next/static/auvpWeN2p6A4M2zTGhXzk/_buildManifest.js +0 -1
- package/.next/static/chunks/2284.1b43aea18c23c79e.js +0 -1
- package/.next/static/chunks/3155.ea52e06317dab557.js +0 -1
- package/.next/static/chunks/3166-50d81179a0f5a894.js +0 -1
- package/.next/static/chunks/3399.13a97fefb512c902.js +0 -1
- package/.next/static/chunks/3465.af28497e8069330f.js +0 -1
- package/.next/static/chunks/353.52612dbf516cbaee.js +0 -1
- package/.next/static/chunks/4803.de5b14237d616808.js +0 -1
- package/.next/static/chunks/6355.c0b326c539dbaa90.js +0 -1
- package/.next/static/chunks/6700.4e9426fe8b826dab.js +0 -1
- package/.next/static/chunks/7191-2a7b8ddbd07128b6.js +0 -1
- package/.next/static/chunks/7498-5246b607527180dd.js +0 -1
- package/.next/static/chunks/83.b87d797323ff2034.js +0 -1
- package/.next/static/chunks/9173-ae6b6ebdc42876f1.js +0 -1
- package/.next/static/chunks/9540.69781e999f27cc05.js +0 -1
- package/.next/static/chunks/BannerNewsletter.7c592f132e7048e5.js +0 -1
- package/.next/static/chunks/CartSidebar.a00083c44c87c268.js +0 -1
- package/.next/static/chunks/Newsletter.1004055f09f76d3c.js +0 -1
- package/.next/static/chunks/ProductShelf.d51ba3e6a1b4a57d.js +0 -1
- package/.next/static/chunks/ProductTiles.77284431e2b8c898.js +0 -1
- package/.next/static/chunks/RegionModal.f61aa62e0a09182a.js +0 -1
- package/.next/static/chunks/Toast.6116bc845cd67f49.js +0 -1
- package/.next/static/chunks/UIBannerText.6cc5c00d4ba9b64e.js +0 -1
- package/.next/static/chunks/UISKUMatrixSidebar.782c55a97889e84a.js +0 -1
- package/.next/static/chunks/UIToast.494d0b0ce2c6106a.js +0 -1
- package/.next/static/chunks/pages/[...slug]-d0f23d907ec6fbe3.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-a255e4a7352455df.js +0 -1
- package/.next/static/chunks/pages/_app-1885a948b243078c.js +0 -1
- package/.next/static/chunks/pages/account/orders/[id]-b9feb0c860ff1cec.js +0 -1
- package/.next/static/chunks/pages/account/orders-1d8409a8b4b0e581.js +0 -1
- package/.next/static/chunks/pages/account/profile-5a919fa02b76a422.js +0 -1
- package/.next/static/chunks/pages/account/security-b5ab3d1ecbbea9d9.js +0 -1
- package/.next/static/chunks/pages/checkout-3a4983b22625c4e3.js +0 -1
- package/.next/static/chunks/pages/index-6e68be53d1fef20e.js +0 -1
- package/.next/static/chunks/pages/login-de3dd10c6b35159a.js +0 -1
- package/.next/static/chunks/pages/s-9b0f606f120d66b0.js +0 -1
- package/.next/static/chunks/webpack-f661e0efeacf6028.js +0 -1
- package/.next/static/css/202a74b80e6ce63f.css +0 -1
- /package/.next/static/{auvpWeN2p6A4M2zTGhXzk → pRYrZEXsDEpvxbtvEobPH}/_ssgManifest.js +0 -0
|
@@ -2142,7 +2142,7 @@
|
|
|
2142
2142
|
"required": ["label"],
|
|
2143
2143
|
"properties": {
|
|
2144
2144
|
"icon": {
|
|
2145
|
-
"title": "Location
|
|
2145
|
+
"title": "Location icon",
|
|
2146
2146
|
"type": "object",
|
|
2147
2147
|
"properties": {
|
|
2148
2148
|
"icon": {
|
|
@@ -2153,7 +2153,7 @@
|
|
|
2153
2153
|
"default": "MapPin"
|
|
2154
2154
|
},
|
|
2155
2155
|
"alt": {
|
|
2156
|
-
"title": "Alternative
|
|
2156
|
+
"title": "Alternative label",
|
|
2157
2157
|
"type": "string",
|
|
2158
2158
|
"default": "Map Pin icon"
|
|
2159
2159
|
}
|
|
@@ -2167,7 +2167,8 @@
|
|
|
2167
2167
|
"editLabel": {
|
|
2168
2168
|
"title": "Location edit label",
|
|
2169
2169
|
"type": "string",
|
|
2170
|
-
"default": "
|
|
2170
|
+
"default": "",
|
|
2171
|
+
"description": "[Deprecated] This label should not be used anymore."
|
|
2171
2172
|
},
|
|
2172
2173
|
"buttonIcon": {
|
|
2173
2174
|
"title": "Button Icon",
|
|
@@ -2219,24 +2220,23 @@
|
|
|
2219
2220
|
"properties": {
|
|
2220
2221
|
"label": {
|
|
2221
2222
|
"title": "Input field label",
|
|
2222
|
-
"
|
|
2223
|
-
"
|
|
2223
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2224
|
+
"type": "string"
|
|
2224
2225
|
},
|
|
2225
2226
|
"errorMessage": {
|
|
2226
2227
|
"title": "Input field error message",
|
|
2227
|
-
"
|
|
2228
|
-
"
|
|
2228
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2229
|
+
"type": "string"
|
|
2229
2230
|
},
|
|
2230
2231
|
"noProductsAvailableErrorMessage": {
|
|
2231
2232
|
"title": "Input field error message for the scenario of no products available for a given location",
|
|
2232
|
-
"
|
|
2233
|
-
"
|
|
2234
|
-
"description": "The '%s' will be replaced by the postal code value."
|
|
2233
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections The '%s' is replaced by the postal code value.",
|
|
2234
|
+
"type": "string"
|
|
2235
2235
|
},
|
|
2236
2236
|
"buttonActionText": {
|
|
2237
2237
|
"title": "Input field action button label",
|
|
2238
|
-
"
|
|
2239
|
-
"
|
|
2238
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2239
|
+
"type": "string"
|
|
2240
2240
|
}
|
|
2241
2241
|
}
|
|
2242
2242
|
},
|
|
@@ -2247,11 +2247,12 @@
|
|
|
2247
2247
|
"text": {
|
|
2248
2248
|
"type": "string",
|
|
2249
2249
|
"title": "Link Text",
|
|
2250
|
-
"
|
|
2250
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
|
|
2251
2251
|
},
|
|
2252
2252
|
"to": {
|
|
2253
2253
|
"type": "string",
|
|
2254
|
-
"title": "Action link"
|
|
2254
|
+
"title": "Action link",
|
|
2255
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
|
|
2255
2256
|
},
|
|
2256
2257
|
"icon": {
|
|
2257
2258
|
"title": "Icon",
|
|
@@ -2259,15 +2260,15 @@
|
|
|
2259
2260
|
"properties": {
|
|
2260
2261
|
"icon": {
|
|
2261
2262
|
"title": "Icon",
|
|
2263
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2262
2264
|
"type": "string",
|
|
2263
2265
|
"enumNames": ["Arrow Square Out"],
|
|
2264
|
-
"enum": ["ArrowSquareOut"]
|
|
2265
|
-
"default": "ArrowSquareOut"
|
|
2266
|
+
"enum": ["ArrowSquareOut"]
|
|
2266
2267
|
},
|
|
2267
2268
|
"alt": {
|
|
2268
2269
|
"title": "Alternative Label",
|
|
2269
|
-
"
|
|
2270
|
-
"
|
|
2270
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2271
|
+
"type": "string"
|
|
2271
2272
|
}
|
|
2272
2273
|
}
|
|
2273
2274
|
}
|
|
@@ -2300,24 +2301,23 @@
|
|
|
2300
2301
|
"properties": {
|
|
2301
2302
|
"label": {
|
|
2302
2303
|
"title": "Input field label",
|
|
2303
|
-
"
|
|
2304
|
-
"
|
|
2304
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2305
|
+
"type": "string"
|
|
2305
2306
|
},
|
|
2306
2307
|
"errorMessage": {
|
|
2307
2308
|
"title": "Input field error message",
|
|
2308
|
-
"
|
|
2309
|
-
"
|
|
2309
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2310
|
+
"type": "string"
|
|
2310
2311
|
},
|
|
2311
2312
|
"noProductsAvailableErrorMessage": {
|
|
2312
2313
|
"title": "Input field error message for the scenario of no products available for a given location",
|
|
2313
|
-
"
|
|
2314
|
-
"
|
|
2315
|
-
"description": "The '%s' will be replaced by the postal code value."
|
|
2314
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections The '%s' is replaced by the postal code value.",
|
|
2315
|
+
"type": "string"
|
|
2316
2316
|
},
|
|
2317
2317
|
"buttonActionText": {
|
|
2318
2318
|
"title": "Input field action button label",
|
|
2319
|
-
"
|
|
2320
|
-
"
|
|
2319
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2320
|
+
"type": "string"
|
|
2321
2321
|
}
|
|
2322
2322
|
}
|
|
2323
2323
|
},
|
|
@@ -2345,11 +2345,12 @@
|
|
|
2345
2345
|
"text": {
|
|
2346
2346
|
"type": "string",
|
|
2347
2347
|
"title": "Link Text",
|
|
2348
|
-
"
|
|
2348
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
|
|
2349
2349
|
},
|
|
2350
2350
|
"to": {
|
|
2351
2351
|
"type": "string",
|
|
2352
|
-
"title": "Action link"
|
|
2352
|
+
"title": "Action link",
|
|
2353
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
|
|
2353
2354
|
},
|
|
2354
2355
|
"icon": {
|
|
2355
2356
|
"title": "Icon",
|
|
@@ -2357,15 +2358,15 @@
|
|
|
2357
2358
|
"properties": {
|
|
2358
2359
|
"icon": {
|
|
2359
2360
|
"title": "Icon",
|
|
2361
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2360
2362
|
"type": "string",
|
|
2361
2363
|
"enumNames": ["Arrow Square Out"],
|
|
2362
|
-
"enum": ["ArrowSquareOut"]
|
|
2363
|
-
"default": "ArrowSquareOut"
|
|
2364
|
+
"enum": ["ArrowSquareOut"]
|
|
2364
2365
|
},
|
|
2365
2366
|
"alt": {
|
|
2366
2367
|
"title": "Alternative Label",
|
|
2367
|
-
"
|
|
2368
|
-
"
|
|
2368
|
+
"description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
|
|
2369
|
+
"type": "string"
|
|
2369
2370
|
}
|
|
2370
2371
|
}
|
|
2371
2372
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Cypress tests for PLP
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { options } from '../global'
|
|
7
6
|
import { cypress } from '../../discovery.config'
|
|
7
|
+
import { options } from '../global'
|
|
8
8
|
|
|
9
9
|
const { pages } = cypress
|
|
10
10
|
|
|
@@ -33,7 +33,7 @@ describe('Search page Filters and Sorting options', () => {
|
|
|
33
33
|
const value = $checkbox.attr('data-value')
|
|
34
34
|
// const quantity = $checkbox.attr('data-quantity')
|
|
35
35
|
|
|
36
|
-
cy.getById('filter-slider-button-apply')
|
|
36
|
+
cy.getById('fs-filter-slider-button-apply')
|
|
37
37
|
.click()
|
|
38
38
|
|
|
39
39
|
.then(() => {
|
package/index.ts
CHANGED
|
@@ -26,3 +26,12 @@ export { default as ProductGallerySection } from './src/components/sections/Prod
|
|
|
26
26
|
export { default as ProductShelfSection } from './src/components/sections/ProductShelf'
|
|
27
27
|
export { default as RegionBarSection } from './src/components/sections/RegionBar'
|
|
28
28
|
export { default as Section } from './src/components/sections/Section'
|
|
29
|
+
|
|
30
|
+
// Delivery Promise
|
|
31
|
+
export {
|
|
32
|
+
PICKUP_IN_POINT_FACET_VALUE,
|
|
33
|
+
PICKUP_POINT_FACET_KEY,
|
|
34
|
+
SHIPPING_FACET_KEY,
|
|
35
|
+
PICKUP_ALL_FACET_VALUE,
|
|
36
|
+
getPickupPoints,
|
|
37
|
+
} from './src/sdk/deliveryPromise'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.68.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@envelop/graphql-jit": "^8.0.3",
|
|
45
45
|
"@envelop/parser-cache": "^6.0.2",
|
|
46
46
|
"@envelop/validation-cache": "^6.0.2",
|
|
47
|
-
"@faststore/api": "^3.
|
|
47
|
+
"@faststore/api": "^3.68.0",
|
|
48
48
|
"@faststore/graphql-utils": "^3.56.1",
|
|
49
49
|
"@faststore/lighthouse": "^3.56.1",
|
|
50
|
-
"@faststore/sdk": "^3.
|
|
51
|
-
"@faststore/ui": "^3.
|
|
50
|
+
"@faststore/sdk": "^3.68.0",
|
|
51
|
+
"@faststore/ui": "^3.68.0",
|
|
52
52
|
"@graphql-codegen/cli": "5.0.2",
|
|
53
53
|
"@graphql-codegen/client-preset": "4.2.6",
|
|
54
54
|
"@graphql-codegen/typescript": "4.0.7",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"ts-jest": "29.1.1",
|
|
108
108
|
"typescript": "5.3.2"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "ecc700eec58eaa22c6ae8c5f655c204ecf18f598"
|
|
111
111
|
}
|
|
@@ -12,9 +12,9 @@ import dynamic from 'next/dynamic'
|
|
|
12
12
|
import { useRouter } from 'next/router'
|
|
13
13
|
import useTTI from 'src/sdk/performance/useTTI'
|
|
14
14
|
import { isContentPlatformSource } from 'src/server/content/utils'
|
|
15
|
+
import COMPONENTS from './global/Components'
|
|
15
16
|
import SectionBoundary from './SectionBoundary'
|
|
16
17
|
import ViewportObserver from './ViewportObserver'
|
|
17
|
-
import COMPONENTS from './global/Components'
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
20
20
|
components?: Record<string, ComponentType<any>>
|
|
@@ -23,7 +23,7 @@ interface Props {
|
|
|
23
23
|
isInteractive?: boolean
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const SECTIONS_OUT_OF_VIEWPORT = ['CartSidebar', 'RegionModal']
|
|
26
|
+
const SECTIONS_OUT_OF_VIEWPORT = ['CartSidebar', 'RegionModal', 'RegionSlider']
|
|
27
27
|
|
|
28
28
|
const Toast = dynamic(
|
|
29
29
|
() => import(/* webpackChunkName: "Toast" */ '../common/Toast'),
|
|
@@ -67,12 +67,16 @@ export const LazyLoadingSection = ({
|
|
|
67
67
|
debug?: boolean
|
|
68
68
|
isInteractive?: boolean
|
|
69
69
|
}) => {
|
|
70
|
-
const { cart: displayCart, modal: displayModal } = useUI()
|
|
70
|
+
const { cart: displayCart, modal: displayModal, regionSlider } = useUI()
|
|
71
|
+
|
|
71
72
|
if (SECTIONS_OUT_OF_VIEWPORT.includes(sectionName)) {
|
|
72
73
|
const shouldLoad =
|
|
73
74
|
isInteractive ||
|
|
74
75
|
(sectionName === 'CartSidebar' && displayCart) ||
|
|
75
|
-
(sectionName === 'RegionModal' && displayModal)
|
|
76
|
+
(sectionName === 'RegionModal' && displayModal) ||
|
|
77
|
+
(sectionName === 'RegionSlider' &&
|
|
78
|
+
regionSlider.isOpen &&
|
|
79
|
+
regionSlider.type !== 'none')
|
|
76
80
|
|
|
77
81
|
if (debug) {
|
|
78
82
|
console.log(
|
|
@@ -28,6 +28,13 @@ const Footer = dynamic(
|
|
|
28
28
|
import(/* webpackChunkName: "Footer" */ 'src/components/sections/Footer'),
|
|
29
29
|
{ ssr: false }
|
|
30
30
|
)
|
|
31
|
+
const RegionSlider = dynamic(
|
|
32
|
+
() =>
|
|
33
|
+
import(
|
|
34
|
+
/* webpackChunkName: "RegionSlider" */ 'src/components/region/RegionSlider'
|
|
35
|
+
),
|
|
36
|
+
{ ssr: false }
|
|
37
|
+
)
|
|
31
38
|
|
|
32
39
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
33
40
|
Alert,
|
|
@@ -36,6 +43,7 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
36
43
|
RegionPopover,
|
|
37
44
|
CartSidebar, // out of viewport
|
|
38
45
|
RegionModal, // out of viewport
|
|
46
|
+
RegionSlider, // out of viewport
|
|
39
47
|
Footer, // out of viewport
|
|
40
48
|
...PLUGINS_COMPONENTS,
|
|
41
49
|
...CUSTOM_COMPONENTS,
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react'
|
|
2
|
+
import dynamic from 'next/dynamic'
|
|
2
3
|
|
|
3
4
|
import { Icon as UIIcon, useScrollDirection, useUI } from '@faststore/ui'
|
|
4
5
|
|
|
5
6
|
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
6
7
|
import SearchInput from 'src/components/search/SearchInput'
|
|
7
|
-
|
|
8
8
|
import CartToggle from 'src/components/cart/CartToggle'
|
|
9
9
|
import Link from 'src/components/ui/Link'
|
|
10
10
|
import Logo from 'src/components/ui/Logo'
|
|
11
|
-
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
12
|
-
|
|
13
|
-
import storeConfig from 'discovery.config'
|
|
14
|
-
import dynamic from 'next/dynamic'
|
|
15
11
|
import { OrganizationSignInButton } from 'src/components/account/MyAccountDrawer/OrganizationSignInButton'
|
|
12
|
+
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
16
13
|
import { useSession } from 'src/sdk/session'
|
|
17
14
|
import useScreenResize from 'src/sdk/ui/useScreenResize'
|
|
15
|
+
|
|
16
|
+
import storeConfig from 'discovery.config'
|
|
18
17
|
import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
|
|
19
18
|
|
|
20
19
|
const NavbarLinks = dynamic(
|
|
@@ -101,7 +100,7 @@ function Navbar({
|
|
|
101
100
|
const scrollDirection = useScrollDirection()
|
|
102
101
|
const { openNavbar, navbar: displayNavbar } = useUI()
|
|
103
102
|
const { isDesktop, isMobile } = useScreenResize()
|
|
104
|
-
const {
|
|
103
|
+
const { b2b } = useSession()
|
|
105
104
|
|
|
106
105
|
const searchMobileRef = useRef<SearchInputRef>(null)
|
|
107
106
|
const [searchExpanded, setSearchExpanded] = useState(false)
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes } from 'react'
|
|
2
|
+
import { useRouter } from 'next/router'
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
-
|
|
4
|
+
import {
|
|
5
|
+
NavbarLinksListItem as UINavbarLinksListItem,
|
|
6
|
+
type NavbarLinksProps as UINavbarLinksProps,
|
|
7
|
+
} from '@faststore/ui'
|
|
5
8
|
|
|
6
9
|
import type { NavbarProps } from 'src/components/navigation/Navbar'
|
|
7
10
|
import RegionButton from 'src/components/region/RegionButton'
|
|
11
|
+
import RegionFilterButton from 'src/components/region/RegionFilterButton'
|
|
8
12
|
import Link from 'src/components/ui/Link'
|
|
9
|
-
|
|
10
13
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
14
|
+
import { useSession } from 'src/sdk/session'
|
|
15
|
+
import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
|
|
16
|
+
import { getGlobalSettings } from 'src/utils/globalSettings'
|
|
11
17
|
|
|
12
18
|
interface NavbarLinksProps extends UINavbarLinksProps {
|
|
13
19
|
links: NavbarProps['links']
|
|
@@ -26,18 +32,31 @@ function NavbarLinks({
|
|
|
26
32
|
}: NavbarLinksProps) {
|
|
27
33
|
const { NavbarLinks: NavbarLinksWrapper, NavbarLinksList } =
|
|
28
34
|
useOverrideComponents<'Navbar'>()
|
|
35
|
+
const router = useRouter()
|
|
36
|
+
const { postalCode } = useSession()
|
|
37
|
+
const {
|
|
38
|
+
deliveryPromise: { filterByPickupPoint } = {},
|
|
39
|
+
} = getGlobalSettings()
|
|
40
|
+
const { isEnabled: isDeliveryPromiseEnabled } = useDeliveryPromise()
|
|
41
|
+
|
|
42
|
+
const shouldDisplayGlobalFilter =
|
|
43
|
+
isDeliveryPromiseEnabled && !!postalCode && filterByPickupPoint?.enabled
|
|
44
|
+
|
|
29
45
|
return (
|
|
30
46
|
<NavbarLinksWrapper.Component {...otherProps} {...NavbarLinksWrapper.props}>
|
|
31
47
|
<div data-fs-navbar-links-wrapper data-fs-content="navbar">
|
|
32
48
|
{shouldDisplayRegion && (
|
|
33
49
|
<RegionButton icon={regionIcon} label={regionLabel} />
|
|
34
50
|
)}
|
|
51
|
+
{shouldDisplayGlobalFilter && (
|
|
52
|
+
<RegionFilterButton filterByPickupPoint={filterByPickupPoint} />
|
|
53
|
+
)}
|
|
35
54
|
<NavbarLinksList.Component {...NavbarLinksList.props}>
|
|
36
55
|
{links.map(({ url, text }) => (
|
|
37
56
|
<UINavbarLinksListItem key={text}>
|
|
38
57
|
<Link
|
|
39
58
|
variant="display"
|
|
40
|
-
href={url}
|
|
59
|
+
href={router.asPath.includes(url) ? '#' : url}
|
|
41
60
|
prefetch={false}
|
|
42
61
|
onClick={onClickLink}
|
|
43
62
|
>
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
regionSliderTypes,
|
|
3
|
+
type RegionBarProps as UIRegionBarProps,
|
|
4
|
+
} from '@faststore/ui'
|
|
2
5
|
import { useEffect, useRef } from 'react'
|
|
3
6
|
|
|
4
7
|
import { useUI } from '@faststore/ui'
|
|
5
8
|
import { useSession } from 'src/sdk/session'
|
|
9
|
+
import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
|
|
6
10
|
|
|
7
11
|
import { deliveryPromise, session as initialSession } from 'discovery.config'
|
|
8
12
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
9
13
|
import { textToTitleCase } from 'src/utils/utilities'
|
|
14
|
+
import { getGlobalSettings } from 'src/utils/globalSettings'
|
|
10
15
|
|
|
11
16
|
import { useRegionModal } from '../RegionModal/useRegionModal'
|
|
12
17
|
|
|
13
18
|
export interface RegionBarProps {
|
|
14
19
|
/**
|
|
15
|
-
* A React component that will be rendered as
|
|
20
|
+
* A React component that will be rendered as the location icon.
|
|
16
21
|
*/
|
|
17
22
|
icon?: {
|
|
18
23
|
icon: string
|
|
@@ -24,6 +29,7 @@ export interface RegionBarProps {
|
|
|
24
29
|
label: UIRegionBarProps['label']
|
|
25
30
|
/**
|
|
26
31
|
* Specifies a label for the edit text.
|
|
32
|
+
* @deprecated
|
|
27
33
|
*/
|
|
28
34
|
editLabel?: UIRegionBarProps['editLabel']
|
|
29
35
|
/**
|
|
@@ -37,24 +43,31 @@ export interface RegionBarProps {
|
|
|
37
43
|
|
|
38
44
|
function RegionBar({
|
|
39
45
|
icon: { icon: locationIcon, alt: locationIconAlt },
|
|
40
|
-
buttonIcon
|
|
41
|
-
label,
|
|
42
|
-
editLabel,
|
|
46
|
+
buttonIcon = undefined,
|
|
47
|
+
label: locationLabel,
|
|
48
|
+
editLabel = undefined,
|
|
43
49
|
...otherProps
|
|
44
50
|
}: RegionBarProps) {
|
|
45
51
|
const {
|
|
46
52
|
RegionBar: RegionBarWrapper,
|
|
47
53
|
LocationIcon,
|
|
48
54
|
ButtonIcon,
|
|
55
|
+
FilterButtonIcon,
|
|
49
56
|
} = useOverrideComponents<'RegionBar'>()
|
|
50
57
|
|
|
51
|
-
const { openModal, openPopover } = useUI()
|
|
58
|
+
const { openModal, openPopover, openRegionSlider } = useUI()
|
|
52
59
|
const { city, postalCode } = useSession()
|
|
53
60
|
const { isValidationComplete } = useRegionModal()
|
|
61
|
+
const { globalPickupPoint } = useDeliveryPromise()
|
|
62
|
+
const {
|
|
63
|
+
deliveryPromise: { filterByPickupPoint } = {},
|
|
64
|
+
} = getGlobalSettings()
|
|
54
65
|
const regionBarRef = useRef<HTMLDivElement>(null)
|
|
55
66
|
|
|
56
67
|
const defaultPostalCode =
|
|
57
68
|
!!initialSession?.postalCode && postalCode === initialSession.postalCode
|
|
69
|
+
const shouldDisplayGlobalFilter =
|
|
70
|
+
deliveryPromise.enabled && !!postalCode && filterByPickupPoint?.enabled
|
|
58
71
|
|
|
59
72
|
// If location is not mandatory, and default zipCode is provided or if the user has not set a zipCode, show the popover.
|
|
60
73
|
const displayRegionPopover =
|
|
@@ -87,14 +100,37 @@ function RegionBar({
|
|
|
87
100
|
/>
|
|
88
101
|
}
|
|
89
102
|
buttonIcon={
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
buttonIcon?.icon ? (
|
|
104
|
+
<ButtonIcon.Component
|
|
105
|
+
{...ButtonIcon.props}
|
|
106
|
+
name={buttonIcon?.icon ?? ButtonIcon.props.name}
|
|
107
|
+
aria-label={buttonIcon?.alt ?? ButtonIcon.props['aria-label']}
|
|
108
|
+
/>
|
|
109
|
+
) : undefined
|
|
95
110
|
}
|
|
111
|
+
filterButton={{
|
|
112
|
+
label: filterByPickupPoint?.label,
|
|
113
|
+
icon: (
|
|
114
|
+
<FilterButtonIcon.Component
|
|
115
|
+
{...FilterButtonIcon.props}
|
|
116
|
+
name={
|
|
117
|
+
filterByPickupPoint?.icon?.icon ?? FilterButtonIcon.props.name
|
|
118
|
+
}
|
|
119
|
+
aria-label={
|
|
120
|
+
filterByPickupPoint?.icon?.alt ??
|
|
121
|
+
FilterButtonIcon.props['aria-label']
|
|
122
|
+
}
|
|
123
|
+
/>
|
|
124
|
+
),
|
|
125
|
+
selectedFilter:
|
|
126
|
+
(globalPickupPoint?.name || globalPickupPoint?.address?.street) ??
|
|
127
|
+
undefined,
|
|
128
|
+
shouldDisplayFilterButton: shouldDisplayGlobalFilter,
|
|
129
|
+
onClick: () =>
|
|
130
|
+
openRegionSlider(regionSliderTypes.globalChangePickupPoint),
|
|
131
|
+
}}
|
|
96
132
|
{...RegionBarWrapper.props}
|
|
97
|
-
label={
|
|
133
|
+
label={locationLabel ?? RegionBarWrapper.props.label}
|
|
98
134
|
editLabel={editLabel ?? RegionBarWrapper.props.editLabel}
|
|
99
135
|
// Dynamic props shouldn't be overridable
|
|
100
136
|
// This decision can be reviewed later if needed
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Button as UIButton,
|
|
5
|
+
Icon as UIIcon,
|
|
6
|
+
useUI,
|
|
7
|
+
regionSliderTypes,
|
|
8
|
+
} from '@faststore/ui'
|
|
9
|
+
|
|
10
|
+
import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
|
|
11
|
+
|
|
12
|
+
type RegionFilterButtonProps = {
|
|
13
|
+
filterByPickupPoint?: {
|
|
14
|
+
enabled?: boolean
|
|
15
|
+
label?: string
|
|
16
|
+
icon?: {
|
|
17
|
+
icon?: string
|
|
18
|
+
alt?: string
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function RegionFilterButton({
|
|
24
|
+
filterByPickupPoint: {
|
|
25
|
+
label: filterByPickupPointLabel,
|
|
26
|
+
icon: { icon: filterByPickupPointIcon, alt: filterByPickupPointAlt } = {},
|
|
27
|
+
} = {},
|
|
28
|
+
}: RegionFilterButtonProps) {
|
|
29
|
+
const { openRegionSlider } = useUI()
|
|
30
|
+
const { globalPickupPoint } = useDeliveryPromise()
|
|
31
|
+
const regionFilterButtonRef = useRef<HTMLButtonElement>(null)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<UIButton
|
|
35
|
+
variant="tertiary"
|
|
36
|
+
size="small"
|
|
37
|
+
icon={
|
|
38
|
+
<UIIcon
|
|
39
|
+
name={filterByPickupPointIcon}
|
|
40
|
+
width={18}
|
|
41
|
+
height={18}
|
|
42
|
+
weight="bold"
|
|
43
|
+
aria-label={filterByPickupPointAlt}
|
|
44
|
+
/>
|
|
45
|
+
}
|
|
46
|
+
iconPosition="left"
|
|
47
|
+
onClick={() =>
|
|
48
|
+
openRegionSlider(regionSliderTypes.globalChangePickupPoint)
|
|
49
|
+
}
|
|
50
|
+
ref={regionFilterButtonRef}
|
|
51
|
+
>
|
|
52
|
+
{globalPickupPoint?.name ?? filterByPickupPointLabel}
|
|
53
|
+
</UIButton>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default RegionFilterButton
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './RegionFilterButton'
|
|
@@ -5,10 +5,12 @@ import type { RegionModalProps as UIRegionModalProps } from '@faststore/ui'
|
|
|
5
5
|
import { Icon, useUI } from '@faststore/ui'
|
|
6
6
|
|
|
7
7
|
import { deliveryPromise } from 'discovery.config'
|
|
8
|
+
import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
|
|
8
9
|
import { useSession } from 'src/sdk/session'
|
|
9
10
|
|
|
10
11
|
import useRegion from './useRegion'
|
|
11
12
|
|
|
13
|
+
import { getGlobalSettings } from 'src/utils/globalSettings'
|
|
12
14
|
import styles from './section.module.scss'
|
|
13
15
|
|
|
14
16
|
const UIRegionModal = dynamic<UIRegionModalProps>(
|
|
@@ -38,22 +40,29 @@ interface RegionModalProps {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
function RegionModal({
|
|
42
|
-
|
|
43
|
-
description,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
function RegionModal(regionModalProps: RegionModalProps) {
|
|
44
|
+
const { onPostalCodeChange } = useDeliveryPromise()
|
|
45
|
+
const { title, description, closeButtonAriaLabel, ...otherRegionModalProps } =
|
|
46
|
+
regionModalProps
|
|
47
|
+
const cmsData = getGlobalSettings(otherRegionModalProps)
|
|
48
|
+
const {
|
|
49
|
+
inputField: {
|
|
50
|
+
label: inputFieldLabel = '',
|
|
51
|
+
errorMessage: inputFieldErrorMessage = '',
|
|
52
|
+
noProductsAvailableErrorMessage:
|
|
53
|
+
inputFieldNoProductsAvailableErrorMessage = '',
|
|
54
|
+
buttonActionText: inputButtonActionText = '',
|
|
55
|
+
} = {},
|
|
56
|
+
idkPostalCodeLink: {
|
|
57
|
+
text: idkPostalCodeLinkText = '',
|
|
58
|
+
to: idkPostalCodeLinkTo = '',
|
|
59
|
+
icon: {
|
|
60
|
+
icon: idkPostalCodeLinkIcon = '',
|
|
61
|
+
alt: idkPostalCodeLinkIconAlt = '',
|
|
62
|
+
} = {},
|
|
63
|
+
} = {},
|
|
64
|
+
} = cmsData?.regionalization ?? {}
|
|
65
|
+
|
|
57
66
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
58
67
|
const { isValidating, ...session } = useSession()
|
|
59
68
|
const { modal: displayModal, closeModal } = useUI()
|
|
@@ -70,6 +79,7 @@ function RegionModal({
|
|
|
70
79
|
await setRegion({
|
|
71
80
|
session,
|
|
72
81
|
onSuccess: () => {
|
|
82
|
+
onPostalCodeChange()
|
|
73
83
|
setInput('')
|
|
74
84
|
closeModal()
|
|
75
85
|
},
|