@faststore/core 2.0.130-alpha.0 → 2.0.133-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.
Files changed (51) hide show
  1. package/.turbo/turbo-build.log +16 -15
  2. package/CHANGELOG.md +12 -0
  3. package/cms/faststore/sections.json +1 -1
  4. package/lighthouserc.js +1 -0
  5. package/next.config.js +2 -0
  6. package/package.json +4 -4
  7. package/src/components/cms/GlobalSections.tsx +4 -3
  8. package/src/components/common/Footer/Footer.tsx +23 -118
  9. package/src/components/common/Footer/FooterLinks.tsx +23 -97
  10. package/src/components/common/Footer/FooterSocial.tsx +42 -0
  11. package/src/components/common/Footer/index.ts +6 -1
  12. package/src/components/common/Toast/Toast.tsx +5 -3
  13. package/src/components/common/Toast/section.module.scss +7 -0
  14. package/src/components/product/ProductCard/ProductCard.tsx +13 -7
  15. package/src/components/product/ProductGrid/ProductGrid.tsx +5 -0
  16. package/src/components/region/RegionButton/RegionButton.tsx +2 -2
  17. package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +1 -0
  18. package/src/components/sections/BannerNewsletter/section.module.scss +1 -0
  19. package/src/components/sections/EmptyState/EmptyState.tsx +28 -0
  20. package/src/components/sections/EmptyState/index.ts +2 -0
  21. package/src/components/sections/EmptyState/section.module.scss +8 -0
  22. package/src/components/sections/Footer/Footer.tsx +87 -0
  23. package/src/components/sections/Footer/index.ts +1 -0
  24. package/src/components/{common → sections}/Footer/section.module.scss +1 -0
  25. package/src/components/sections/Hero/Hero.tsx +0 -1
  26. package/src/components/sections/Incentives/Incentives.tsx +19 -0
  27. package/src/components/sections/Incentives/index.ts +1 -0
  28. package/src/components/sections/ProductDetails/section.module.scss +1 -0
  29. package/src/components/sections/ProductGallery/section.module.scss +1 -0
  30. package/src/components/sections/ProductShelf/ProductShelf.tsx +12 -4
  31. package/src/components/sections/ProductTiles/ProductTiles.tsx +21 -0
  32. package/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx +1 -1
  33. package/src/components/ui/Image/Image.tsx +7 -18
  34. package/src/components/ui/Image/loader.ts +16 -0
  35. package/src/components/ui/ImageGallery/ImageGallery.tsx +7 -14
  36. package/src/components/ui/Incentives/Incentives.tsx +11 -7
  37. package/src/components/ui/Incentives/index.ts +1 -1
  38. package/src/components/ui/SkuSelector/Selectors.tsx +4 -17
  39. package/src/pages/404.tsx +5 -4
  40. package/src/pages/500.tsx +19 -5
  41. package/src/pages/[...slug].tsx +0 -1
  42. package/src/pages/index.tsx +2 -2
  43. package/src/pages/login.tsx +5 -3
  44. package/src/utils/utilities.ts +13 -0
  45. package/src/components/common/Footer/FooterFlags.tsx +0 -26
  46. package/src/components/sections/IncentivesHeader/IncentivesHeader.tsx +0 -24
  47. package/src/components/sections/IncentivesHeader/index.ts +0 -1
  48. package/src/components/ui/Image/thumborUrlBuilder.ts +0 -103
  49. package/src/components/ui/Image/useImage.ts +0 -46
  50. package/src/components/ui/Incentives/incentivesMock.ts +0 -27
  51. /package/src/components/sections/{IncentivesHeader → Incentives}/section.module.scss +0 -0
@@ -16,32 +16,33 @@ info - Collecting page data...
16
16
  info - Generating static pages (0/7)
17
17
  info - Generating static pages (1/7)
18
18
  info - Generating static pages (3/7)
19
+ warn - IncentivesHeader not found. Add a new component for this section or remove it from the CMS
19
20
  warn - CallToAction not found. Add a new component for this section or remove it from the CMS
20
21
  info - Generating static pages (5/7)
21
22
  info - Generating static pages (7/7)
22
23
  info - Finalizing page optimization...
23
24
 
24
25
  Route (pages) Size First Load JS
25
- ┌ ● / 2.85 kB 126 kB
26
- ├ └ css/7a8417de90d11c60.css 7.06 kB
26
+ ┌ ● / 2.87 kB 126 kB
27
+ ├ └ css/56ac93c668f9132f.css 7.22 kB
27
28
  ├ /_app 0 B 77.9 kB
28
- ├ ● /[...slug] 7.74 kB 133 kB
29
- ├ └ css/326e215d7b09f642.css 7.72 kB
30
- ├ ● /[slug]/p 11.2 kB 135 kB
31
- ├ └ css/4b7b7b64ae6afe67.css 9.14 kB
32
- ├ ○ /404 951 B 110 kB
33
- ├ ● /500 718 B 110 kB
34
- ├ ● /account 669 B 110 kB
29
+ ├ ● /[...slug] 9.96 kB 132 kB
30
+ ├ └ css/408ab64ab5c04787.css 7.95 kB
31
+ ├ ● /[slug]/p 11.2 kB 134 kB
32
+ ├ └ css/bc39c02d387d74b8.css 9.34 kB
33
+ ├ ○ /404 1.09 kB 113 kB
34
+ ├ ● /500 1.11 kB 113 kB
35
+ ├ ● /account 672 B 113 kB
35
36
  ├ λ /api/graphql 0 B 77.9 kB
36
37
  ├ λ /api/preview 0 B 77.9 kB
37
- ├ ● /checkout 657 B 110 kB
38
- ├ ● /login 868 B 110 kB
39
- └ ● /s 961 B 121 kB
38
+ ├ ● /checkout 659 B 113 kB
39
+ ├ ● /login 1.01 kB 113 kB
40
+ └ ● /s 964 B 123 kB
40
41
  + First Load JS shared by all 80.7 kB
41
42
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
42
- ├ chunks/main-9746772201fe3ac1.js 23.9 kB
43
- ├ chunks/pages/_app-b601536188b9a919.js 6.43 kB
44
- ├ chunks/webpack-02fe78a6d63f52e6.js 2.25 kB
43
+ ├ chunks/main-fd466221927468fd.js 23.9 kB
44
+ ├ chunks/pages/_app-3e4e7e579cb0681a.js 6.43 kB
45
+ ├ chunks/webpack-ff9d67a587aa8a8e.js 2.29 kB
45
46
  └ css/587c27bbda64e700.css 2.8 kB
46
47
 
47
48
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.133-alpha.0](https://github.com/vtex/faststore/compare/v2.0.132-alpha.0...v2.0.133-alpha.0) (2023-05-09)
7
+
8
+ ### Features
9
+
10
+ - Adjust `Footer` for CMS ([#1743](https://github.com/vtex/faststore/issues/1743)) ([86dd67a](https://github.com/vtex/faststore/commit/86dd67a293dcd3a67a5b96ac45dc27d097f95381))
11
+
12
+ ## [2.0.132-alpha.0](https://github.com/vtex/faststore/compare/v2.0.131-alpha.0...v2.0.132-alpha.0) (2023-05-09)
13
+
14
+ ### Bug Fixes
15
+
16
+ - Lighthouse Checks 🟢 ([#1737](https://github.com/vtex/faststore/issues/1737)) ([b862703](https://github.com/vtex/faststore/commit/b862703ce991065f92765f4cecc88c9946b3d702)), closes [/github.com/GoogleChrome/lighthouse-ci/blob/main/packages/utils/src/presets/all.js#L25](https://github.com/vtex//github.com/GoogleChrome/lighthouse-ci/blob/main/packages/utils/src/presets/all.js/issues/L25)
17
+
6
18
  ## [2.0.130-alpha.0](https://github.com/vtex/faststore/compare/v2.0.129-alpha.0...v2.0.130-alpha.0) (2023-05-04)
7
19
 
8
20
  ### Features
@@ -532,7 +532,7 @@
532
532
  ],
533
533
  "enum": [
534
534
  "Visa",
535
- "DinersClub",
535
+ "Diners",
536
536
  "Mastercard",
537
537
  "EloCard",
538
538
  "PayPal",
package/lighthouserc.js CHANGED
@@ -18,5 +18,6 @@ module.exports = lhConfig({
18
18
  ],
19
19
  deprecations: 'warn',
20
20
  'resource-summary:stylesheet:count': ['warn', { maxNumericValue: 400 }],
21
+ 'resource-summary:script:count': ['warn', { maxNumericValue: 20 }],
21
22
  },
22
23
  })
package/next.config.js CHANGED
@@ -8,6 +8,8 @@ const nextConfig = {
8
8
  /* config options here */
9
9
  images: {
10
10
  domains: [`${storeConfig.api.storeId}.vtexassets.com`],
11
+ deviceSizes: [360, 540, 768, 1280, 1440],
12
+ imageSizes: [34, 68, 154, 320],
11
13
  },
12
14
  i18n: {
13
15
  locales: ['en-US'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.0.130-alpha.0",
3
+ "version": "2.0.133-alpha.0",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
@@ -30,10 +30,10 @@
30
30
  "@envelop/parser-cache": "^2.2.0",
31
31
  "@envelop/validation-cache": "^2.2.0",
32
32
  "@faststore/api": "^2.0.118-alpha.0",
33
- "@faststore/components": "^2.0.128-alpha.0",
33
+ "@faststore/components": "^2.0.133-alpha.0",
34
34
  "@faststore/graphql-utils": "^2.0.3-alpha.0",
35
35
  "@faststore/sdk": "^2.0.118-alpha.0",
36
- "@faststore/ui": "^2.0.128-alpha.0",
36
+ "@faststore/ui": "^2.0.133-alpha.0",
37
37
  "@types/react": "^18.0.14",
38
38
  "@vtex/client-cms": "^0.2.12",
39
39
  "autoprefixer": "^10.4.0",
@@ -108,5 +108,5 @@
108
108
  "msw": {
109
109
  "workerDirectory": "public"
110
110
  },
111
- "gitHead": "1f98570bc7c6833f90b658356f074febbba01d2c"
111
+ "gitHead": "d6ccdde94a4a7210b6e2ebf77a6caf358ecb07b2"
112
112
  }
@@ -5,13 +5,14 @@ import type { ComponentType } from 'react'
5
5
  import CUSTOM_COMPONENTS from 'src/customizations/components'
6
6
  import { PageContentType, getPage } from 'src/server/cms'
7
7
 
8
- import Footer from 'src/components/common/Footer'
9
8
  import RegionBar from 'src/components/common/RegionBar'
10
9
  import Toast from 'src/components/common/Toast'
11
10
  import Navbar from 'src/components/navigation/Navbar'
12
- import Alert from 'src/components/sections/Alert/Alert'
13
11
  import RenderSections from './RenderSections'
14
12
 
13
+ import Footer from 'src/components/sections/Footer'
14
+ import Alert from 'src/components/sections/Alert/Alert'
15
+
15
16
  export const GLOBAL_SECTIONS_CONTENT_TYPE = 'globalSections'
16
17
 
17
18
  export type GlobalSectionsData = {
@@ -21,6 +22,7 @@ export type GlobalSectionsData = {
21
22
  /* A list of components that can be used in the CMS. */
22
23
  const COMPONENTS: Record<string, ComponentType<any>> = {
23
24
  Alert,
25
+ Footer,
24
26
  ...CUSTOM_COMPONENTS,
25
27
  }
26
28
 
@@ -56,7 +58,6 @@ function GlobalSections({
56
58
  {children}
57
59
  </main>
58
60
 
59
- <Footer />
60
61
  {hasChildren && (
61
62
  <RenderSections sections={lastSections} components={COMPONENTS} />
62
63
  )}
@@ -1,127 +1,32 @@
1
- import {
2
- Icon,
3
- List as UIList,
4
- PaymentMethods as UIPaymentMethods,
5
- } from '@faststore/ui'
6
-
7
- import Link from 'src/components/ui/Link'
8
- import Logo from 'src/components/ui/Logo'
9
1
  import { mark } from 'src/sdk/tests/mark'
10
2
 
11
- import Incentives from 'src/components/ui/Incentives/Incentives'
12
- import { incentivesMockFooter } from 'src/components/ui/Incentives/incentivesMock'
13
- import FooterFlags from './FooterFlags'
14
- import FooterLinks from './FooterLinks'
15
- import styles from './section.module.scss'
3
+ export function FooterInfo({ children }) {
4
+ return (
5
+ <div data-fs-footer-info className="layout__content">
6
+ {children}
7
+ </div>
8
+ )
9
+ }
16
10
 
17
- type FooterProps = {
18
- /**
19
- * Enables Incentives Section
20
- */
21
- sectionIncentives?: boolean
22
- /**
23
- * Enables Social Section
24
- */
25
- sectionSocial?: boolean
26
- /**
27
- * Enables Payment Methods Section
28
- */
29
- sectionPaymentMethods?: boolean
11
+ export function FooterNavigation({ children }) {
12
+ return (
13
+ <div data-fs-footer-navigation className="layout__content">
14
+ {children}
15
+ </div>
16
+ )
30
17
  }
31
18
 
32
- export function Footer({
33
- sectionIncentives = true,
34
- sectionSocial = true,
35
- sectionPaymentMethods = true,
36
- }: FooterProps) {
19
+ export function Footer({ children }) {
37
20
  return (
38
- <footer className={`section ${styles.section} section-footer`}>
39
- <div
40
- data-fs-footer
41
- data-fs-footer-incentives={sectionIncentives}
42
- data-fs-footer-social={sectionSocial}
43
- data-fs-footer-payment-methods={sectionPaymentMethods}
44
- className="layout__content-full"
45
- >
46
- {sectionIncentives && <Incentives incentives={incentivesMockFooter} />}
47
- <div data-fs-footer-nav className="layout__content">
48
- <FooterLinks />
49
- {sectionSocial && (
50
- <section data-fs-footer-social>
51
- <p data-fs-footer-title>Follow us</p>
52
- <UIList>
53
- <li>
54
- <Link
55
- variant="display"
56
- size="small"
57
- href="https://www.facebook.com/"
58
- title="Facebook"
59
- target="_blank"
60
- rel="noopener noreferrer"
61
- >
62
- <Icon name="Facebook" />
63
- </Link>
64
- </li>
65
- <li>
66
- <Link
67
- variant="display"
68
- size="small"
69
- href="https://www.instagram.com/"
70
- title="Instagram"
71
- target="_blank"
72
- rel="noopener noreferrer"
73
- >
74
- <Icon name="Instagram" />
75
- </Link>
76
- </li>
77
- <li>
78
- <Link
79
- variant="display"
80
- size="small"
81
- href="https://www.pinterest.com/"
82
- title="Pinterest"
83
- target="_blank"
84
- rel="noopener noreferrer"
85
- >
86
- <Icon name="Pinterest" />
87
- </Link>
88
- </li>
89
- <li>
90
- <Link
91
- variant="display"
92
- size="small"
93
- href="https://twitter.com/"
94
- title="Twitter"
95
- target="_blank"
96
- rel="noopener noreferrer"
97
- >
98
- <Icon name="Twitter" />
99
- </Link>
100
- </li>
101
- </UIList>
102
- </section>
103
- )}
104
- </div>
105
- <div data-fs-footer-note className="layout__content">
106
- <Logo />
107
- {sectionPaymentMethods && (
108
- <UIPaymentMethods
109
- title={<p>Payment Methods</p>}
110
- flagList={FooterFlags}
111
- />
112
- )}
113
- <div data-fs-footer-copyright className="text__legend">
114
- <p>This website uses VTEX technology</p>
115
- <p>
116
- In-store price may vary. Prices and offers are subject to change.
117
- 2021 Store name. All rights reserved. Store is a trademark of
118
- Store and its affiliated companies.
119
- </p>
120
- <address>Mount St, 000, New York / NY - 00000.</address>
121
- </div>
122
- </div>
123
- </div>
124
- </footer>
21
+ <div
22
+ data-fs-footer
23
+ data-fs-footer-social
24
+ data-fs-footer-incentives
25
+ data-fs-footer-payment-methods
26
+ className="layout__content-full"
27
+ >
28
+ {children}
29
+ </div>
125
30
  )
126
31
  }
127
32
 
@@ -9,101 +9,23 @@ import { useState } from 'react'
9
9
 
10
10
  import Link from 'src/components/ui/Link'
11
11
 
12
- const links = [
13
- {
14
- title: 'Our company',
15
- items: [
16
- {
17
- href: '/',
18
- name: 'About Us',
19
- },
20
- {
21
- href: '/',
22
- name: 'Our Blog',
23
- },
24
- {
25
- href: '/',
26
- name: 'Stores',
27
- },
28
- {
29
- href: '/',
30
- name: 'Work With Us',
31
- },
32
- ],
33
- },
34
- {
35
- title: 'Orders & Purchases',
36
- items: [
37
- {
38
- href: '/',
39
- name: 'Check Order Status',
40
- },
41
- {
42
- href: '/',
43
- name: 'Returns and Exchanges',
44
- },
45
- {
46
- href: '/',
47
- name: 'Product Recall',
48
- },
49
- {
50
- href: '/',
51
- name: 'Gift Cards',
52
- },
53
- ],
54
- },
55
- {
56
- title: 'Support & Services',
57
- items: [
58
- {
59
- href: '/',
60
- name: 'Support Center',
61
- },
62
- {
63
- href: '/',
64
- name: 'Schedule a Service',
65
- },
66
- {
67
- href: '/',
68
- name: 'Contact Us',
69
- },
70
- ],
71
- },
72
- {
73
- title: 'Partnerships',
74
- items: [
75
- {
76
- href: '/',
77
- name: 'Affiliate Program',
78
- },
79
- {
80
- href: '/',
81
- name: 'Advertise with US',
82
- },
83
- {
84
- href: '/',
85
- name: 'Market Place',
86
- },
87
- ],
88
- },
89
- ]
90
-
91
- type LinkItem = {
92
- href: string
93
- name: string
12
+ type Item = {
13
+ url: string
14
+ text: string
94
15
  }
95
16
 
96
- interface LinksListProps {
97
- items: LinkItem[]
17
+ type FooterLink = {
18
+ items: Item[]
19
+ sectionTitle: string
98
20
  }
99
21
 
100
- function LinksList({ items }: LinksListProps) {
22
+ function Links({ items }: Pick<FooterLink, 'items'>) {
101
23
  return (
102
24
  <UIList>
103
25
  {items.map((item) => (
104
- <li key={item.name}>
105
- <Link variant="display" size="small" href={item.href}>
106
- {item.name}
26
+ <li key={item.text}>
27
+ <Link variant="display" size="small" href={item.url}>
28
+ {item.text}
107
29
  </Link>
108
30
  </li>
109
31
  ))}
@@ -111,7 +33,11 @@ function LinksList({ items }: LinksListProps) {
111
33
  )
112
34
  }
113
35
 
114
- function FooterLinks() {
36
+ export interface FooterLinksProps {
37
+ links: FooterLink[]
38
+ }
39
+
40
+ function FooterLinks({ links }: FooterLinksProps) {
115
41
  const [indicesExpanded, setIndicesExpanded] = useState<Set<number>>(
116
42
  new Set([])
117
43
  )
@@ -129,11 +55,11 @@ function FooterLinks() {
129
55
  <section data-fs-footer data-fs-footer-links>
130
56
  <div className="display-mobile">
131
57
  <UIAccordion indices={indicesExpanded} onChange={onChange}>
132
- {links.map((section) => (
133
- <UIAccordionItem key={section.title}>
134
- <UIAccordionButton>{section.title}</UIAccordionButton>
58
+ {links.map(({ sectionTitle, items }) => (
59
+ <UIAccordionItem key={sectionTitle}>
60
+ <UIAccordionButton>{sectionTitle}</UIAccordionButton>
135
61
  <UIAccordionPanel>
136
- <LinksList items={section.items} />
62
+ <Links items={items} />
137
63
  </UIAccordionPanel>
138
64
  </UIAccordionItem>
139
65
  ))}
@@ -142,10 +68,10 @@ function FooterLinks() {
142
68
 
143
69
  <div className="hidden-mobile">
144
70
  <nav data-fs-footer-links-columns>
145
- {links.map((section) => (
146
- <div key={section.title}>
147
- <p data-fs-footer-title>{section.title}</p>
148
- <LinksList items={section.items} />
71
+ {links.map(({ sectionTitle, items }) => (
72
+ <div key={sectionTitle}>
73
+ <p data-fs-footer-links-title>{sectionTitle}</p>
74
+ <Links items={items} />
149
75
  </div>
150
76
  ))}
151
77
  </nav>
@@ -0,0 +1,42 @@
1
+ import { Icon as UIIcon, List as UIList } from '@faststore/ui'
2
+
3
+ import Link from 'src/components/ui/Link'
4
+
5
+ type FooterSocialLink = {
6
+ icon: {
7
+ icon: string
8
+ }
9
+ alt: string
10
+ url: string
11
+ }
12
+
13
+ export interface FooterSocialProps {
14
+ title: string
15
+ links: FooterSocialLink[]
16
+ }
17
+
18
+ function FooterSocial({ title, links }: FooterSocialProps) {
19
+ return (
20
+ <section data-fs-footer-social>
21
+ <p data-fs-footer-social-title>{title}</p>
22
+ <UIList>
23
+ {links.map(({ icon: { icon }, url }) => (
24
+ <li key={icon}>
25
+ <Link
26
+ href={url}
27
+ title={icon}
28
+ size="small"
29
+ target="_blank"
30
+ variant="display"
31
+ rel="noopener noreferrer"
32
+ >
33
+ <UIIcon name={icon} />
34
+ </Link>
35
+ </li>
36
+ ))}
37
+ </UIList>
38
+ </section>
39
+ )
40
+ }
41
+
42
+ export default FooterSocial
@@ -1,3 +1,8 @@
1
1
  export { default } from './Footer'
2
+ export { FooterInfo, FooterNavigation } from './Footer'
3
+
2
4
  export { default as FooterLinks } from './FooterLinks'
3
- export { default as FooterFlags } from './FooterFlags'
5
+ export type { FooterLinksProps } from './FooterLinks'
6
+
7
+ export { default as FooterSocial } from './FooterSocial'
8
+ export type { FooterSocialProps } from './FooterSocial'
@@ -1,7 +1,9 @@
1
- import { Suspense, useEffect } from 'react'
1
+ import { useEffect } from 'react'
2
2
 
3
3
  import { Toast as UIToast, useUI } from '@faststore/ui'
4
+ import Section from 'src/components/sections/Section/Section'
4
5
  import { useCart } from 'src/sdk/cart'
6
+ import styles from './section.module.scss'
5
7
 
6
8
  function Toast() {
7
9
  const { toasts, pushToast } = useUI()
@@ -27,9 +29,9 @@ function Toast() {
27
29
  return (
28
30
  <>
29
31
  {toasts.length > 0 && (
30
- <Suspense fallback={null}>
32
+ <Section className={`${styles.section} section-toast`}>
31
33
  <UIToast />
32
- </Suspense>
34
+ </Section>
33
35
  )}
34
36
  </>
35
37
  )
@@ -0,0 +1,7 @@
1
+ /* stylelint-disable no-invalid-position-at-import-rule */
2
+ @import "@faststore/ui/src/styles/base/utilities.scss";
3
+
4
+ .section {
5
+ @import "@faststore/ui/src/components/atoms/Icon/styles.scss";
6
+ @import "@faststore/ui/src/components/molecules/Toast/styles.scss";
7
+ }
@@ -1,16 +1,17 @@
1
+ import { gql } from '@faststore/graphql-utils'
1
2
  import {
2
3
  ProductCard as UIProductCard,
3
4
  ProductCardContent as UIProductCardContent,
4
5
  ProductCardImage as UIProductCardImage,
5
6
  } from '@faststore/ui'
6
- import { gql } from '@faststore/graphql-utils'
7
7
  import { memo } from 'react'
8
8
 
9
+ import type { ProductSummary_ProductFragment } from '@generated/graphql'
10
+ import { ImageProps } from 'next/future/image'
11
+ import NextLink from 'next/link'
9
12
  import { Image } from 'src/components/ui/Image'
10
13
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
11
14
  import { useProductLink } from 'src/sdk/product/useProductLink'
12
- import type { ProductSummary_ProductFragment } from '@generated/graphql'
13
- import NextLink from 'next/link'
14
15
 
15
16
  type Variant = 'wide' | 'default'
16
17
 
@@ -29,6 +30,10 @@ export interface ProductCardProps {
29
30
  * Specifies the ProductCard image's aspect ratio.
30
31
  */
31
32
  aspectRatio?: number
33
+ /**
34
+ * Specifies the ProductCard image's props.
35
+ */
36
+ imgProps?: Partial<ImageProps>
32
37
  /**
33
38
  * Specifies Rating Value of the product.
34
39
  */
@@ -53,6 +58,7 @@ function ProductCard({
53
58
  bordered = false,
54
59
  variant = 'default',
55
60
  aspectRatio = 1,
61
+ imgProps,
56
62
  ratingValue,
57
63
  buttonLabel = 'Add',
58
64
  onButtonClick,
@@ -90,10 +96,10 @@ function ProductCard({
90
96
  <Image
91
97
  src={img.url}
92
98
  alt={img.alternateName}
93
- width={360}
94
- height={360 / aspectRatio}
95
- sizes="(max-width: 768px) 25vw, 30vw"
96
- loading="lazy"
99
+ sizes={`${imgProps?.sizes ?? '(max-width: 768px) 40vw, 30vw'}`}
100
+ width={imgProps?.width ?? 360}
101
+ height={Math.round((Number(imgProps?.height) || 360) / aspectRatio)}
102
+ loading={imgProps?.loading}
97
103
  />
98
104
  </UIProductCardImage>
99
105
  <UIProductCardContent
@@ -35,6 +35,11 @@ function ProductGrid({ products, page, pageSize }: Props) {
35
35
  index={pageSize * page + idx + 1}
36
36
  bordered
37
37
  aspectRatio={aspectRatio}
38
+ imgProps={{
39
+ width: 150,
40
+ height: 150,
41
+ sizes: '30vw',
42
+ }}
38
43
  />
39
44
  </UIProductGridItem>
40
45
  ))}
@@ -11,11 +11,11 @@ function RegionButton() {
11
11
  <UIButton
12
12
  variant="tertiary"
13
13
  size="small"
14
- icon={<Icon name="MapPin" width={24} height={24} />}
14
+ icon={<Icon name="MapPin" width={18} height={18} weight="bold" />}
15
15
  iconPosition="left"
16
16
  onClick={openModal}
17
17
  >
18
- <span>{postalCode ?? 'Set your location'}</span>
18
+ {postalCode ?? 'Set your location'}
19
19
  </UIButton>
20
20
  )
21
21
  }
@@ -21,6 +21,7 @@ function BannerNewsletter() {
21
21
  title="Get News and Special Offers!"
22
22
  description="Receive our news and promotions in advance. Enjoy and get 10% off your first purchase. For more information click here."
23
23
  card
24
+ lite
24
25
  />
25
26
  </div>
26
27
  </Section>
@@ -3,6 +3,7 @@
3
3
 
4
4
  .section {
5
5
  @import "@faststore/ui/src/components/atoms/Button/styles.scss";
6
+ @import "@faststore/ui/src/components/molecules/LinkButton/styles.scss";
6
7
  @import "@faststore/ui/src/components/molecules/Banner/styles.scss";
7
8
  @import "@faststore/ui/src/components/organisms/BannerNewsletter/styles.scss";
8
9
  }