@faststore/core 0.3.14 → 0.3.15
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/.eslintrc.json +3 -0
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/cypress/integration/analytics.test.js +24 -5
- package/cypress/integration/cart.test.js +4 -2
- package/cypress/integration/plp.test.js +1 -1
- package/cypress/integration/search.test.js +6 -1
- package/package.json +6 -7
- package/src/components/cms/RenderPageSections.tsx +0 -1
- package/src/components/common/Footer/Footer.tsx +9 -9
- package/src/components/sections/Hero/Hero.tsx +28 -77
- package/src/components/ui/Price/Price.tsx +2 -3
- package/src/components/ui/ShippingSimulation/useShippingSimulation.ts +1 -1
- package/src/customizations/components/index.ts +1 -0
- package/src/pages/[...slug].tsx +8 -8
- package/src/pages/s.tsx +2 -2
- package/src/sdk/error/ErrorBoundary/ErrorBoundary.tsx +0 -1
- package/src/sdk/ui/useOnClickOutside.ts +0 -1
- package/src/server/cms.ts +0 -1
- package/vtex.env +2 -2
- package/.eslintignore +0 -8
- package/.eslintrc +0 -21
- package/bun.lockb +0 -0
- package/renovate.json +0 -5
- package/src/components/sections/Hero/Hero.stories.mdx +0 -277
- package/src/components/sections/Hero/hero.module.scss +0 -180
- package/src/components/ui/SROnly/SROnly.tsx +0 -20
- package/src/components/ui/SROnly/index.ts +0 -1
- package/src/components/ui/SROnly/sr-only.module.scss +0 -15
- package/src/components/ui/Toggle/Toggle.stories.mdx +0 -604
- package/src/components/ui/Toggle/Toggle.tsx +0 -75
- package/src/components/ui/Toggle/index.ts +0 -2
- package/src/components/ui/Toggle/toggle.module.scss +0 -200
package/.eslintrc.json
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog),
|
|
6
6
|
and this project adheres to [Calendar Versioning](https://calver.org/).
|
|
7
7
|
|
|
8
|
+
### 0.3.15 (2023-01-03)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Replaces SROnly & Toggle & ToggleField FSUI ([#335](https://github.com/vtex-sites/nextjs.store/issues/335)) ([b096874](https://github.com/vtex-sites/nextjs.store/commit/b096874cae5e24fb4bfbdfd612f6bcc1f2f6bb25))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Chores
|
|
17
|
+
|
|
18
|
+
* Replaces `Hero` FSUI ([#324](https://github.com/vtex-sites/nextjs.store/issues/324)) ([ff40590](https://github.com/vtex-sites/nextjs.store/commit/ff40590e07716ab5d1a2b2020d9b668f73b24c90))
|
|
19
|
+
|
|
8
20
|
### [0.3.14](https://github.com/vtex-sites/nextjs.store/compare/0.3.13...0.3.14) (2022-12-19)
|
|
9
21
|
|
|
10
22
|
|
package/README.md
CHANGED
|
@@ -73,6 +73,8 @@ describe('add_to_cart event', () => {
|
|
|
73
73
|
|
|
74
74
|
// Add to cart
|
|
75
75
|
cy.getById('buy-button')
|
|
76
|
+
.should('be.visible')
|
|
77
|
+
.scrollIntoView({ duration: 500 })
|
|
76
78
|
.click()
|
|
77
79
|
.then(($btn) => {
|
|
78
80
|
cy.itemsInCart(1)
|
|
@@ -92,6 +94,8 @@ describe('add_to_cart event', () => {
|
|
|
92
94
|
|
|
93
95
|
// Add to cart
|
|
94
96
|
cy.getById('buy-button')
|
|
97
|
+
.should('be.visible')
|
|
98
|
+
.scrollIntoView({ duration: 500 })
|
|
95
99
|
.click()
|
|
96
100
|
.then(($btn) => {
|
|
97
101
|
cy.itemsInCart(1)
|
|
@@ -143,7 +147,7 @@ describe('remove_from_cart event', () => {
|
|
|
143
147
|
|
|
144
148
|
context('when removing a product from cart', () => {
|
|
145
149
|
beforeEach(() => {
|
|
146
|
-
cy.getById('remove-from-cart-button').click()
|
|
150
|
+
cy.getById('remove-from-cart-button').should('be.visible').click()
|
|
147
151
|
})
|
|
148
152
|
|
|
149
153
|
it('adds remove_from_cart event in the data layer', () => {
|
|
@@ -154,10 +158,14 @@ describe('remove_from_cart event', () => {
|
|
|
154
158
|
|
|
155
159
|
// Add item to cart
|
|
156
160
|
cy.getById('buy-button')
|
|
161
|
+
.should('be.visible')
|
|
162
|
+
.scrollIntoView({ duration: 500 })
|
|
157
163
|
.click()
|
|
158
164
|
.then(() => {
|
|
159
165
|
cy.itemsInCart(1)
|
|
160
|
-
cy.getById('checkout-button')
|
|
166
|
+
cy.getById('checkout-button')
|
|
167
|
+
.should('be.visible')
|
|
168
|
+
.should('be.enabled')
|
|
161
169
|
cy.itemsInCart(1)
|
|
162
170
|
|
|
163
171
|
// Remove the added item
|
|
@@ -189,10 +197,14 @@ describe('remove_from_cart event', () => {
|
|
|
189
197
|
.click()
|
|
190
198
|
.then(() => {
|
|
191
199
|
cy.getById('buy-button')
|
|
200
|
+
.should('be.visible')
|
|
201
|
+
.scrollIntoView({ duration: 500 })
|
|
192
202
|
.click()
|
|
193
203
|
.then(($btn) => {
|
|
194
204
|
cy.itemsInCart(2)
|
|
195
|
-
cy.getById('checkout-button')
|
|
205
|
+
cy.getById('checkout-button')
|
|
206
|
+
.should('be.visible')
|
|
207
|
+
.should('be.enabled')
|
|
196
208
|
cy.itemsInCart(2)
|
|
197
209
|
|
|
198
210
|
// Remove the added item
|
|
@@ -202,7 +214,9 @@ describe('remove_from_cart event', () => {
|
|
|
202
214
|
.click()
|
|
203
215
|
.then(() => {
|
|
204
216
|
cy.itemsInCart(1)
|
|
205
|
-
cy.getById('checkout-button')
|
|
217
|
+
cy.getById('checkout-button')
|
|
218
|
+
.should('be.visible')
|
|
219
|
+
.should('be.enabled')
|
|
206
220
|
cy.itemsInCart(1)
|
|
207
221
|
const skuId = $btn.attr('data-sku')
|
|
208
222
|
|
|
@@ -242,6 +256,8 @@ describe('select_item event', () => {
|
|
|
242
256
|
|
|
243
257
|
cy.getById('store-product-card').first().click()
|
|
244
258
|
cy.getById('buy-button')
|
|
259
|
+
.should('be.visible')
|
|
260
|
+
.scrollIntoView({ duration: 500 })
|
|
245
261
|
.then(($btn) => {
|
|
246
262
|
skuId = $btn.attr('data-sku')
|
|
247
263
|
})
|
|
@@ -364,7 +380,10 @@ describe('view_cart event', () => {
|
|
|
364
380
|
cy.visit(pages.pdp, options)
|
|
365
381
|
cy.waitForHydration()
|
|
366
382
|
|
|
367
|
-
cy.getById('buy-button')
|
|
383
|
+
cy.getById('buy-button')
|
|
384
|
+
.should('be.visible')
|
|
385
|
+
.scrollIntoView({ duration: 500 })
|
|
386
|
+
.click()
|
|
368
387
|
cy.getById('cart-sidebar').should('be.visible')
|
|
369
388
|
|
|
370
389
|
dataLayerHasEvent('view_cart')
|
|
@@ -63,7 +63,9 @@ describe('On product description pages', () => {
|
|
|
63
63
|
const sellerId = $btn.attr('data-seller')
|
|
64
64
|
|
|
65
65
|
// Wait for optimistic cart to kick in
|
|
66
|
-
cy.getById('checkout-button')
|
|
66
|
+
cy.getById('checkout-button')
|
|
67
|
+
.should('be.visible')
|
|
68
|
+
.should('be.enabled')
|
|
67
69
|
|
|
68
70
|
cy.getById('cart-item').should(($item) => {
|
|
69
71
|
expect($item.attr('data-sku')).to.eq(skuId)
|
|
@@ -86,7 +88,7 @@ describe('On product description pages', () => {
|
|
|
86
88
|
|
|
87
89
|
cy.itemsInCart(1)
|
|
88
90
|
|
|
89
|
-
cy.getById('checkout-button').should('be.enabled')
|
|
91
|
+
cy.getById('checkout-button').should('be.visible').should('be.enabled')
|
|
90
92
|
|
|
91
93
|
cy.itemsInCart(1)
|
|
92
94
|
|
|
@@ -21,9 +21,14 @@ describe('Search input', () => {
|
|
|
21
21
|
cy.visit(pages.home, options)
|
|
22
22
|
cy.waitForHydration()
|
|
23
23
|
|
|
24
|
-
cy.getById('store-input-mobile-button')
|
|
24
|
+
cy.getById('store-input-mobile-button')
|
|
25
|
+
.should('exist')
|
|
26
|
+
.scrollIntoView({ duration: 500 })
|
|
27
|
+
.click({ force: true })
|
|
25
28
|
|
|
26
29
|
cy.getById('store-input-mobile')
|
|
30
|
+
.should('exist')
|
|
31
|
+
.scrollIntoView({ duration: 500 })
|
|
27
32
|
.click()
|
|
28
33
|
.type(term)
|
|
29
34
|
.within(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "cypress open",
|
|
13
13
|
"lhci": "lhci autorun",
|
|
14
14
|
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json}\"",
|
|
15
|
-
"lint": "
|
|
15
|
+
"lint": "next lint",
|
|
16
16
|
"stylelint": "stylelint \"**/*.scss\"",
|
|
17
17
|
"stylelint:fix": "stylelint \"**/*.scss\" --fix",
|
|
18
18
|
"postinstall": "node postinstall.js && (is-ci || husky install) || echo Skipped postinstall step for @faststore/core",
|
|
@@ -31,18 +31,15 @@
|
|
|
31
31
|
"@envelop/parser-cache": "^2.2.0",
|
|
32
32
|
"@envelop/validation-cache": "^2.2.0",
|
|
33
33
|
"@faststore/api": "^2.0.3-alpha.0",
|
|
34
|
-
"@faststore/components": "
|
|
34
|
+
"@faststore/components": "2.0.30-alpha.0",
|
|
35
35
|
"@faststore/graphql-utils": "^2.0.3-alpha.0",
|
|
36
36
|
"@faststore/sdk": "^2.0.3-alpha.0",
|
|
37
|
-
"@faststore/ui": "
|
|
37
|
+
"@faststore/ui": "2.0.30-alpha.0",
|
|
38
38
|
"@types/react": "^18.0.14",
|
|
39
39
|
"@vtex/client-cms": "^0.2.12",
|
|
40
40
|
"autoprefixer": "^10.4.0",
|
|
41
41
|
"chalk": "^5.2.0",
|
|
42
42
|
"css-loader": "^6.7.1",
|
|
43
|
-
"eslint": "^7.22.0",
|
|
44
|
-
"eslint-config-next": "12.1.5",
|
|
45
|
-
"eslint-config-vtex-react": "^9.0.0",
|
|
46
43
|
"graphql": "^15.0.0",
|
|
47
44
|
"include-media": "^1.4.10",
|
|
48
45
|
"msw": "^0.43.1",
|
|
@@ -83,6 +80,8 @@
|
|
|
83
80
|
"cypress-axe": "^0.13.0",
|
|
84
81
|
"cypress-wait-until": "^1.7.2",
|
|
85
82
|
"dotenv": "^8.2.0",
|
|
83
|
+
"eslint": "^8.30.0",
|
|
84
|
+
"eslint-config-next": "^13.0.7",
|
|
86
85
|
"husky": "^5.2.0",
|
|
87
86
|
"is-ci": "^3.0.0",
|
|
88
87
|
"lint-staged": "^10.5.4",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
List as UIList,
|
|
3
3
|
PaymentMethods as UIPaymentMethods,
|
|
4
|
+
SROnly as UISROnly,
|
|
4
5
|
} from '@faststore/ui'
|
|
5
6
|
|
|
6
7
|
import Logo from 'src/components/ui/Logo'
|
|
7
8
|
import IncentivesFooter from 'src/components/sections/Incentives/IncentivesFooter'
|
|
8
9
|
import Icon from 'src/components/ui/Icon'
|
|
9
10
|
import Link from 'src/components/ui/Link'
|
|
10
|
-
import SROnly from 'src/components/ui/SROnly'
|
|
11
11
|
import { mark } from 'src/sdk/tests/mark'
|
|
12
12
|
|
|
13
13
|
import styles from './footer.module.scss'
|
|
@@ -112,35 +112,35 @@ export function Footer({
|
|
|
112
112
|
<UIList>
|
|
113
113
|
<li>
|
|
114
114
|
<Icon width="34px" height="24px" name="Visa" />
|
|
115
|
-
<
|
|
115
|
+
<UISROnly text="Visa" />
|
|
116
116
|
</li>
|
|
117
117
|
<li>
|
|
118
118
|
<Icon width="34px" height="24px" name="Diners" />
|
|
119
|
-
<
|
|
119
|
+
<UISROnly text="Diners Club" />
|
|
120
120
|
</li>
|
|
121
121
|
<li>
|
|
122
122
|
<Icon width="34px" height="24px" name="Mastercard" />
|
|
123
|
-
<
|
|
123
|
+
<UISROnly text="Mastercard" />
|
|
124
124
|
</li>
|
|
125
125
|
<li>
|
|
126
126
|
<Icon width="34px" height="24px" name="EloCard" />
|
|
127
|
-
<
|
|
127
|
+
<UISROnly text="Elo Card" />
|
|
128
128
|
</li>
|
|
129
129
|
<li>
|
|
130
130
|
<Icon width="34px" height="24px" name="PayPal" />
|
|
131
|
-
<
|
|
131
|
+
<UISROnly text="PayPal" />
|
|
132
132
|
</li>
|
|
133
133
|
<li>
|
|
134
134
|
<Icon width="34px" height="24px" name="Stripe" />
|
|
135
|
-
<
|
|
135
|
+
<UISROnly text="Stripe" />
|
|
136
136
|
</li>
|
|
137
137
|
<li>
|
|
138
138
|
<Icon width="34px" height="24px" name="GooglePay" />
|
|
139
|
-
<
|
|
139
|
+
<UISROnly text="Google Pay" />
|
|
140
140
|
</li>
|
|
141
141
|
<li>
|
|
142
142
|
<Icon width="34px" height="24px" name="ApplePay" />
|
|
143
|
-
<
|
|
143
|
+
<UISROnly text="Apple Pay" />
|
|
144
144
|
</li>
|
|
145
145
|
</UIList>
|
|
146
146
|
</UIPaymentMethods>
|
|
@@ -1,78 +1,43 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
HeroHeadingProps as UIHeroHeadingProps,
|
|
3
|
+
HeroImageProps as UIHeroImageProps,
|
|
4
|
+
HeroProps as UIHeroProps,
|
|
5
|
+
} from '@faststore/ui'
|
|
2
6
|
import {
|
|
3
7
|
Hero as UIHero,
|
|
4
8
|
HeroHeading as UIHeroHeading,
|
|
5
9
|
HeroImage as UIHeroImage,
|
|
6
|
-
LinkButton as UILinkButton,
|
|
7
10
|
} from '@faststore/ui'
|
|
8
11
|
|
|
9
|
-
import
|
|
10
|
-
import Image from 'src/components/ui/Image/Image'
|
|
12
|
+
import { Image } from 'src/components/ui/Image'
|
|
11
13
|
|
|
12
14
|
import Section from '../Section'
|
|
13
|
-
import styles from './hero.module.scss'
|
|
14
|
-
|
|
15
|
-
type Variant = 'primary' | 'secondary'
|
|
16
|
-
type ColorVariant = 'main' | 'light' | 'accent'
|
|
17
15
|
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
variant?: Variant
|
|
31
|
-
/**
|
|
32
|
-
* Specifies the component's color variant combination.
|
|
33
|
-
*/
|
|
34
|
-
colorVariant?: ColorVariant
|
|
35
|
-
/**
|
|
36
|
-
* Specifies the URL the action button goes to.
|
|
37
|
-
*/
|
|
38
|
-
link?: string
|
|
39
|
-
/**
|
|
40
|
-
* Specifies the action button's content.
|
|
41
|
-
*/
|
|
42
|
-
linkText?: string
|
|
43
|
-
/**
|
|
44
|
-
* Icon component for additional customization.
|
|
45
|
-
*/
|
|
46
|
-
icon?: ReactNode
|
|
47
|
-
/**
|
|
48
|
-
* Specifies the image URL.
|
|
49
|
-
*/
|
|
50
|
-
imageSrc: string
|
|
51
|
-
/**
|
|
52
|
-
* Alternative description of the image.
|
|
53
|
-
*/
|
|
54
|
-
imageAlt: string
|
|
55
|
-
}
|
|
16
|
+
export type HeroProps = UIHeroProps &
|
|
17
|
+
UIHeroHeadingProps &
|
|
18
|
+
UIHeroImageProps & {
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the image URL.
|
|
21
|
+
*/
|
|
22
|
+
imageSrc: string
|
|
23
|
+
/**
|
|
24
|
+
* Alternative description of the image.
|
|
25
|
+
*/
|
|
26
|
+
imageAlt: string
|
|
27
|
+
}
|
|
56
28
|
|
|
57
29
|
const Hero = ({
|
|
30
|
+
icon,
|
|
31
|
+
link,
|
|
58
32
|
title,
|
|
59
33
|
subtitle,
|
|
60
|
-
variant = 'primary',
|
|
61
|
-
colorVariant = 'main',
|
|
62
34
|
linkText,
|
|
63
|
-
link,
|
|
64
|
-
icon,
|
|
65
35
|
imageAlt,
|
|
66
36
|
imageSrc,
|
|
67
37
|
}: HeroProps) => {
|
|
68
38
|
return (
|
|
69
39
|
<Section>
|
|
70
|
-
<UIHero
|
|
71
|
-
className={styles.fsHero}
|
|
72
|
-
data-fs-hero
|
|
73
|
-
data-fs-hero-variant={variant}
|
|
74
|
-
data-fs-hero-color-variant={colorVariant}
|
|
75
|
-
>
|
|
40
|
+
<UIHero>
|
|
76
41
|
<UIHeroImage data-fs-hero-image>
|
|
77
42
|
<Image
|
|
78
43
|
preload
|
|
@@ -85,27 +50,13 @@ const Hero = ({
|
|
|
85
50
|
sizes="(max-width: 768px) 70vw, 50vw"
|
|
86
51
|
/>
|
|
87
52
|
</UIHeroImage>
|
|
88
|
-
<UIHeroHeading
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
href={link}
|
|
96
|
-
inverse={colorVariant === 'main'}
|
|
97
|
-
icon={<Icon name="ArrowRight" width={24} height={24} />}
|
|
98
|
-
iconPosition="right"
|
|
99
|
-
>
|
|
100
|
-
{linkText}
|
|
101
|
-
</UILinkButton>
|
|
102
|
-
)}
|
|
103
|
-
</div>
|
|
104
|
-
{icon && variant === 'secondary' && (
|
|
105
|
-
<div data-fs-hero-icon>{icon}</div>
|
|
106
|
-
)}
|
|
107
|
-
</div>
|
|
108
|
-
</UIHeroHeading>
|
|
53
|
+
<UIHeroHeading
|
|
54
|
+
title={title}
|
|
55
|
+
subtitle={subtitle}
|
|
56
|
+
link={link}
|
|
57
|
+
linkText={linkText}
|
|
58
|
+
icon={icon}
|
|
59
|
+
/>
|
|
109
60
|
</UIHero>
|
|
110
61
|
</Section>
|
|
111
62
|
)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Price as UIPrice } from '@faststore/ui'
|
|
1
|
+
import { Price as UIPrice, SROnly as UISROnly } from '@faststore/ui'
|
|
2
2
|
import { memo } from 'react'
|
|
3
3
|
import type { PriceProps } from '@faststore/ui'
|
|
4
4
|
|
|
5
|
-
import SROnly from '../SROnly'
|
|
6
5
|
import styles from './price.module.scss'
|
|
7
6
|
|
|
8
7
|
type Props = PriceProps & {
|
|
@@ -19,7 +18,7 @@ type Props = PriceProps & {
|
|
|
19
18
|
function Price({ classes = '', SRText, ...props }: Props) {
|
|
20
19
|
return (
|
|
21
20
|
<>
|
|
22
|
-
<
|
|
21
|
+
<UISROnly text={SRText} />
|
|
23
22
|
<UIPrice
|
|
24
23
|
data-fs-price
|
|
25
24
|
className={`${styles.fsPrice} ${classes}`}
|
|
@@ -196,7 +196,7 @@ export const useShippingSimulation = (shippingItem: IShippingItem) => {
|
|
|
196
196
|
},
|
|
197
197
|
})
|
|
198
198
|
}
|
|
199
|
-
}, [shippingPostalCode])
|
|
199
|
+
}, [country, shippingItem, shippingPostalCode])
|
|
200
200
|
|
|
201
201
|
const handleOnInput = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
|
202
202
|
const currentValue = e.currentTarget.value
|
package/src/pages/[...slug].tsx
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { isNotFoundError } from '@faststore/api'
|
|
2
|
+
import { gql } from '@faststore/graphql-utils'
|
|
3
|
+
import type { SearchState } from '@faststore/sdk'
|
|
2
4
|
import {
|
|
3
5
|
formatSearchState,
|
|
4
6
|
parseSearchState,
|
|
5
7
|
SearchProvider,
|
|
6
8
|
} from '@faststore/sdk'
|
|
7
|
-
import {
|
|
9
|
+
import type { GetStaticPaths, GetStaticProps } from 'next'
|
|
8
10
|
import { BreadcrumbJsonLd, NextSeo } from 'next-seo'
|
|
9
11
|
import { useRouter } from 'next/router'
|
|
10
12
|
import { useMemo } from 'react'
|
|
11
|
-
import type { SearchState } from '@faststore/sdk'
|
|
12
|
-
import type { GetStaticPaths, GetStaticProps } from 'next'
|
|
13
13
|
|
|
14
|
+
import type {
|
|
15
|
+
ServerCollectionPageQueryQuery,
|
|
16
|
+
ServerCollectionPageQueryQueryVariables,
|
|
17
|
+
} from '@generated/graphql'
|
|
14
18
|
import Breadcrumb from 'src/components/sections/Breadcrumb'
|
|
15
19
|
import Hero from 'src/components/sections/Hero'
|
|
16
20
|
import ProductGallery from 'src/components/sections/ProductGallery'
|
|
@@ -21,10 +25,6 @@ import { ITEMS_PER_PAGE, ITEMS_PER_SECTION } from 'src/constants'
|
|
|
21
25
|
import { useApplySearchState } from 'src/sdk/search/state'
|
|
22
26
|
import { mark } from 'src/sdk/tests/mark'
|
|
23
27
|
import { execute } from 'src/server'
|
|
24
|
-
import type {
|
|
25
|
-
ServerCollectionPageQueryQuery,
|
|
26
|
-
ServerCollectionPageQueryQueryVariables,
|
|
27
|
-
} from '@generated/graphql'
|
|
28
28
|
|
|
29
29
|
import storeConfig from '../../faststore.config'
|
|
30
30
|
|
|
@@ -105,7 +105,7 @@ function Page(props: Props) {
|
|
|
105
105
|
subtitle={`All the amazing ${title} from the brands we partner with.`}
|
|
106
106
|
imageSrc="https://storeframework.vtexassets.com/arquivos/ids/190897/Photo.jpg"
|
|
107
107
|
imageAlt="Quest 2 Controller on a table"
|
|
108
|
-
icon={<Icon name="Headphones" width={48} height={48}
|
|
108
|
+
icon={<Icon name="Headphones" width={48} height={48} />}
|
|
109
109
|
/>
|
|
110
110
|
|
|
111
111
|
<ProductGallery title={title} />
|
package/src/pages/s.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { NextSeo } from 'next-seo'
|
|
|
3
3
|
import { useRouter } from 'next/router'
|
|
4
4
|
import { useEffect, useState } from 'react'
|
|
5
5
|
import type { SearchState } from '@faststore/sdk'
|
|
6
|
+
import { SROnly as UISROnly } from '@faststore/ui'
|
|
6
7
|
|
|
7
8
|
import Breadcrumb from 'src/components/sections/Breadcrumb'
|
|
8
9
|
import ProductGallery from 'src/components/sections/ProductGallery'
|
|
9
|
-
import SROnly from 'src/components/ui/SROnly'
|
|
10
10
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
11
11
|
import { useApplySearchState } from 'src/sdk/search/state'
|
|
12
12
|
import { mark } from 'src/sdk/tests/mark'
|
|
@@ -55,7 +55,7 @@ function Page() {
|
|
|
55
55
|
}}
|
|
56
56
|
/>
|
|
57
57
|
|
|
58
|
-
<
|
|
58
|
+
<UISROnly as="h1" text={title} />
|
|
59
59
|
|
|
60
60
|
{/*
|
|
61
61
|
WARNING: Do not import or render components from any
|
|
@@ -27,7 +27,6 @@ class ErrorBoundary extends Component<{ children: ReactNode }> {
|
|
|
27
27
|
|
|
28
28
|
// We can't accurately type the error here, since it could vary depending on
|
|
29
29
|
// what caused it. This is not standardized.
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
30
|
public componentDidCatch(error: any, errorInfo: ErrorInfo) {
|
|
32
31
|
console.error(`React Error: ${error.message} ${errorInfo.componentStack}`)
|
|
33
32
|
|
package/src/server/cms.ts
CHANGED
|
@@ -15,7 +15,6 @@ type Options =
|
|
|
15
15
|
filters?: Record<string, string>
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
18
|
const isLocator = (x: any): x is Locator =>
|
|
20
19
|
typeof x.contentType === 'string' &&
|
|
21
20
|
(typeof x.releaseId === 'string' || typeof x.documentId === 'string')
|
package/vtex.env
CHANGED
|
@@ -5,10 +5,10 @@ NEXT_TELEMETRY_DISABLED=true
|
|
|
5
5
|
## Enable re-using node_modules from previous runs for faster builds
|
|
6
6
|
USE_BUILD_CACHE=true
|
|
7
7
|
|
|
8
|
-
## Enable Incremental Static Builds (ISB):
|
|
8
|
+
## Enable Incremental Static Builds (ISB):
|
|
9
9
|
## https://www.faststore.dev/releases/2022/05/19/webops
|
|
10
10
|
USE_STALE_CACHE=true
|
|
11
11
|
|
|
12
|
-
## Production site host your users will
|
|
12
|
+
## Production site host your users will
|
|
13
13
|
## access your website
|
|
14
14
|
SITE_HOST=demo.faststore.dev
|
package/.eslintignore
DELETED
package/.eslintrc
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"vtex-react/gatsby",
|
|
4
|
-
"next/core-web-vitals"
|
|
5
|
-
],
|
|
6
|
-
"root": true,
|
|
7
|
-
"rules": {
|
|
8
|
-
"react/prop-types": "off",
|
|
9
|
-
"react/react-in-jsx-scope": "off",
|
|
10
|
-
"jsx-a11y/anchor-is-valid": "off"
|
|
11
|
-
},
|
|
12
|
-
"settings": {
|
|
13
|
-
"react": {
|
|
14
|
-
"version": "detect"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"ignorePatterns": [
|
|
18
|
-
"public/~partytown/*",
|
|
19
|
-
"next-env.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
package/bun.lockb
DELETED
|
Binary file
|