@faststore/core 2.0.132-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.
- package/.turbo/turbo-build.log +13 -12
- package/CHANGELOG.md +6 -0
- package/cms/faststore/sections.json +1 -1
- package/package.json +4 -4
- package/src/components/cms/GlobalSections.tsx +4 -3
- package/src/components/common/Footer/Footer.tsx +23 -118
- package/src/components/common/Footer/FooterLinks.tsx +23 -97
- package/src/components/common/Footer/FooterSocial.tsx +42 -0
- package/src/components/common/Footer/index.ts +6 -1
- package/src/components/sections/Footer/Footer.tsx +87 -0
- package/src/components/sections/Footer/index.ts +1 -0
- package/src/components/sections/Incentives/Incentives.tsx +19 -0
- package/src/components/sections/Incentives/index.ts +1 -0
- package/src/components/ui/Incentives/Incentives.tsx +11 -7
- package/src/components/ui/Incentives/index.ts +1 -1
- package/src/pages/index.tsx +2 -2
- package/src/components/common/Footer/FooterFlags.tsx +0 -26
- package/src/components/sections/IncentivesHeader/IncentivesHeader.tsx +0 -24
- package/src/components/sections/IncentivesHeader/index.ts +0 -1
- package/src/components/ui/Incentives/incentivesMock.ts +0 -27
- /package/src/components/{common → sections}/Footer/section.module.scss +0 -0
- /package/src/components/sections/{IncentivesHeader → Incentives}/section.module.scss +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -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.
|
|
26
|
-
├ └ css/
|
|
26
|
+
┌ ● / 2.87 kB 126 kB
|
|
27
|
+
├ └ css/56ac93c668f9132f.css 7.22 kB
|
|
27
28
|
├ /_app 0 B 77.9 kB
|
|
28
|
-
├ ● /[...slug]
|
|
29
|
+
├ ● /[...slug] 9.96 kB 132 kB
|
|
29
30
|
├ └ css/408ab64ab5c04787.css 7.95 kB
|
|
30
|
-
├ ● /[slug]/p 11.2 kB
|
|
31
|
+
├ ● /[slug]/p 11.2 kB 134 kB
|
|
31
32
|
├ └ css/bc39c02d387d74b8.css 9.34 kB
|
|
32
|
-
├ ○ /404 1.
|
|
33
|
-
├ ● /500 1.
|
|
34
|
-
├ ● /account
|
|
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
|
|
38
|
-
├ ● /login 1.
|
|
39
|
-
└ ● /s
|
|
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
43
|
├ chunks/main-fd466221927468fd.js 23.9 kB
|
|
43
|
-
├ chunks/pages/_app-
|
|
44
|
-
├ chunks/webpack-
|
|
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,12 @@
|
|
|
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
|
+
|
|
6
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)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.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.
|
|
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.
|
|
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": "
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
97
|
-
items:
|
|
17
|
+
type FooterLink = {
|
|
18
|
+
items: Item[]
|
|
19
|
+
sectionTitle: string
|
|
98
20
|
}
|
|
99
21
|
|
|
100
|
-
function
|
|
22
|
+
function Links({ items }: Pick<FooterLink, 'items'>) {
|
|
101
23
|
return (
|
|
102
24
|
<UIList>
|
|
103
25
|
{items.map((item) => (
|
|
104
|
-
<li key={item.
|
|
105
|
-
<Link variant="display" size="small" href={item.
|
|
106
|
-
{item.
|
|
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
|
-
|
|
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((
|
|
133
|
-
<UIAccordionItem key={
|
|
134
|
-
<UIAccordionButton>{
|
|
58
|
+
{links.map(({ sectionTitle, items }) => (
|
|
59
|
+
<UIAccordionItem key={sectionTitle}>
|
|
60
|
+
<UIAccordionButton>{sectionTitle}</UIAccordionButton>
|
|
135
61
|
<UIAccordionPanel>
|
|
136
|
-
<
|
|
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((
|
|
146
|
-
<div key={
|
|
147
|
-
<p data-fs-footer-title>{
|
|
148
|
-
<
|
|
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 {
|
|
5
|
+
export type { FooterLinksProps } from './FooterLinks'
|
|
6
|
+
|
|
7
|
+
export { default as FooterSocial } from './FooterSocial'
|
|
8
|
+
export type { FooterSocialProps } from './FooterSocial'
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { PaymentMethods as UIPaymentMethods } from '@faststore/ui'
|
|
2
|
+
import type { PaymentMethodsProps as UIPaymentMethodProps } from '@faststore/ui'
|
|
3
|
+
|
|
4
|
+
import Section from '../Section'
|
|
5
|
+
|
|
6
|
+
import UIFooter, {
|
|
7
|
+
FooterLinks,
|
|
8
|
+
FooterSocial,
|
|
9
|
+
FooterInfo as UIFooterInfo,
|
|
10
|
+
FooterNavigation as UIFooterNavigation,
|
|
11
|
+
} from '../../common/Footer'
|
|
12
|
+
import type { FooterLinksProps, FooterSocialProps } from '../../common/Footer'
|
|
13
|
+
|
|
14
|
+
import { Image } from '../../ui/Image'
|
|
15
|
+
import UIIncentives from '../../ui/Incentives'
|
|
16
|
+
import type { Incentive } from '../../ui/Incentives'
|
|
17
|
+
|
|
18
|
+
import styles from './section.module.scss'
|
|
19
|
+
|
|
20
|
+
export type FooterProps = {
|
|
21
|
+
incentives: Incentive[]
|
|
22
|
+
footerLinks: FooterLinksProps['links']
|
|
23
|
+
footerSocial: {
|
|
24
|
+
title?: FooterSocialProps['title']
|
|
25
|
+
socialLinks: FooterSocialProps['links']
|
|
26
|
+
}
|
|
27
|
+
logo: {
|
|
28
|
+
src: string
|
|
29
|
+
alt: string
|
|
30
|
+
}
|
|
31
|
+
copyrightInfo: string
|
|
32
|
+
acceptedPaymentMethods: {
|
|
33
|
+
showPaymentMethods: boolean
|
|
34
|
+
title?: string
|
|
35
|
+
paymentMethods?: UIPaymentMethodProps['flagList']
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Footer = ({
|
|
40
|
+
incentives,
|
|
41
|
+
footerLinks,
|
|
42
|
+
footerSocial,
|
|
43
|
+
footerSocial: { title: footerSocialTitle },
|
|
44
|
+
logo: { src: logoSrc, alt: logoAlt },
|
|
45
|
+
copyrightInfo,
|
|
46
|
+
acceptedPaymentMethods: {
|
|
47
|
+
showPaymentMethods,
|
|
48
|
+
title: acceptedPaymentMethodsTitle,
|
|
49
|
+
paymentMethods,
|
|
50
|
+
},
|
|
51
|
+
}: FooterProps) => {
|
|
52
|
+
return (
|
|
53
|
+
<Section className={`${styles.section} section-footer`}>
|
|
54
|
+
<UIFooter>
|
|
55
|
+
<UIIncentives incentives={incentives} />
|
|
56
|
+
<UIFooterNavigation>
|
|
57
|
+
<FooterLinks links={footerLinks} />
|
|
58
|
+
<FooterSocial
|
|
59
|
+
title={footerSocialTitle}
|
|
60
|
+
links={footerSocial.socialLinks}
|
|
61
|
+
/>
|
|
62
|
+
</UIFooterNavigation>
|
|
63
|
+
<UIFooterInfo>
|
|
64
|
+
<Image
|
|
65
|
+
data-fs-footer-logo
|
|
66
|
+
loading="lazy"
|
|
67
|
+
src={logoSrc}
|
|
68
|
+
alt={logoAlt}
|
|
69
|
+
width={112}
|
|
70
|
+
height={119}
|
|
71
|
+
/>
|
|
72
|
+
{showPaymentMethods && (
|
|
73
|
+
<UIPaymentMethods
|
|
74
|
+
flagList={paymentMethods}
|
|
75
|
+
title={<p>{acceptedPaymentMethodsTitle}</p>}
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
78
|
+
<div data-fs-footer-copyright className="text__legend">
|
|
79
|
+
<p>{copyrightInfo}</p>
|
|
80
|
+
</div>
|
|
81
|
+
</UIFooterInfo>
|
|
82
|
+
</UIFooter>
|
|
83
|
+
</Section>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default Footer
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Footer'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import UIIncentives from 'src/components/ui/Incentives/Incentives'
|
|
2
|
+
import type { Incentive } from 'src/components/ui/Incentives'
|
|
3
|
+
|
|
4
|
+
import Section from '../Section'
|
|
5
|
+
import styles from './section.module.scss'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
incentives: Incentive[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function Incentives({ incentives }: Props) {
|
|
12
|
+
return (
|
|
13
|
+
<Section className={`${styles.section} section-incentives`}>
|
|
14
|
+
<UIIncentives incentives={incentives} colored />
|
|
15
|
+
</Section>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default Incentives
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Incentives'
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Icon as UIIcon,
|
|
3
|
+
List as UIList,
|
|
4
|
+
Incentive as UIIncentive,
|
|
5
|
+
} from '@faststore/ui'
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
export type Incentive = {
|
|
4
8
|
icon: string
|
|
5
|
-
title
|
|
9
|
+
title: string
|
|
6
10
|
firstLineText: string
|
|
7
11
|
secondLineText?: string
|
|
12
|
+
alt?: string
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
export interface IncentivesProps {
|
|
@@ -34,16 +39,15 @@ function Incentives({
|
|
|
34
39
|
{incentives.map((incentive, index) => (
|
|
35
40
|
<li key={String(index)}>
|
|
36
41
|
<UIIncentive>
|
|
37
|
-
<
|
|
42
|
+
<UIIcon
|
|
38
43
|
data-fs-incentive-icon
|
|
44
|
+
aria-label={incentive.alt}
|
|
39
45
|
name={incentive.icon}
|
|
40
46
|
width={32}
|
|
41
47
|
height={32}
|
|
42
48
|
/>
|
|
43
49
|
<div data-fs-incentive-content>
|
|
44
|
-
{incentive.title
|
|
45
|
-
<p data-fs-incentive-title>{incentive.title}</p>
|
|
46
|
-
)}
|
|
50
|
+
<p data-fs-incentive-title>{incentive.title}</p>
|
|
47
51
|
<span data-fs-incentive-description>
|
|
48
52
|
{incentive.firstLineText}
|
|
49
53
|
</span>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Incentives'
|
|
2
|
-
export type { IncentivesProps } from './Incentives'
|
|
2
|
+
export type { IncentivesProps, Incentive } from './Incentives'
|
package/src/pages/index.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { ComponentType } from 'react'
|
|
|
6
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
|
-
import
|
|
9
|
+
import Incentives from 'src/components/sections/Incentives'
|
|
10
10
|
import Newsletter from 'src/components/sections/Newsletter'
|
|
11
11
|
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
12
12
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
@@ -24,7 +24,7 @@ import GlobalSections, {
|
|
|
24
24
|
/* A list of components that can be used in the CMS. */
|
|
25
25
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
26
26
|
Hero,
|
|
27
|
-
|
|
27
|
+
Incentives,
|
|
28
28
|
ProductShelf,
|
|
29
29
|
ProductTiles,
|
|
30
30
|
BannerText,
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Icon } from '@faststore/ui'
|
|
2
|
-
|
|
3
|
-
const FooterFlags = [
|
|
4
|
-
{ image: <Icon width={32} height={22.5} name="Visa" />, text: 'Visa' },
|
|
5
|
-
{
|
|
6
|
-
image: <Icon width={32} height={22.5} name="Diners" />,
|
|
7
|
-
text: 'Diners Club',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
image: <Icon width={32} height={22.5} name="Mastercard" />,
|
|
11
|
-
text: 'Mastercard',
|
|
12
|
-
},
|
|
13
|
-
{ image: <Icon width={32} height={22.5} name="EloCard" />, text: 'Elo Card' },
|
|
14
|
-
{ image: <Icon width={32} height={22.5} name="PayPal" />, text: 'PayPal' },
|
|
15
|
-
{ image: <Icon width={32} height={22.5} name="Stripe" />, text: 'Stripe' },
|
|
16
|
-
{
|
|
17
|
-
image: <Icon width={32} height={22.5} name="GooglePay" />,
|
|
18
|
-
text: 'GooglePay',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
image: <Icon width={32} height={22.5} name="ApplePay" />,
|
|
22
|
-
text: 'ApplePay',
|
|
23
|
-
},
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
export default FooterFlags
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Incentives from 'src/components/ui/Incentives/Incentives'
|
|
2
|
-
import Section from '../Section'
|
|
3
|
-
import styles from './section.module.scss'
|
|
4
|
-
|
|
5
|
-
interface Incentive {
|
|
6
|
-
icon: string
|
|
7
|
-
title?: string
|
|
8
|
-
firstLineText: string
|
|
9
|
-
secondLineText?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
incentives: Incentive[]
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function IncentivesHeader({ incentives }: Props) {
|
|
17
|
-
return (
|
|
18
|
-
<Section className={`${styles.section} section-incentives-header`}>
|
|
19
|
-
<Incentives incentives={incentives} colored />
|
|
20
|
-
</Section>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default IncentivesHeader
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './IncentivesHeader'
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const incentivesMockFooter = [
|
|
2
|
-
{
|
|
3
|
-
icon: 'ShieldCheck',
|
|
4
|
-
firstLineText: 'Trusted',
|
|
5
|
-
secondLineText: 'by Safecon',
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
icon: 'Medal',
|
|
9
|
-
firstLineText: 'Quality',
|
|
10
|
-
secondLineText: 'Products',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
icon: 'CircleWavyCheck',
|
|
14
|
-
firstLineText: '3-year',
|
|
15
|
-
secondLineText: 'Guarantee',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
icon: 'Storefront',
|
|
19
|
-
firstLineText: 'Pickup',
|
|
20
|
-
secondLineText: 'Options',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
icon: 'Truck',
|
|
24
|
-
firstLineText: 'Free',
|
|
25
|
-
secondLineText: 'Shippping',
|
|
26
|
-
},
|
|
27
|
-
]
|
|
File without changes
|
|
File without changes
|