@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
|
@@ -8,22 +8,23 @@ import {
|
|
|
8
8
|
} from 'src/components/cms/GlobalSections'
|
|
9
9
|
|
|
10
10
|
import { LinkButton } from '@faststore/ui'
|
|
11
|
+
import { gql } from '@generated/gql'
|
|
12
|
+
import type {
|
|
13
|
+
ServerAccountPageQueryQuery,
|
|
14
|
+
ServerAccountPageQueryQueryVariables,
|
|
15
|
+
} from '@generated/graphql'
|
|
11
16
|
import { MyAccountLayout } from 'src/components/account'
|
|
12
17
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
13
18
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
14
19
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
15
20
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
16
21
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
22
|
+
import { validateUser } from 'src/sdk/account/validateUser'
|
|
23
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
24
|
+
import { execute } from 'src/server'
|
|
17
25
|
import { type PageContentType, getPage } from 'src/server/cms'
|
|
18
26
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
19
27
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
20
|
-
import { gql } from '@generated/gql'
|
|
21
|
-
import { execute } from 'src/server'
|
|
22
|
-
import type {
|
|
23
|
-
ServerAccountPageQueryQuery,
|
|
24
|
-
ServerAccountPageQueryQueryVariables,
|
|
25
|
-
} from '@generated/graphql'
|
|
26
|
-
import { validateUser } from 'src/sdk/account/validateUser'
|
|
27
28
|
|
|
28
29
|
/* A list of components that can be used in the CMS. */
|
|
29
30
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -37,27 +38,29 @@ type Props = {
|
|
|
37
38
|
accountName: ServerAccountPageQueryQuery['accountName']
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
function Page({ globalSections, accountName }: Props) {
|
|
41
|
+
function Page({ globalSections: globalSectionsProp, accountName }: Props) {
|
|
42
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
43
|
+
globalSectionsProp ?? {}
|
|
44
|
+
|
|
41
45
|
return (
|
|
42
|
-
<
|
|
43
|
-
globalSections={globalSections
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</RenderSections>
|
|
46
|
+
<PageProvider context={{ globalSettings }}>
|
|
47
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
48
|
+
<NextSeo noindex nofollow />
|
|
49
|
+
|
|
50
|
+
<MyAccountLayout accountName={accountName}>
|
|
51
|
+
<EmptyState
|
|
52
|
+
title="Unauthorized Access"
|
|
53
|
+
titleIcon={{ icon: 'ShoppingCart', alt: 'Shopping Cart' }}
|
|
54
|
+
subtitle="You don't have permission to access this page."
|
|
55
|
+
showLoader={false}
|
|
56
|
+
>
|
|
57
|
+
<LinkButton variant="secondary" href="/account">
|
|
58
|
+
Back to Account
|
|
59
|
+
</LinkButton>
|
|
60
|
+
</EmptyState>
|
|
61
|
+
</MyAccountLayout>
|
|
62
|
+
</RenderSections>
|
|
63
|
+
</PageProvider>
|
|
61
64
|
)
|
|
62
65
|
}
|
|
63
66
|
|
|
@@ -7,6 +7,11 @@ import {
|
|
|
7
7
|
getGlobalSectionsData,
|
|
8
8
|
} from 'src/components/cms/GlobalSections'
|
|
9
9
|
|
|
10
|
+
import { gql } from '@generated/gql'
|
|
11
|
+
import type {
|
|
12
|
+
ServerAccountPageQueryQuery,
|
|
13
|
+
ServerAccountPageQueryQueryVariables,
|
|
14
|
+
} from '@generated/graphql'
|
|
10
15
|
import { MyAccountLayout } from 'src/components/account'
|
|
11
16
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
12
17
|
import RenderSections, {
|
|
@@ -15,16 +20,12 @@ import RenderSections, {
|
|
|
15
20
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
16
21
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
17
22
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
23
|
+
import { validateUser } from 'src/sdk/account/validateUser'
|
|
24
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
25
|
+
import { execute } from 'src/server'
|
|
18
26
|
import { type PageContentType, getPage } from 'src/server/cms'
|
|
19
27
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
20
28
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
21
|
-
import { gql } from '@generated/gql'
|
|
22
|
-
import { execute } from 'src/server'
|
|
23
|
-
import type {
|
|
24
|
-
ServerAccountPageQueryQuery,
|
|
25
|
-
ServerAccountPageQueryQueryVariables,
|
|
26
|
-
} from '@generated/graphql'
|
|
27
|
-
import { validateUser } from 'src/sdk/account/validateUser'
|
|
28
29
|
|
|
29
30
|
/* A list of components that can be used in the CMS. */
|
|
30
31
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -40,20 +41,26 @@ type Props = {
|
|
|
40
41
|
accountName: ServerAccountPageQueryQuery['accountName']
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
function Page({
|
|
44
|
+
function Page({
|
|
45
|
+
page: { sections },
|
|
46
|
+
globalSections: globalSectionsProp,
|
|
47
|
+
accountName,
|
|
48
|
+
}: Props) {
|
|
49
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
50
|
+
globalSectionsProp ?? {}
|
|
51
|
+
|
|
44
52
|
return (
|
|
45
|
-
<
|
|
46
|
-
globalSections={globalSections
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</RenderSections>
|
|
53
|
+
<PageProvider context={{ globalSettings }}>
|
|
54
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
55
|
+
<NextSeo noindex nofollow />
|
|
56
|
+
|
|
57
|
+
<MyAccountLayout accountName={accountName}>
|
|
58
|
+
{sections && sections.length > 0 && (
|
|
59
|
+
<RenderSectionsBase sections={sections} components={COMPONENTS} />
|
|
60
|
+
)}
|
|
61
|
+
</MyAccountLayout>
|
|
62
|
+
</RenderSections>
|
|
63
|
+
</PageProvider>
|
|
57
64
|
)
|
|
58
65
|
}
|
|
59
66
|
|
|
@@ -11,19 +11,20 @@ import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
|
|
|
11
11
|
import { validateUser } from 'src/sdk/account/validateUser'
|
|
12
12
|
|
|
13
13
|
import { gql } from '@generated'
|
|
14
|
+
import type {
|
|
15
|
+
ServerOrderDetailsQueryQuery,
|
|
16
|
+
ServerOrderDetailsQueryQueryVariables,
|
|
17
|
+
} from '@generated/graphql'
|
|
14
18
|
import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
|
|
15
19
|
import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/after'
|
|
16
20
|
import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/before'
|
|
17
21
|
import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
|
|
22
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
18
23
|
import { execute } from 'src/server'
|
|
19
24
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
20
25
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
21
26
|
import { extractStatusFromError } from 'src/utils/utilities'
|
|
22
27
|
import storeConfig from '../../../../discovery.config'
|
|
23
|
-
import type {
|
|
24
|
-
ServerOrderDetailsQueryQuery,
|
|
25
|
-
ServerOrderDetailsQueryQueryVariables,
|
|
26
|
-
} from '@generated/graphql'
|
|
27
28
|
|
|
28
29
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
29
30
|
...GLOBAL_COMPONENTS,
|
|
@@ -35,27 +36,29 @@ type OrderDetailsPageProps = {
|
|
|
35
36
|
} & MyAccountProps
|
|
36
37
|
|
|
37
38
|
export default function OrderDetailsPage({
|
|
38
|
-
globalSections,
|
|
39
|
+
globalSections: globalSectionsProp,
|
|
39
40
|
order,
|
|
40
41
|
accountName,
|
|
41
42
|
isRepresentative,
|
|
42
43
|
}: OrderDetailsPageProps) {
|
|
44
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
45
|
+
globalSectionsProp ?? {}
|
|
46
|
+
|
|
43
47
|
return (
|
|
44
|
-
<
|
|
45
|
-
globalSections={globalSections
|
|
46
|
-
|
|
47
|
-
>
|
|
48
|
-
<NextSeo noindex nofollow />
|
|
48
|
+
<PageProvider context={{ globalSettings }}>
|
|
49
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
50
|
+
<NextSeo noindex nofollow />
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
<MyAccountLayout
|
|
53
|
+
isRepresentative={isRepresentative}
|
|
54
|
+
accountName={accountName}
|
|
55
|
+
>
|
|
56
|
+
<BeforeSection />
|
|
57
|
+
<MyAccountOrderDetails order={order} />
|
|
58
|
+
<AfterSection />
|
|
59
|
+
</MyAccountLayout>
|
|
60
|
+
</RenderSections>
|
|
61
|
+
</PageProvider>
|
|
59
62
|
)
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -24,9 +24,10 @@ import { groupOrderStatusByLabel } from 'src/utils/userOrderStatus'
|
|
|
24
24
|
|
|
25
25
|
import { MyAccountListOrders } from 'src/components/account/orders/MyAccountListOrders'
|
|
26
26
|
import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
|
|
27
|
-
import storeConfig from '../../../../discovery.config'
|
|
28
27
|
import { validateUser } from 'src/sdk/account/validateUser'
|
|
28
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
29
29
|
import { extractStatusFromError } from 'src/utils/utilities'
|
|
30
|
+
import storeConfig from '../../../../discovery.config'
|
|
30
31
|
|
|
31
32
|
/* A list of components that can be used in the CMS. */
|
|
32
33
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -49,7 +50,7 @@ type ListOrdersPageProps = {
|
|
|
49
50
|
} & MyAccountProps
|
|
50
51
|
|
|
51
52
|
export default function ListOrdersPage({
|
|
52
|
-
globalSections,
|
|
53
|
+
globalSections: globalSectionsProp,
|
|
53
54
|
accountName,
|
|
54
55
|
listOrders,
|
|
55
56
|
total,
|
|
@@ -57,27 +58,29 @@ export default function ListOrdersPage({
|
|
|
57
58
|
filters,
|
|
58
59
|
isRepresentative,
|
|
59
60
|
}: ListOrdersPageProps) {
|
|
61
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
62
|
+
globalSectionsProp ?? {}
|
|
63
|
+
|
|
60
64
|
return (
|
|
61
|
-
<
|
|
62
|
-
globalSections={globalSections
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</RenderSections>
|
|
65
|
+
<PageProvider context={{ globalSettings }}>
|
|
66
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
67
|
+
<NextSeo noindex nofollow />
|
|
68
|
+
|
|
69
|
+
<MyAccountLayout
|
|
70
|
+
isRepresentative={isRepresentative}
|
|
71
|
+
accountName={accountName}
|
|
72
|
+
>
|
|
73
|
+
<BeforeSection />
|
|
74
|
+
<MyAccountListOrders
|
|
75
|
+
listOrders={listOrders}
|
|
76
|
+
filters={filters}
|
|
77
|
+
perPage={perPage}
|
|
78
|
+
total={total}
|
|
79
|
+
/>
|
|
80
|
+
<AfterSection />
|
|
81
|
+
</MyAccountLayout>
|
|
82
|
+
</RenderSections>
|
|
83
|
+
</PageProvider>
|
|
81
84
|
)
|
|
82
85
|
}
|
|
83
86
|
|
|
@@ -6,26 +6,28 @@ import type { GetServerSideProps } from 'next'
|
|
|
6
6
|
import { NextSeo } from 'next-seo'
|
|
7
7
|
import type { ComponentType } from 'react'
|
|
8
8
|
import { MyAccountLayout } from 'src/components/account'
|
|
9
|
+
import { ProfileSection } from 'src/components/account/profile'
|
|
9
10
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
10
11
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
11
12
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
12
|
-
import { ProfileSection } from 'src/components/account/profile'
|
|
13
13
|
|
|
14
14
|
import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
|
|
15
15
|
|
|
16
|
+
import { gql } from '@generated/gql'
|
|
17
|
+
import type {
|
|
18
|
+
ServerProfileQueryQuery,
|
|
19
|
+
ServerProfileQueryQueryVariables,
|
|
20
|
+
} from '@generated/graphql'
|
|
16
21
|
import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/profile/after'
|
|
17
22
|
import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/profile/before'
|
|
18
23
|
import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
|
|
19
24
|
import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
|
|
25
|
+
import { validateUser } from 'src/sdk/account/validateUser'
|
|
20
26
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
21
27
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
22
|
-
|
|
28
|
+
|
|
29
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
23
30
|
import { execute } from 'src/server'
|
|
24
|
-
import type {
|
|
25
|
-
ServerProfileQueryQuery,
|
|
26
|
-
ServerProfileQueryQueryVariables,
|
|
27
|
-
} from '@generated/graphql'
|
|
28
|
-
import { validateUser } from 'src/sdk/account/validateUser'
|
|
29
31
|
import storeConfig from '../../../discovery.config'
|
|
30
32
|
|
|
31
33
|
/* A list of components that can be used in the CMS. */
|
|
@@ -43,27 +45,29 @@ type ProfilePagePros = {
|
|
|
43
45
|
} & MyAccountProps
|
|
44
46
|
|
|
45
47
|
export default function Profile({
|
|
46
|
-
globalSections,
|
|
48
|
+
globalSections: globalSectionsProp,
|
|
47
49
|
accountName,
|
|
48
50
|
accountProfile,
|
|
49
51
|
isRepresentative,
|
|
50
52
|
}: ProfilePagePros) {
|
|
53
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
54
|
+
globalSectionsProp ?? {}
|
|
55
|
+
|
|
51
56
|
return (
|
|
52
|
-
<
|
|
53
|
-
globalSections={globalSections
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</RenderSections>
|
|
57
|
+
<PageProvider context={{ globalSettings }}>
|
|
58
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
59
|
+
<NextSeo noindex nofollow />
|
|
60
|
+
|
|
61
|
+
<MyAccountLayout
|
|
62
|
+
isRepresentative={isRepresentative}
|
|
63
|
+
accountName={accountName}
|
|
64
|
+
>
|
|
65
|
+
<BeforeSection />
|
|
66
|
+
<ProfileSection profile={accountProfile} />
|
|
67
|
+
<AfterSection />
|
|
68
|
+
</MyAccountLayout>
|
|
69
|
+
</RenderSections>
|
|
70
|
+
</PageProvider>
|
|
67
71
|
)
|
|
68
72
|
}
|
|
69
73
|
|
|
@@ -13,21 +13,24 @@ import type { GetServerSideProps } from 'next'
|
|
|
13
13
|
|
|
14
14
|
import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
|
|
15
15
|
|
|
16
|
+
import { gql } from '@generated/gql'
|
|
17
|
+
import type {
|
|
18
|
+
ServerSecurityQueryQuery,
|
|
19
|
+
ServerSecurityQueryQueryVariables,
|
|
20
|
+
} from '@generated/graphql'
|
|
16
21
|
import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/security/after'
|
|
17
22
|
import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/security/before'
|
|
18
23
|
import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
|
|
19
24
|
import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
|
|
25
|
+
import { execute } from 'src/server'
|
|
20
26
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
21
27
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
22
|
-
|
|
23
|
-
import { gql } from '@generated/gql'
|
|
24
|
-
import type {
|
|
25
|
-
ServerSecurityQueryQuery,
|
|
26
|
-
ServerSecurityQueryQueryVariables,
|
|
27
|
-
} from '@generated/graphql'
|
|
28
|
+
|
|
28
29
|
import { validateUser } from 'src/sdk/account/validateUser'
|
|
29
|
-
import
|
|
30
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
31
|
+
|
|
30
32
|
import { SecuritySection } from 'src/components/account/security'
|
|
33
|
+
import storeConfig from '../../../discovery.config'
|
|
31
34
|
|
|
32
35
|
/* A list of components that can be used in the CMS. */
|
|
33
36
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -40,26 +43,28 @@ type SecurityPageProps = {
|
|
|
40
43
|
} & MyAccountProps
|
|
41
44
|
|
|
42
45
|
export default function Page({
|
|
43
|
-
globalSections,
|
|
46
|
+
globalSections: globalSectionsProp,
|
|
44
47
|
accountName,
|
|
45
48
|
isRepresentative,
|
|
46
49
|
}: SecurityPageProps) {
|
|
50
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
51
|
+
globalSectionsProp ?? {}
|
|
52
|
+
|
|
47
53
|
return (
|
|
48
|
-
<
|
|
49
|
-
globalSections={globalSections
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</RenderSections>
|
|
54
|
+
<PageProvider context={{ globalSettings }}>
|
|
55
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
56
|
+
<NextSeo noindex nofollow />
|
|
57
|
+
|
|
58
|
+
<MyAccountLayout
|
|
59
|
+
isRepresentative={isRepresentative}
|
|
60
|
+
accountName={accountName}
|
|
61
|
+
>
|
|
62
|
+
<BeforeSection />
|
|
63
|
+
<SecuritySection />
|
|
64
|
+
<AfterSection />
|
|
65
|
+
</MyAccountLayout>
|
|
66
|
+
</RenderSections>
|
|
67
|
+
</PageProvider>
|
|
63
68
|
)
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -20,11 +20,12 @@ import { default as AfterSection } from 'src/customizations/src/myAccount/extens
|
|
|
20
20
|
import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/user-details/before'
|
|
21
21
|
import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
|
|
22
22
|
import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
|
|
23
|
+
import { validateUser } from 'src/sdk/account/validateUser'
|
|
24
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
23
25
|
import { execute } from 'src/server'
|
|
24
26
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
25
27
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
26
28
|
import storeConfig from '../../../discovery.config'
|
|
27
|
-
import { validateUser } from 'src/sdk/account/validateUser'
|
|
28
29
|
|
|
29
30
|
/* A list of components that can be used in the CMS. */
|
|
30
31
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -42,27 +43,29 @@ type UserDetailsPagePros = {
|
|
|
42
43
|
} & MyAccountProps
|
|
43
44
|
|
|
44
45
|
export default function Page({
|
|
45
|
-
globalSections,
|
|
46
|
+
globalSections: globalSectionsProp,
|
|
46
47
|
accountName,
|
|
47
48
|
isRepresentative,
|
|
48
49
|
userDetails,
|
|
49
50
|
}: UserDetailsPagePros) {
|
|
51
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
52
|
+
globalSectionsProp ?? {}
|
|
53
|
+
|
|
50
54
|
return (
|
|
51
|
-
<
|
|
52
|
-
globalSections={globalSections
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</RenderSections>
|
|
55
|
+
<PageProvider context={{ globalSettings }}>
|
|
56
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
57
|
+
<NextSeo noindex nofollow />
|
|
58
|
+
|
|
59
|
+
<MyAccountLayout
|
|
60
|
+
isRepresentative={isRepresentative}
|
|
61
|
+
accountName={accountName}
|
|
62
|
+
>
|
|
63
|
+
<BeforeSection />
|
|
64
|
+
<MyAccountUserDetails userDetails={userDetails} />
|
|
65
|
+
<AfterSection />
|
|
66
|
+
</MyAccountLayout>
|
|
67
|
+
</RenderSections>
|
|
68
|
+
</PageProvider>
|
|
66
69
|
)
|
|
67
70
|
}
|
|
68
71
|
|
package/src/pages/checkout.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
13
13
|
|
|
14
14
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
15
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
15
16
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
16
17
|
import storeConfig from '../../discovery.config'
|
|
17
18
|
|
|
@@ -25,20 +26,22 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
25
26
|
...CUSTOM_COMPONENTS,
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
function Page({ globalSections }: Props) {
|
|
29
|
+
function Page({ globalSections: globalSectionsProp }: Props) {
|
|
30
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
31
|
+
globalSectionsProp ?? {}
|
|
32
|
+
|
|
29
33
|
useEffect(() => {
|
|
30
34
|
window.location.href = storeConfig.checkoutUrl
|
|
31
35
|
}, [])
|
|
32
36
|
|
|
33
37
|
return (
|
|
34
|
-
<
|
|
35
|
-
globalSections={globalSections
|
|
36
|
-
|
|
37
|
-
>
|
|
38
|
-
<NextSeo noindex nofollow />
|
|
38
|
+
<PageProvider context={{ globalSettings }}>
|
|
39
|
+
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
40
|
+
<NextSeo noindex nofollow />
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
<div>loading...</div>
|
|
43
|
+
</RenderSections>
|
|
44
|
+
</PageProvider>
|
|
42
45
|
)
|
|
43
46
|
}
|
|
44
47
|
|
package/src/pages/index.tsx
CHANGED
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
import COMPONENTS from 'src/components/cms/home/Components'
|
|
12
12
|
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
13
13
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
14
|
-
import { getDynamicContent } from 'src/utils/dynamicContent'
|
|
15
|
-
import storeConfig from '../../discovery.config'
|
|
16
14
|
import { contentService } from 'src/server/content/service'
|
|
17
15
|
import type { PreviewData } from 'src/server/content/types'
|
|
16
|
+
import { getDynamicContent } from 'src/utils/dynamicContent'
|
|
17
|
+
import storeConfig from '../../discovery.config'
|
|
18
18
|
|
|
19
19
|
type Props = {
|
|
20
20
|
page: PageContentType
|
|
@@ -24,11 +24,14 @@ type Props = {
|
|
|
24
24
|
|
|
25
25
|
function Page({
|
|
26
26
|
page: { sections, settings },
|
|
27
|
-
globalSections,
|
|
27
|
+
globalSections: globalSectionsProp,
|
|
28
28
|
serverData,
|
|
29
29
|
}: Props) {
|
|
30
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
31
|
+
globalSectionsProp ?? {}
|
|
30
32
|
const context = {
|
|
31
33
|
data: serverData,
|
|
34
|
+
globalSettings,
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
const publisherId = settings?.seo?.publisherId ?? storeConfig.seo.publisherId
|
|
@@ -134,7 +137,7 @@ function Page({
|
|
|
134
137
|
*/}
|
|
135
138
|
<PageProvider context={context}>
|
|
136
139
|
<RenderSections
|
|
137
|
-
globalSections={globalSections
|
|
140
|
+
globalSections={globalSections}
|
|
138
141
|
sections={sections}
|
|
139
142
|
components={COMPONENTS}
|
|
140
143
|
/>
|
package/src/pages/login.tsx
CHANGED
|
@@ -12,11 +12,12 @@ import RenderSections from 'src/components/cms/RenderSections'
|
|
|
12
12
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
13
13
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
14
14
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
15
|
+
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
15
16
|
import type { PageContentType } from 'src/server/cms'
|
|
16
17
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
17
|
-
import storeConfig from '../../discovery.config'
|
|
18
18
|
import { contentService } from 'src/server/content/service'
|
|
19
19
|
import type { PreviewData } from 'src/server/content/types'
|
|
20
|
+
import storeConfig from '../../discovery.config'
|
|
20
21
|
|
|
21
22
|
/* A list of components that can be used in the CMS. */
|
|
22
23
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -31,7 +32,13 @@ type Props = {
|
|
|
31
32
|
globalSections: GlobalSectionsData
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
function Page({
|
|
35
|
+
function Page({
|
|
36
|
+
page: { sections },
|
|
37
|
+
globalSections: globalSectionsProp,
|
|
38
|
+
}: Props) {
|
|
39
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
40
|
+
globalSectionsProp ?? {}
|
|
41
|
+
|
|
35
42
|
useEffect(() => {
|
|
36
43
|
const loginUrl = new URL(storeConfig.loginUrl)
|
|
37
44
|
const incomingParams = new URLSearchParams(window.location.search)
|
|
@@ -57,11 +64,13 @@ function Page({ page: { sections }, globalSections }: Props) {
|
|
|
57
64
|
If needed, wrap your component in a <Section /> component
|
|
58
65
|
(not the HTML tag) before rendering it here.
|
|
59
66
|
*/}
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
<PageProvider context={{ globalSettings }}>
|
|
68
|
+
<RenderSections
|
|
69
|
+
sections={sections}
|
|
70
|
+
globalSections={globalSections}
|
|
71
|
+
components={COMPONENTS}
|
|
72
|
+
/>
|
|
73
|
+
</PageProvider>
|
|
65
74
|
</>
|
|
66
75
|
)
|
|
67
76
|
}
|
package/src/pages/s.tsx
CHANGED
|
@@ -97,9 +97,11 @@ function generateSEOData(storeConfig: StoreConfig, searchTerm?: string) {
|
|
|
97
97
|
|
|
98
98
|
function Page({
|
|
99
99
|
page: searchContentType,
|
|
100
|
-
globalSections,
|
|
100
|
+
globalSections: globalSectionsProp,
|
|
101
101
|
searchTerm,
|
|
102
102
|
}: SearchPageProps) {
|
|
103
|
+
const { sections: globalSections, settings: globalSettings } =
|
|
104
|
+
globalSectionsProp ?? {}
|
|
103
105
|
const { settings } = searchContentType
|
|
104
106
|
const applySearchState = useApplySearchState()
|
|
105
107
|
const searchParams = useSearchParams({
|
|
@@ -146,7 +148,8 @@ function Page({
|
|
|
146
148
|
title: seoData.title,
|
|
147
149
|
searchTerm: searchTerm ?? searchParams.term ?? undefined,
|
|
148
150
|
}}
|
|
149
|
-
globalSections={globalSections
|
|
151
|
+
globalSections={globalSections}
|
|
152
|
+
globalSettings={globalSettings}
|
|
150
153
|
/>
|
|
151
154
|
</SearchProvider>
|
|
152
155
|
)
|