@faststore/core 2.0.117-alpha.0 → 2.0.120-alpha.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/.turbo/turbo-build.log +38 -26
- package/CHANGELOG.md +10 -0
- package/cms/faststore/content-types.json +6 -0
- package/cms/faststore/sections.json +8 -0
- package/package.json +3 -3
- package/src/Layout.tsx +2 -24
- package/src/components/cms/GlobalSections.tsx +81 -0
- package/src/components/cms/RenderSections.tsx +39 -0
- package/src/components/common/Alert/Alert.tsx +7 -5
- package/src/components/common/Alert/index.ts +1 -0
- package/src/components/sections/Alert/Alert.tsx +28 -0
- package/src/pages/404.tsx +25 -3
- package/src/pages/500.tsx +25 -3
- package/src/pages/[...slug].tsx +85 -66
- package/src/pages/[slug]/p.tsx +16 -6
- package/src/pages/account.tsx +25 -3
- package/src/pages/checkout.tsx +25 -3
- package/src/pages/index.tsx +20 -10
- package/src/pages/login.tsx +25 -3
- package/src/pages/s.tsx +63 -39
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -99
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -1
- 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/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -42
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/120.js +0 -435
- package/.next/server/chunks/123.js +0 -58
- package/.next/server/chunks/1394.js +0 -3801
- package/.next/server/chunks/1597.js +0 -151
- package/.next/server/chunks/1608.js +0 -515
- package/.next/server/chunks/2154.js +0 -206
- package/.next/server/chunks/247.js +0 -61
- package/.next/server/chunks/2502.js +0 -584
- package/.next/server/chunks/2914.js +0 -95
- package/.next/server/chunks/2922.js +0 -7293
- package/.next/server/chunks/3264.js +0 -67
- package/.next/server/chunks/3431.js +0 -7241
- package/.next/server/chunks/350.js +0 -142
- package/.next/server/chunks/3746.js +0 -250
- package/.next/server/chunks/3898.js +0 -240
- package/.next/server/chunks/4312.js +0 -674
- package/.next/server/chunks/4371.js +0 -1424
- package/.next/server/chunks/5098.js +0 -124
- package/.next/server/chunks/5335.js +0 -544
- package/.next/server/chunks/5576.js +0 -79
- package/.next/server/chunks/6280.js +0 -322
- package/.next/server/chunks/6465.js +0 -91
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/6859.js +0 -959
- package/.next/server/chunks/6881.js +0 -320
- package/.next/server/chunks/6898.js +0 -149
- package/.next/server/chunks/7104.js +0 -235
- package/.next/server/chunks/7181.js +0 -664
- package/.next/server/chunks/7183.js +0 -79
- package/.next/server/chunks/8098.js +0 -246
- package/.next/server/chunks/810.js +0 -432
- package/.next/server/chunks/8287.js +0 -58
- package/.next/server/chunks/9143.js +0 -106
- package/.next/server/chunks/9557.js +0 -119
- package/.next/server/chunks/9854.js +0 -72
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -666
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2327
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -2454
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -304
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -315
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -118
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -475
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -16
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
- package/.next/static/chunks/170.79b2f8527e327bca.js +0 -1
- package/.next/static/chunks/264-5b07911df63b8601.js +0 -1
- package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
- package/.next/static/chunks/54.e6562383f8a1dfe7.js +0 -1
- package/.next/static/chunks/597.fc79494903e8bb84.js +0 -1
- package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/781-e1b538e051ff4c3e.js +0 -1
- package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
- package/.next/static/chunks/996.98e590872c51f815.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
- package/.next/static/chunks/pages/404-3637ef83b3359df7.js +0 -1
- package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
- package/.next/static/chunks/pages/[...slug]-29d3b81ee0953846.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-9b24055cb30ee7a8.js +0 -1
- package/.next/static/chunks/pages/_app-4aeb21d72aeea9b7.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-b8fc5222ffe89b60.js +0 -1
- package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
- package/.next/static/chunks/pages/index-d48285f48d2a66ea.js +0 -1
- package/.next/static/chunks/pages/login-45cc84352bac2408.js +0 -1
- package/.next/static/chunks/pages/s-ba2868e14fedb65b.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-f725b61675603493.js +0 -1
- package/.next/static/css/1f987650dd4e39d0.css +0 -1
- package/.next/static/css/3a57acf6e411f24d.css +0 -1
- package/.next/static/css/4abccf9803c3c356.css +0 -1
- package/.next/static/css/502746c995f64cce.css +0 -1
- package/.next/static/css/6507cb48401e73a4.css +0 -1
- package/.next/static/css/6f4d3e91f1d161a8.css +0 -1
- package/.next/static/kFT8gMGQbscGgKaZLxG_K/_buildManifest.js +0 -1
- package/.next/static/kFT8gMGQbscGgKaZLxG_K/_ssgManifest.js +0 -1
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/trace +0 -64
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
- package/src/components/cms/RenderPageSections.tsx +0 -37
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ServerProductPageQueryQuery,
|
|
10
10
|
ServerProductPageQueryQueryVariables,
|
|
11
11
|
} from '@generated/graphql'
|
|
12
|
-
import
|
|
12
|
+
import RenderSections from 'src/components/cms/RenderSections'
|
|
13
13
|
import BannerNewsletter from 'src/components/sections/BannerNewsletter/BannerNewsletter'
|
|
14
14
|
import CrossSellingShelf from 'src/components/sections/CrossSellingShelf'
|
|
15
15
|
import ProductDetails from 'src/components/sections/ProductDetails'
|
|
@@ -21,6 +21,10 @@ import type { PDPContentType } from 'src/server/cms'
|
|
|
21
21
|
import { getPage } from 'src/server/cms'
|
|
22
22
|
|
|
23
23
|
import storeConfig from '../../../faststore.config'
|
|
24
|
+
import GlobalSections, {
|
|
25
|
+
GlobalSectionsData,
|
|
26
|
+
getGlobalSectionsData,
|
|
27
|
+
} from 'src/components/cms/GlobalSections'
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
30
|
* Sections: Components imported from each store's custom components and '../components/sections' only.
|
|
@@ -33,9 +37,12 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
33
37
|
...CUSTOM_COMPONENTS,
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
type Props = ServerProductPageQueryQuery &
|
|
40
|
+
type Props = ServerProductPageQueryQuery &
|
|
41
|
+
PDPContentType & {
|
|
42
|
+
globalSections: GlobalSectionsData
|
|
43
|
+
}
|
|
37
44
|
|
|
38
|
-
function Page({ product, sections }: Props) {
|
|
45
|
+
function Page({ product, sections, globalSections }: Props) {
|
|
39
46
|
const { currency } = useSession()
|
|
40
47
|
const { seo } = product
|
|
41
48
|
const title = seo.title || storeConfig.seo.title
|
|
@@ -43,7 +50,7 @@ function Page({ product, sections }: Props) {
|
|
|
43
50
|
const canonical = `${storeConfig.storeUrl}${seo.canonical}`
|
|
44
51
|
|
|
45
52
|
return (
|
|
46
|
-
|
|
53
|
+
<GlobalSections {...globalSections}>
|
|
47
54
|
{/* SEO */}
|
|
48
55
|
<NextSeo
|
|
49
56
|
title={title}
|
|
@@ -100,12 +107,12 @@ function Page({ product, sections }: Props) {
|
|
|
100
107
|
If needed, wrap your component in a <Section /> component
|
|
101
108
|
(not the HTML tag) before rendering it here.
|
|
102
109
|
*/}
|
|
103
|
-
<
|
|
110
|
+
<RenderSections
|
|
104
111
|
context={product}
|
|
105
112
|
sections={sections}
|
|
106
113
|
components={COMPONENTS}
|
|
107
114
|
/>
|
|
108
|
-
|
|
115
|
+
</GlobalSections>
|
|
109
116
|
)
|
|
110
117
|
}
|
|
111
118
|
|
|
@@ -199,10 +206,13 @@ export const getStaticProps: GetStaticProps<
|
|
|
199
206
|
throw errors[0]
|
|
200
207
|
}
|
|
201
208
|
|
|
209
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
210
|
+
|
|
202
211
|
return {
|
|
203
212
|
props: {
|
|
204
213
|
...data,
|
|
205
214
|
...cmsPage,
|
|
215
|
+
globalSections,
|
|
206
216
|
},
|
|
207
217
|
}
|
|
208
218
|
}
|
package/src/pages/account.tsx
CHANGED
|
@@ -2,19 +2,41 @@ import { useEffect } from 'react'
|
|
|
2
2
|
import { NextSeo } from 'next-seo'
|
|
3
3
|
|
|
4
4
|
import storeConfig from '../../faststore.config'
|
|
5
|
+
import GlobalSections, {
|
|
6
|
+
GlobalSectionsData,
|
|
7
|
+
getGlobalSectionsData,
|
|
8
|
+
} from 'src/components/cms/GlobalSections'
|
|
9
|
+
import { GetStaticProps } from 'next'
|
|
10
|
+
import { Locator } from '@vtex/client-cms'
|
|
5
11
|
|
|
6
|
-
|
|
12
|
+
type Props = {
|
|
13
|
+
globalSections: GlobalSectionsData
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function Page({ globalSections }: Props) {
|
|
7
17
|
useEffect(() => {
|
|
8
18
|
window.location.href = `${storeConfig.accountUrl}${window.location.search}`
|
|
9
19
|
}, [])
|
|
10
20
|
|
|
11
21
|
return (
|
|
12
|
-
|
|
22
|
+
<GlobalSections {...globalSections}>
|
|
13
23
|
<NextSeo noindex nofollow />
|
|
14
24
|
|
|
15
25
|
<div>loading...</div>
|
|
16
|
-
|
|
26
|
+
</GlobalSections>
|
|
17
27
|
)
|
|
18
28
|
}
|
|
19
29
|
|
|
30
|
+
export const getStaticProps: GetStaticProps<
|
|
31
|
+
Props,
|
|
32
|
+
Record<string, string>,
|
|
33
|
+
Locator
|
|
34
|
+
> = async ({ previewData }) => {
|
|
35
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
props: { globalSections },
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
20
42
|
export default Page
|
package/src/pages/checkout.tsx
CHANGED
|
@@ -2,19 +2,41 @@ import { useEffect } from 'react'
|
|
|
2
2
|
import { NextSeo } from 'next-seo'
|
|
3
3
|
|
|
4
4
|
import storeConfig from '../../faststore.config'
|
|
5
|
+
import GlobalSections, {
|
|
6
|
+
GlobalSectionsData,
|
|
7
|
+
getGlobalSectionsData,
|
|
8
|
+
} from 'src/components/cms/GlobalSections'
|
|
9
|
+
import { GetStaticProps } from 'next'
|
|
10
|
+
import { Locator } from '@vtex/client-cms'
|
|
5
11
|
|
|
6
|
-
|
|
12
|
+
type Props = {
|
|
13
|
+
globalSections: GlobalSectionsData
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function Page({ globalSections }: Props) {
|
|
7
17
|
useEffect(() => {
|
|
8
18
|
window.location.href = storeConfig.checkoutUrl
|
|
9
19
|
}, [])
|
|
10
20
|
|
|
11
21
|
return (
|
|
12
|
-
|
|
22
|
+
<GlobalSections {...globalSections}>
|
|
13
23
|
<NextSeo noindex nofollow />
|
|
14
24
|
|
|
15
25
|
<div>loading...</div>
|
|
16
|
-
|
|
26
|
+
</GlobalSections>
|
|
17
27
|
)
|
|
18
28
|
}
|
|
19
29
|
|
|
30
|
+
export const getStaticProps: GetStaticProps<
|
|
31
|
+
Props,
|
|
32
|
+
Record<string, string>,
|
|
33
|
+
Locator
|
|
34
|
+
> = async ({ previewData }) => {
|
|
35
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
props: { globalSections },
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
20
42
|
export default Page
|
package/src/pages/index.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import type { GetStaticProps } from 'next'
|
|
|
3
3
|
import { NextSeo, SiteLinksSearchBoxJsonLd } from 'next-seo'
|
|
4
4
|
import type { ComponentType } from 'react'
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import RenderSections from 'src/components/cms/RenderSections'
|
|
7
7
|
import BannerText from 'src/components/sections/BannerText'
|
|
8
8
|
import Hero from 'src/components/sections/Hero'
|
|
9
9
|
import IncentivesHeader from 'src/components/sections/Incentives/IncentivesHeader'
|
|
@@ -16,6 +16,10 @@ import type { PageContentType } from 'src/server/cms'
|
|
|
16
16
|
import { getPage } from 'src/server/cms'
|
|
17
17
|
|
|
18
18
|
import storeConfig from '../../faststore.config'
|
|
19
|
+
import GlobalSections, {
|
|
20
|
+
GlobalSectionsData,
|
|
21
|
+
getGlobalSectionsData,
|
|
22
|
+
} from 'src/components/cms/GlobalSections'
|
|
19
23
|
|
|
20
24
|
/* A list of components that can be used in the CMS. */
|
|
21
25
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -28,11 +32,14 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
28
32
|
...CUSTOM_COMPONENTS,
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
type Props =
|
|
35
|
+
type Props = {
|
|
36
|
+
page: PageContentType
|
|
37
|
+
globalSections: GlobalSectionsData
|
|
38
|
+
}
|
|
32
39
|
|
|
33
|
-
function Page({ sections, settings }: Props) {
|
|
40
|
+
function Page({ page: { sections, settings }, globalSections }: Props) {
|
|
34
41
|
return (
|
|
35
|
-
|
|
42
|
+
<GlobalSections {...globalSections}>
|
|
36
43
|
{/* SEO */}
|
|
37
44
|
<NextSeo
|
|
38
45
|
title={settings.seo.title}
|
|
@@ -67,8 +74,8 @@ function Page({ sections, settings }: Props) {
|
|
|
67
74
|
If needed, wrap your component in a <Section /> component
|
|
68
75
|
(not the HTML tag) before rendering it here.
|
|
69
76
|
*/}
|
|
70
|
-
<
|
|
71
|
-
|
|
77
|
+
<RenderSections sections={sections} components={COMPONENTS} />
|
|
78
|
+
</GlobalSections>
|
|
72
79
|
)
|
|
73
80
|
}
|
|
74
81
|
|
|
@@ -76,18 +83,21 @@ export const getStaticProps: GetStaticProps<
|
|
|
76
83
|
Props,
|
|
77
84
|
Record<string, string>,
|
|
78
85
|
Locator
|
|
79
|
-
> = async (
|
|
86
|
+
> = async ({ previewData }) => {
|
|
80
87
|
const page = await getPage<PageContentType>({
|
|
81
|
-
...(
|
|
82
|
-
?
|
|
88
|
+
...(previewData?.contentType === 'page'
|
|
89
|
+
? previewData
|
|
83
90
|
: { filters: { 'settings.seo.slug': '/' } }),
|
|
84
91
|
contentType: 'page',
|
|
85
92
|
})
|
|
86
93
|
|
|
94
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
95
|
+
|
|
87
96
|
return {
|
|
88
|
-
props: page,
|
|
97
|
+
props: { page, globalSections },
|
|
89
98
|
}
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
Page.displayName = 'Page'
|
|
102
|
+
|
|
93
103
|
export default mark(Page)
|
package/src/pages/login.tsx
CHANGED
|
@@ -3,21 +3,43 @@ import { NextSeo } from 'next-seo'
|
|
|
3
3
|
import { EmptyState as UIEmptyState, Loader as UILoader } from '@faststore/ui'
|
|
4
4
|
|
|
5
5
|
import storeConfig from '../../faststore.config'
|
|
6
|
+
import GlobalSections, {
|
|
7
|
+
GlobalSectionsData,
|
|
8
|
+
getGlobalSectionsData,
|
|
9
|
+
} from 'src/components/cms/GlobalSections'
|
|
10
|
+
import { GetStaticProps } from 'next'
|
|
11
|
+
import { Locator } from '@vtex/client-cms'
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
type Props = {
|
|
14
|
+
globalSections: GlobalSectionsData
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function Page({ globalSections }: Props) {
|
|
8
18
|
useEffect(() => {
|
|
9
19
|
window.location.href = `${storeConfig.loginUrl}${window.location.search}`
|
|
10
20
|
}, [])
|
|
11
21
|
|
|
12
22
|
return (
|
|
13
|
-
|
|
23
|
+
<GlobalSections {...globalSections}>
|
|
14
24
|
<NextSeo noindex nofollow />
|
|
15
25
|
|
|
16
26
|
<UIEmptyState title="Loading" bkgColor="light">
|
|
17
27
|
<UILoader />
|
|
18
28
|
</UIEmptyState>
|
|
19
|
-
|
|
29
|
+
</GlobalSections>
|
|
20
30
|
)
|
|
21
31
|
}
|
|
22
32
|
|
|
33
|
+
export const getStaticProps: GetStaticProps<
|
|
34
|
+
Props,
|
|
35
|
+
Record<string, string>,
|
|
36
|
+
Locator
|
|
37
|
+
> = async ({ previewData }) => {
|
|
38
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
props: { globalSections },
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
23
45
|
export default Page
|
package/src/pages/s.tsx
CHANGED
|
@@ -12,6 +12,16 @@ import { useApplySearchState } from 'src/sdk/search/state'
|
|
|
12
12
|
import { mark } from 'src/sdk/tests/mark'
|
|
13
13
|
|
|
14
14
|
import storeConfig from '../../faststore.config'
|
|
15
|
+
import GlobalSections, {
|
|
16
|
+
getGlobalSectionsData,
|
|
17
|
+
GlobalSectionsData,
|
|
18
|
+
} from 'src/components/cms/GlobalSections'
|
|
19
|
+
import { Locator } from '@vtex/client-cms'
|
|
20
|
+
import { GetStaticProps } from 'next'
|
|
21
|
+
|
|
22
|
+
type Props = {
|
|
23
|
+
globalSections: GlobalSectionsData
|
|
24
|
+
}
|
|
15
25
|
|
|
16
26
|
const useSearchParams = () => {
|
|
17
27
|
const [params, setParams] = useState<SearchState | null>(null)
|
|
@@ -26,7 +36,7 @@ const useSearchParams = () => {
|
|
|
26
36
|
return params
|
|
27
37
|
}
|
|
28
38
|
|
|
29
|
-
function Page() {
|
|
39
|
+
function Page({ globalSections }: Props) {
|
|
30
40
|
const searchParams = useSearchParams()
|
|
31
41
|
const applySearchState = useApplySearchState()
|
|
32
42
|
const title = 'Search Results'
|
|
@@ -37,47 +47,61 @@ function Page() {
|
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
return (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
50
|
+
<GlobalSections {...globalSections}>
|
|
51
|
+
<SearchProvider
|
|
52
|
+
onChange={applySearchState}
|
|
53
|
+
itemsPerPage={ITEMS_PER_PAGE}
|
|
54
|
+
{...searchParams}
|
|
55
|
+
>
|
|
56
|
+
{/* SEO */}
|
|
57
|
+
<NextSeo
|
|
58
|
+
noindex
|
|
59
|
+
title={title}
|
|
60
|
+
description={description}
|
|
61
|
+
titleTemplate={titleTemplate}
|
|
62
|
+
openGraph={{
|
|
63
|
+
type: 'website',
|
|
64
|
+
title,
|
|
65
|
+
description,
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<UISROnly as="h1" text={title} />
|
|
70
|
+
|
|
71
|
+
{/*
|
|
72
|
+
WARNING: Do not import or render components from any
|
|
73
|
+
other folder than '../components/sections' in here.
|
|
74
|
+
|
|
75
|
+
This is necessary to keep the integration with the CMS
|
|
76
|
+
easy and consistent, enabling the change and reorder
|
|
77
|
+
of elements on this page.
|
|
78
|
+
|
|
79
|
+
If needed, wrap your component in a <Section /> component
|
|
80
|
+
(not the HTML tag) before rendering it here.
|
|
81
|
+
*/}
|
|
82
|
+
<Breadcrumb name="All Products" />
|
|
83
|
+
|
|
84
|
+
<ProductGallery
|
|
85
|
+
title="Search Results"
|
|
86
|
+
searchTerm={searchParams.term ?? undefined}
|
|
87
|
+
/>
|
|
88
|
+
</SearchProvider>
|
|
89
|
+
</GlobalSections>
|
|
78
90
|
)
|
|
79
91
|
}
|
|
80
92
|
|
|
93
|
+
export const getStaticProps: GetStaticProps<
|
|
94
|
+
Props,
|
|
95
|
+
Record<string, string>,
|
|
96
|
+
Locator
|
|
97
|
+
> = async ({ previewData }) => {
|
|
98
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
props: { globalSections },
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
81
105
|
Page.displayName = 'Page'
|
|
82
106
|
|
|
83
107
|
export default mark(Page)
|
package/.next/BUILD_ID
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
kFT8gMGQbscGgKaZLxG_K
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"polyfillFiles": [
|
|
3
|
-
"static/chunks/polyfills-c67a75d1b6f99dc8.js"
|
|
4
|
-
],
|
|
5
|
-
"devFiles": [],
|
|
6
|
-
"ampDevFiles": [],
|
|
7
|
-
"lowPriorityFiles": [
|
|
8
|
-
"static/kFT8gMGQbscGgKaZLxG_K/_buildManifest.js",
|
|
9
|
-
"static/kFT8gMGQbscGgKaZLxG_K/_ssgManifest.js"
|
|
10
|
-
],
|
|
11
|
-
"rootMainFiles": [],
|
|
12
|
-
"pages": {
|
|
13
|
-
"/": [
|
|
14
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
15
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
16
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
17
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
18
|
-
"static/chunks/781-e1b538e051ff4c3e.js",
|
|
19
|
-
"static/css/3a57acf6e411f24d.css",
|
|
20
|
-
"static/chunks/pages/index-d48285f48d2a66ea.js"
|
|
21
|
-
],
|
|
22
|
-
"/404": [
|
|
23
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
24
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
25
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
26
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
27
|
-
"static/chunks/pages/404-3637ef83b3359df7.js"
|
|
28
|
-
],
|
|
29
|
-
"/500": [
|
|
30
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
31
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
32
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
33
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
34
|
-
"static/chunks/pages/500-910883c20541d9ce.js"
|
|
35
|
-
],
|
|
36
|
-
"/[...slug]": [
|
|
37
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
38
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
39
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
40
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
41
|
-
"static/chunks/264-5b07911df63b8601.js",
|
|
42
|
-
"static/css/1f987650dd4e39d0.css",
|
|
43
|
-
"static/chunks/pages/[...slug]-29d3b81ee0953846.js"
|
|
44
|
-
],
|
|
45
|
-
"/[slug]/p": [
|
|
46
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
47
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
48
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
49
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
50
|
-
"static/chunks/781-e1b538e051ff4c3e.js",
|
|
51
|
-
"static/css/4abccf9803c3c356.css",
|
|
52
|
-
"static/chunks/pages/[slug]/p-9b24055cb30ee7a8.js"
|
|
53
|
-
],
|
|
54
|
-
"/_app": [
|
|
55
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
56
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
57
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
58
|
-
"static/css/502746c995f64cce.css",
|
|
59
|
-
"static/chunks/pages/_app-4aeb21d72aeea9b7.js"
|
|
60
|
-
],
|
|
61
|
-
"/_error": [
|
|
62
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
63
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
64
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
65
|
-
"static/chunks/pages/_error-a7a0c1d9bfbb4f38.js"
|
|
66
|
-
],
|
|
67
|
-
"/account": [
|
|
68
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
69
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
70
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
71
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
72
|
-
"static/chunks/pages/account-b8fc5222ffe89b60.js"
|
|
73
|
-
],
|
|
74
|
-
"/checkout": [
|
|
75
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
76
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
77
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
78
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
79
|
-
"static/chunks/pages/checkout-f8cb7cb22225ef9d.js"
|
|
80
|
-
],
|
|
81
|
-
"/login": [
|
|
82
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
83
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
84
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
85
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
86
|
-
"static/chunks/pages/login-45cc84352bac2408.js"
|
|
87
|
-
],
|
|
88
|
-
"/s": [
|
|
89
|
-
"static/chunks/webpack-f725b61675603493.js",
|
|
90
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
91
|
-
"static/chunks/main-9746772201fe3ac1.js",
|
|
92
|
-
"static/chunks/351-a4e28d64f48c5269.js",
|
|
93
|
-
"static/chunks/264-5b07911df63b8601.js",
|
|
94
|
-
"static/css/6f4d3e91f1d161a8.css",
|
|
95
|
-
"static/chunks/pages/s-ba2868e14fedb65b.js"
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
"ampFirstPages": []
|
|
99
|
-
}
|