@faststore/core 3.35.1 → 3.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +25 -15
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1506.js +1 -1
- package/.next/server/chunks/8646.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/account/profile.js +1 -0
- package/.next/server/pages/account/profile.js.nft.json +1 -0
- package/.next/server/pages/account.js +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/pages/{_app-836e2ad874a5b36e.js → _app-012e51403727ae6a.js} +1 -1
- package/.next/static/chunks/pages/account/profile-1fdb500de8f12b3a.js +1 -0
- package/.next/static/chunks/pages/account-32bc9db3fea9b0c4.js +1 -0
- package/.next/static/chunks/webpack-1cd1c4aa7f418483.js +1 -0
- package/.next/static/css/249b9deaabc0d32d.css +1 -0
- package/.next/static/go585duKn6vmUmdZiKusb/_buildManifest.js +1 -0
- package/.next/static/go585duKn6vmUmdZiKusb/_ssgManifest.js +1 -0
- package/.next/trace +124 -122
- package/.turbo/turbo-build.log +18 -16
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +6 -0
- package/discovery.config.default.js +1 -0
- package/index.ts +1 -0
- package/package.json +2 -2
- package/src/components/account/MyAccountLayout/MyAccountLayout.tsx +25 -0
- package/src/components/account/MyAccountLayout/index.ts +1 -0
- package/src/components/account/MyAccountLayout/styles.scss +17 -0
- package/src/components/account/MyAccountMenu/MyAccountMenu.tsx +74 -0
- package/src/components/account/MyAccountMenu/index.ts +1 -0
- package/src/components/account/MyAccountMenu/styles.scss +124 -0
- package/src/components/account/index.ts +2 -0
- package/src/components/account/section.module.scss +3 -0
- package/src/customizations/src/myAccount/navigation.ts +3 -0
- package/src/experimental/myAccountSeverSideProps.ts +42 -0
- package/src/pages/account/index.tsx +44 -0
- package/src/pages/account/profile.tsx +48 -0
- package/src/sdk/account/getMyAccountRoutes.ts +34 -0
- package/.next/server/pages/en-US/account.html +0 -28
- package/.next/server/pages/en-US/account.json +0 -1
- package/.next/static/Shnxq4E8-HNxCfP-iRIQV/_buildManifest.js +0 -1
- package/.next/static/Shnxq4E8-HNxCfP-iRIQV/_ssgManifest.js +0 -1
- package/.next/static/chunks/pages/account-2123c229c3e93039.js +0 -1
- package/.next/static/chunks/webpack-045fa70c18f7d0f7.js +0 -1
- package/src/pages/account.tsx +0 -72
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.35.
|
|
2
|
+
> @faststore/core@3.35.1 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.35.
|
|
6
|
+
> @faststore/core@3.35.1 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.35.
|
|
11
|
+
> @faststore/core@3.35.1 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.35.
|
|
15
|
+
> @faststore/core@3.35.1 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.35.
|
|
20
|
+
> @faststore/core@3.35.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.35.
|
|
40
|
+
> @faststore/core@3.35.1 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.35.
|
|
44
|
+
> @faststore/core@3.35.1 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -57,12 +57,12 @@ https://nextjs.org/telemetry
|
|
|
57
57
|
Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
|
|
58
58
|
✓ Compiled successfully
|
|
59
59
|
Collecting page data ...
|
|
60
|
-
Generating static pages (0/7) ...
|
|
61
|
-
|
|
62
60
|
Generating static pages (1/7)
|
|
61
|
+
Generating static pages (0/6) ...
|
|
62
|
+
|
|
63
63
|
Generating static pages (1/6)
|
|
64
64
|
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
65
|
-
|
|
66
65
|
Generating static pages (3/7)
|
|
67
|
-
|
|
68
66
|
Generating static pages (5/7)
|
|
69
|
-
|
|
70
67
|
✓ Generating static pages (7/7)
|
|
68
|
+
|
|
71
69
|
Generating static pages (2/6)
|
|
70
|
+
|
|
72
71
|
Generating static pages (4/6)
|
|
72
|
+
|
|
73
73
|
✓ Generating static pages (6/6)
|
|
74
74
|
Finalizing page optimization ...
|
|
75
75
|
Collecting build traces ...
|
|
76
76
|
|
|
@@ -77,7 +77,9 @@ Route (pages) Size First Load JS
|
|
|
77
77
|
├ └ css/b5bf49598c8f8b66.css 16.1 kB
|
|
78
78
|
├ ○ /404 1.48 kB 122 kB
|
|
79
79
|
├ ● /500 1.48 kB 122 kB
|
|
80
|
-
├
|
|
80
|
+
├ λ /account 767 B 121 kB
|
|
81
|
+
├ λ /account/profile 1.34 kB 122 kB
|
|
82
|
+
├ └ css/249b9deaabc0d32d.css 2.51 kB
|
|
81
83
|
├ λ /api/graphql 0 B 92.4 kB
|
|
82
84
|
├ λ /api/health/live 0 B 92.4 kB
|
|
83
85
|
├ λ /api/health/ready 0 B 92.4 kB
|
|
@@ -85,11 +87,11 @@ Route (pages) Size First Load JS
|
|
|
85
87
|
├ ● /checkout 694 B 121 kB
|
|
86
88
|
├ ● /login 1.59 kB 122 kB
|
|
87
89
|
└ ● /s 3.18 kB 134 kB
|
|
88
|
-
+ First Load JS shared by all 95.
|
|
90
|
+
+ First Load JS shared by all 95.9 kB
|
|
89
91
|
├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
|
|
90
92
|
├ chunks/main-5569625b3fdd6741.js 33.1 kB
|
|
91
|
-
├ chunks/pages/_app-
|
|
92
|
-
├ chunks/webpack-
|
|
93
|
+
├ chunks/pages/_app-012e51403727ae6a.js 10.4 kB
|
|
94
|
+
├ chunks/webpack-1cd1c4aa7f418483.js 3.59 kB
|
|
93
95
|
└ css/0a57ee6c7a57788c.css 3.49 kB
|
|
94
96
|
|
|
95
97
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.35.
|
|
2
|
+
> @faststore/core@3.35.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/utils/multipleTemplates.test.ts (
|
|
6
|
-
PASS test/server/cms/global.test.ts (23.
|
|
5
|
+
PASS test/utils/multipleTemplates.test.ts (22.915 s)
|
|
6
|
+
PASS test/server/cms/global.test.ts (23.944 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (29.
|
|
8
|
+
PASS test/server/index.test.ts (29.285 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time: 30.
|
|
13
|
+
Time: 30.513 s
|
|
14
14
|
Ran all test suites.
|
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
|
+
# [3.36.0](https://github.com/vtex/faststore/compare/v3.35.1...v3.36.0) (2025-04-09)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- My Account Menu and Extensibility ([#2761](https://github.com/vtex/faststore/issues/2761)) ([0daf07a](https://github.com/vtex/faststore/commit/0daf07a7fdf524992472d9f9b4a013885aa175a2)), closes [#2729](https://github.com/vtex/faststore/issues/2729) [#2720](https://github.com/vtex/faststore/issues/2720) [#2738](https://github.com/vtex/faststore/issues/2738) [#2752](https://github.com/vtex/faststore/issues/2752)
|
|
11
|
+
|
|
6
12
|
## [3.35.1](https://github.com/vtex/faststore/compare/v3.35.0...v3.35.1) (2025-04-08)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -130,6 +130,7 @@ module.exports = {
|
|
|
130
130
|
preact: false,
|
|
131
131
|
enableRedirects: false,
|
|
132
132
|
enableSearchSSR: false,
|
|
133
|
+
enableFaststoreMyAccount: false,
|
|
133
134
|
enableVtexAssetsLoader: false,
|
|
134
135
|
graphqlCacheControl: {
|
|
135
136
|
maxAge: 0, // 0 disables cache, 5 * 60 enable cache control maxAge 5 minutes
|
package/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { useProductsQuery } from './src/sdk/product/useProductsQuery'
|
|
|
10
10
|
|
|
11
11
|
export * from './src/typings/overrides'
|
|
12
12
|
export { getOverriddenSection } from './src/sdk/overrides/getOverriddenSection'
|
|
13
|
+
export { getMyAccountRoutes } from './src/sdk/account/getMyAccountRoutes'
|
|
13
14
|
|
|
14
15
|
// Overridable Sections
|
|
15
16
|
export { default as AlertSection } from './src/components/sections/Alert'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.36.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"ts-jest": "29.1.1",
|
|
106
106
|
"typescript": "5.3.2"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "02b2a2e2ef528893276e4ae88d0ef5fda96c4bf7"
|
|
109
109
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react'
|
|
2
|
+
import MyAccountMenu from '../MyAccountMenu'
|
|
3
|
+
import menuRoutes from 'src/customizations/src/myAccount/navigation'
|
|
4
|
+
import styles from '../section.module.scss'
|
|
5
|
+
|
|
6
|
+
export type MyAccountLayoutProps = {}
|
|
7
|
+
|
|
8
|
+
/* ######################################### */
|
|
9
|
+
/* Mocked Data until development is finished */
|
|
10
|
+
const mockedUserName = 'Mocked Username'
|
|
11
|
+
|
|
12
|
+
/* ######################################### */
|
|
13
|
+
|
|
14
|
+
const MyAccountLayout = ({
|
|
15
|
+
children,
|
|
16
|
+
}: PropsWithChildren<MyAccountLayoutProps>) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className={styles.layout}>
|
|
19
|
+
<MyAccountMenu accountName={mockedUserName} items={menuRoutes} />
|
|
20
|
+
{children}
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default MyAccountLayout
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MyAccountLayout'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.layout {
|
|
2
|
+
@import "@faststore/ui/src/components/atoms/Button/styles.scss";
|
|
3
|
+
@import "../MyAccountMenu/styles.scss";
|
|
4
|
+
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-rows: auto 1fr;
|
|
7
|
+
min-height: calc(100vh - 18rem);
|
|
8
|
+
|
|
9
|
+
@include media(">=notebook") {
|
|
10
|
+
grid-template-rows: none;
|
|
11
|
+
grid-template-columns: max(300px) auto;
|
|
12
|
+
gap: var(--fs-spacing-8);
|
|
13
|
+
max-width: var(--fs-grid-max-width);
|
|
14
|
+
padding: 0;
|
|
15
|
+
margin: 0 auto;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Button, Link } from '@faststore/ui'
|
|
2
|
+
import { useRouter } from 'next/router'
|
|
3
|
+
|
|
4
|
+
import styles from '../section.module.scss'
|
|
5
|
+
|
|
6
|
+
import useScreenResize from 'src/sdk/ui/useScreenResize'
|
|
7
|
+
|
|
8
|
+
interface NavItem {
|
|
9
|
+
title: string
|
|
10
|
+
route: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MyAccountMenuProps
|
|
14
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
avatarImageUrl?: string
|
|
16
|
+
accountName: string
|
|
17
|
+
items: NavItem[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const Nav = ({ items }: Pick<MyAccountMenuProps, 'items'>) => {
|
|
21
|
+
const router = useRouter()
|
|
22
|
+
const currentRoute = router.pathname
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<ul className={styles.nav}>
|
|
26
|
+
{items.map(({ route, title }) => (
|
|
27
|
+
<li
|
|
28
|
+
className={styles.navItem}
|
|
29
|
+
data-is-selected={currentRoute === route}
|
|
30
|
+
key={route}
|
|
31
|
+
>
|
|
32
|
+
<Link href={route} tabIndex={0}>
|
|
33
|
+
{title}
|
|
34
|
+
</Link>
|
|
35
|
+
</li>
|
|
36
|
+
))}
|
|
37
|
+
</ul>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const MyAccountMenu = ({
|
|
42
|
+
avatarImageUrl,
|
|
43
|
+
accountName,
|
|
44
|
+
items,
|
|
45
|
+
}: MyAccountMenuProps) => {
|
|
46
|
+
const { isDesktop } = useScreenResize()
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className={styles.menu}>
|
|
50
|
+
{isDesktop ? (
|
|
51
|
+
<div className={styles.account}>
|
|
52
|
+
<div className={styles.avatarContainer}>
|
|
53
|
+
{avatarImageUrl ? (
|
|
54
|
+
<img className={styles.avatar} src={avatarImageUrl} />
|
|
55
|
+
) : (
|
|
56
|
+
<span className={styles.avatar}>{accountName[0]}</span>
|
|
57
|
+
)}
|
|
58
|
+
<h2>{accountName}</h2>
|
|
59
|
+
</div>
|
|
60
|
+
<Button
|
|
61
|
+
className={styles.switchButton}
|
|
62
|
+
variant="secondary"
|
|
63
|
+
size="small"
|
|
64
|
+
>
|
|
65
|
+
Switch
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
) : null}
|
|
69
|
+
<Nav items={items} />
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default MyAccountMenu
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MyAccountMenu'
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
.menu {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
max-height: inherit;
|
|
5
|
+
padding: var(--fs-spacing-3);
|
|
6
|
+
overflow: scroll;
|
|
7
|
+
scrollbar-width: none;
|
|
8
|
+
-ms-overflow-style: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.account {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: flex-end;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding-bottom: var(--fs-spacing-5);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.avatarContainer {
|
|
20
|
+
display: grid;
|
|
21
|
+
grid-template-rows: auto;
|
|
22
|
+
gap: var(--fs-spacing-2);
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding-bottom: var(--fs-spacing-1);
|
|
25
|
+
|
|
26
|
+
h2 {
|
|
27
|
+
font-size: var(--fs-text-size-3);
|
|
28
|
+
font-weight: var(--fs-text-weight-semibold);
|
|
29
|
+
line-height: var(--fs-text-size-5);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.switchButton {
|
|
34
|
+
display: none; /* While it's use case is not implemented */
|
|
35
|
+
max-width: fit-content;
|
|
36
|
+
height: 1.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.nav {
|
|
40
|
+
display: flex;
|
|
41
|
+
gap: var(--fs-spacing-1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.navItem {
|
|
45
|
+
align-content: center;
|
|
46
|
+
height: var(--fs-spacing-6);
|
|
47
|
+
font-size: var(--fs-text-size-1);
|
|
48
|
+
font-weight: var(--fs-text-weight-medium);
|
|
49
|
+
background-color: var(--fs-color-tertiary-bkg);
|
|
50
|
+
border-radius: var(--fs-border-radius-pill);
|
|
51
|
+
|
|
52
|
+
&:hover,
|
|
53
|
+
&[data-is-selected="true"] {
|
|
54
|
+
background-color: var(--fs-color-tertiary-bkg-hover);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:active {
|
|
58
|
+
background-color: var(--fs-color-tertiary-bkg-active);
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:disabled {
|
|
63
|
+
color: var(--fs-color-disabled-text);
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
background-color: var(--fs-color-tertiary-bkg-disabled);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
>a,
|
|
69
|
+
a:link,
|
|
70
|
+
a:visited {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
align-content: center;
|
|
73
|
+
width: max-content;
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
padding: 0 var(--fs-spacing-3);
|
|
77
|
+
color: var(--fs-color-text);
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
background-color: transparent;
|
|
80
|
+
border-radius: var(--fs-border-radius-pill);
|
|
81
|
+
|
|
82
|
+
&:focus-visible {
|
|
83
|
+
outline: 3px solid var(--fs-color-focus-ring);
|
|
84
|
+
box-shadow: none;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@include media(">=notebook") {
|
|
90
|
+
grid-template-rows: none;
|
|
91
|
+
grid-template-columns: max(300px) 80%;
|
|
92
|
+
gap: var(--fs-spacing-8);
|
|
93
|
+
padding: 0 var(--fs-spacing-8);
|
|
94
|
+
|
|
95
|
+
.menu {
|
|
96
|
+
padding: 0;
|
|
97
|
+
padding-top: var(--fs-spacing-6);
|
|
98
|
+
overflow: visible;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.nav {
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
gap: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.navItem {
|
|
107
|
+
margin-left: -16px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.avatar {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
width: var(--fs-spacing-8);
|
|
115
|
+
height: var(--fs-spacing-8);
|
|
116
|
+
font-size: var(--fs-text-size-4);
|
|
117
|
+
font-weight: var(--fs-text-weight-semibold);
|
|
118
|
+
color: var(--fs-color-main-2);
|
|
119
|
+
text-align: center;
|
|
120
|
+
background-color: var(--fs-color-accent-0);
|
|
121
|
+
border: var(--spacing-1) solid var(--fs-color-neutral-0);
|
|
122
|
+
border-radius: var(--fs-border-radius-circle);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Locator } from '@vtex/client-cms'
|
|
2
|
+
import type { GetServerSideProps } from 'next'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
type GlobalSectionsData,
|
|
6
|
+
getGlobalSectionsData,
|
|
7
|
+
} from 'src/components/cms/GlobalSections'
|
|
8
|
+
|
|
9
|
+
import { injectGlobalSections } from 'src/server/cms/global'
|
|
10
|
+
|
|
11
|
+
export type MyAccountProps = {
|
|
12
|
+
globalSections: GlobalSectionsData
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const getServerSideProps: GetServerSideProps<
|
|
16
|
+
MyAccountProps,
|
|
17
|
+
Record<string, string>,
|
|
18
|
+
Locator
|
|
19
|
+
> = async ({ previewData }) => {
|
|
20
|
+
const [
|
|
21
|
+
globalSectionsPromise,
|
|
22
|
+
globalSectionsHeaderPromise,
|
|
23
|
+
globalSectionsFooterPromise,
|
|
24
|
+
] = getGlobalSectionsData(previewData)
|
|
25
|
+
|
|
26
|
+
const [globalSections, globalSectionsHeader, globalSectionsFooter] =
|
|
27
|
+
await Promise.all([
|
|
28
|
+
globalSectionsPromise,
|
|
29
|
+
globalSectionsHeaderPromise,
|
|
30
|
+
globalSectionsFooterPromise,
|
|
31
|
+
])
|
|
32
|
+
|
|
33
|
+
const globalSectionsResult = injectGlobalSections({
|
|
34
|
+
globalSections,
|
|
35
|
+
globalSectionsHeader,
|
|
36
|
+
globalSectionsFooter,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
props: { globalSections: globalSectionsResult },
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { NextSeo } from 'next-seo'
|
|
2
|
+
import type { ComponentType } from 'react'
|
|
3
|
+
import { useEffect } from 'react'
|
|
4
|
+
import RenderSections from 'src/components/cms/RenderSections'
|
|
5
|
+
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
6
|
+
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
7
|
+
import storeConfig from 'discovery.config'
|
|
8
|
+
import {
|
|
9
|
+
getServerSideProps,
|
|
10
|
+
type MyAccountProps,
|
|
11
|
+
} from 'src/experimental/myAccountSeverSideProps'
|
|
12
|
+
import { useRouter } from 'next/router'
|
|
13
|
+
|
|
14
|
+
/* A list of components that can be used in the CMS. */
|
|
15
|
+
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
16
|
+
...GLOBAL_COMPONENTS,
|
|
17
|
+
...CUSTOM_COMPONENTS,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function Page({ globalSections }: MyAccountProps) {
|
|
21
|
+
const router = useRouter()
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (storeConfig.experimental.enableFaststoreMyAccount) {
|
|
24
|
+
router.push('/account/profile') // current default path in my account
|
|
25
|
+
} else {
|
|
26
|
+
window.location.href = `${storeConfig.accountUrl}${window.location.search}`
|
|
27
|
+
}
|
|
28
|
+
}, [])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<RenderSections
|
|
32
|
+
globalSections={globalSections.sections}
|
|
33
|
+
components={COMPONENTS}
|
|
34
|
+
>
|
|
35
|
+
<NextSeo noindex nofollow />
|
|
36
|
+
|
|
37
|
+
<div>loading...</div>
|
|
38
|
+
</RenderSections>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { getServerSideProps }
|
|
43
|
+
|
|
44
|
+
export default Page
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* ######################################### */
|
|
2
|
+
/* Mocked Page until development is finished, it will be removed after */
|
|
3
|
+
|
|
4
|
+
import { NextSeo } from 'next-seo'
|
|
5
|
+
import type { ComponentType } from 'react'
|
|
6
|
+
import { MyAccountLayout } from 'src/components/account'
|
|
7
|
+
import RenderSections from 'src/components/cms/RenderSections'
|
|
8
|
+
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
9
|
+
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
10
|
+
import {
|
|
11
|
+
getServerSideProps,
|
|
12
|
+
type MyAccountProps,
|
|
13
|
+
} from 'src/experimental/myAccountSeverSideProps'
|
|
14
|
+
|
|
15
|
+
/* A list of components that can be used in the CMS. */
|
|
16
|
+
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
17
|
+
...GLOBAL_COMPONENTS,
|
|
18
|
+
...CUSTOM_COMPONENTS,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const style = {
|
|
22
|
+
alignContent: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
h1: {
|
|
27
|
+
fontSize: '100px',
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function Profile({ globalSections }: MyAccountProps) {
|
|
32
|
+
return (
|
|
33
|
+
<RenderSections
|
|
34
|
+
globalSections={globalSections.sections}
|
|
35
|
+
components={COMPONENTS}
|
|
36
|
+
>
|
|
37
|
+
<NextSeo noindex nofollow />
|
|
38
|
+
|
|
39
|
+
<MyAccountLayout>
|
|
40
|
+
<div style={style}>
|
|
41
|
+
<h1 style={style.h1}>Profile</h1>
|
|
42
|
+
</div>
|
|
43
|
+
</MyAccountLayout>
|
|
44
|
+
</RenderSections>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { getServerSideProps }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface Route {
|
|
2
|
+
/* Page name, displayed in the sidebar */
|
|
3
|
+
title: string
|
|
4
|
+
/* Accessible path within My Account */
|
|
5
|
+
route: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface GetMyAccountRouteParams {
|
|
9
|
+
/* Route list */
|
|
10
|
+
routes: Route[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const DEFAULT_ROUTES: Route[] = [
|
|
14
|
+
{
|
|
15
|
+
title: 'Profile',
|
|
16
|
+
route: '/account/profile',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: 'Orders',
|
|
20
|
+
route: '/account/orders',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'User Details',
|
|
24
|
+
route: '/account/user-details',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: 'Security',
|
|
28
|
+
route: '/account/security',
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
export function getMyAccountRoutes({ routes }: GetMyAccountRouteParams) {
|
|
33
|
+
return [...DEFAULT_ROUTES, ...routes]
|
|
34
|
+
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en-US"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="generated-at" content="2025-04-08T21:49:30.038Z"/><meta name="robots" content="noindex,nofollow"/><meta name="next-head-count" content="4"/><link rel="preconnect" href="https://storeframework.vtexassets.com"/><link rel="dns-prefetch" href="https://storeframework.vtexassets.com"/><meta name="storefront" content="fast_store"/><script>var partytown={forward:[...["sendrc"],!window.location.search.includes('gtm_debug=')&&true?'dataLayer.push':null].filter(Boolean)}</script><script type="text/partytown">!window.location.search.includes('gtm_debug=')&&
|
|
2
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
3
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
4
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
5
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
6
|
-
})(window,document,'script',"dataLayer","GTM-PGHZ95N");</script><script type="text/javascript">window.location.search.includes('gtm_debug=')&&
|
|
7
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
8
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
9
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
10
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
11
|
-
})(window,document,'script',"dataLayer","GTM-PGHZ95N");</script><script type="text/partytown">
|
|
12
|
-
window.VTEX_METADATA = {account:'storeframework', renderer: 'faststore'};
|
|
13
|
-
window.sendrc=function(en,ed){window.NavigationCapture&&window.NavigationCapture.sendEvent(en,ed)};
|
|
14
|
-
</script><script type="text/partytown" async="" src="https://io.vtex.com.br/rc/rc.js"></script><script type="text/javascript">
|
|
15
|
-
(function(v,t,e,x,a,f,s){
|
|
16
|
-
f=v.vtexaf=v.vtexaf||function(){(f.q=f.q||[]).push(arguments)}
|
|
17
|
-
;f.l=+new Date;s=t.createElement(e);s.async=!0;
|
|
18
|
-
s.src=x;a=t.getElementsByTagName(e)[0];
|
|
19
|
-
a.parentNode.insertBefore(s,a)
|
|
20
|
-
})(window,document,'script','https://activity-flow.vtex.com/af/af.js');
|
|
21
|
-
</script><script type="text/javascript">
|
|
22
|
-
window.vtexaf('init', {
|
|
23
|
-
account: 'storeframework',
|
|
24
|
-
env: 'vtexcommercestable',
|
|
25
|
-
workspace: 'master'
|
|
26
|
-
});
|
|
27
|
-
</script><script>!(function(w,p,f,c){c=w[p]=w[p]||{};c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.6.4 - MIT builder.io */
|
|
28
|
-
!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,"/"==(a=(o.lib||"/~partytown/")+(o.debug?"debug/":""))[0]&&(s=e.querySelectorAll('script[type="text/partytown"]'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener("pt0",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.6.4":"sandbox-sw.html?"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement("script")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(".").map((function(e,n,i){p=p[i[n]]=n+1<i.length?"push"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),"complete"==e.readyState?u():(t.addEventListener("DOMContentLoaded",u),t.addEventListener("load",u))}(window,document,navigator,top,window.crossOriginIsolated);document.currentScript.dataset.partytown="";</script><link rel="preload" href="/_next/static/css/0a57ee6c7a57788c.css" as="style" crossorigin=""/><link rel="stylesheet" href="/_next/static/css/0a57ee6c7a57788c.css" crossorigin="" data-n-g=""/><link rel="preload" href="/_next/static/css/b0c0e0632c5d7f52.css" as="style" crossorigin=""/><link rel="stylesheet" href="/_next/static/css/b0c0e0632c5d7f52.css" crossorigin="" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" crossorigin="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-045fa70c18f7d0f7.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/framework-807b0f81cbc129f0.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/main-5569625b3fdd6741.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/pages/_app-836e2ad874a5b36e.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/6167-ecb49640dcb9d566.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/6335-2bf379c0870c440e.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/pages/account-2123c229c3e93039.js" defer="" crossorigin=""></script><script src="/_next/static/Shnxq4E8-HNxCfP-iRIQV/_buildManifest.js" defer="" crossorigin=""></script><script src="/_next/static/Shnxq4E8-HNxCfP-iRIQV/_ssgManifest.js" defer="" crossorigin=""></script></head><body class="theme"><div id="__next"><div data-store-section-name="Alert" style="height:823px;width:100%"></div><div data-store-section-name="Navbar" style="height:823px;width:100%"></div><div data-store-section-name="RegionBar" style="height:823px;width:100%"></div><div>loading...</div><div data-store-section-name="Toast" style="height:823px;width:100%"></div><div data-store-section-name="Footer" style="height:823px;width:100%"></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="">{"props":{"pageProps":{"globalSections":{"id":"962a7773-1482-11f0-b37f-8c36bb18d2b3","name":"Global Sections","type":"globalSections","status":"published","versionId":"1bed2716-397d-4632-a671-2675cd613147","versionStatus":"published","sections":[{"id":"a426dc2f-3ae6-4951-8466-cf88534b83e7","name":"Alert","data":{"link":{"text":"Buy now","to":"/office"},"dismissible":true,"icon":"BellRinging","content":"Get 15% off today: NEW15!"}},{"id":"5d447cb2-9175-4a52-90c6-bd1ed518d966","name":"Navbar","data":{"logo":{"link":{"url":"/","title":"Go To Home"},"src":"https://storeframework.vtexassets.com/assets/vtex.file-manager-graphql/images/ab9997f4-8fd6-46f5-99d2-9d5af3ef5e34___6d75a203771d7408d8f0d1c660a076dd.png","alt":"Store logo"},"searchInput":{"placeholder":"Search everything at the store","sort":"score_desc"},"signInButton":{"icon":{"icon":"User","alt":"User"},"label":"Sign In","myAccountLabel":"My Account"},"cartIcon":{"icon":"ShoppingCart","alt":"Shopping Cart"},"navigation":{"regionalization":{"enabled":true,"icon":{"icon":"MapPin","alt":"MapPin"},"label":"Set Your Location"},"pageLinks":[{"text":"Office","url":"/office"},{"text":"Technology","url":"/technology"}],"menu":{"icon":{"icon":"List","alt":"List"}},"home":{"label":"Go to Home"}}}},{"id":"897b0dfa-5da0-4a68-aa93-e6ec5032c817","name":"RegionBar","data":{"icon":{"icon":"MapPin","alt":"Map Pin icon"},"label":"Set your location","editLabel":"Edit","buttonIcon":{"icon":"CaretRight","alt":"Caret Right icon"}}},{"id":"748c1ef3-9684-48b2-8153-1902ad71ff6b","name":"CartSidebar","data":{"title":"Your Cart","alert":{"icon":{"icon":"Truck","alt":"Arrow Right icon"},"text":"Free shipping starts at $300"},"checkoutButton":{"label":"Checkout","loadingLabel":"Loading...","icon":{"icon":"ArrowRight","alt":"Arrow Right icon"}},"quantitySelector":{"useUnitMultiplier":false},"taxesConfiguration":{"usePriceWithTaxes":false,"taxesLabel":"Tax included"}}},{"id":"d4117c2b-4081-4b9a-b5b9-2251a0b46756","name":"RegionModal","data":{"title":"Set your location","description":"Prices, offers and availability may vary according to your location.","closeButtonAriaLabel":"Close Region Modal","inputField":{"label":"Postal Code","errorMessage":"You entered an invalid Postal Code","buttonActionText":"Apply"},"idkPostalCodeLink":{"text":"I don't know my Postal Code","icon":{"icon":"ArrowSquareOut","alt":"Arrow Square Out icon"}}}},{"id":"e64ccc72-aca1-488b-aac4-096dc750ee70","name":"Children","data":{}},{"id":"e0338a6b-ad72-4069-b8b3-39d2d4747a7f","name":"Footer","data":{"incentives":[{"title":" ","firstLineText":"Trusted","icon":"ShieldCheck","secondLineText":"by Safecon"},{"title":" ","firstLineText":"Free","icon":"Calendar","secondLineText":"Return"},{"title":" ","firstLineText":"Pickup","icon":"Storefront","secondLineText":"Options"},{"firstLineText":"Free","secondLineText":"Shipping","title":" ","icon":"Truck"}],"footerLinks":[{"items":[{"text":"About Us","url":"https://starter.vtex.app"},{"text":"Our Blog","url":"https://starter.vtex.app"},{"text":"Stores","url":"https://starter.vtex.app"},{"text":"Work With Us","url":"https://starter.vtex.app"}],"sectionTitle":"Our company"},{"items":[{"text":"Returns and Exchanges","url":"/"},{"text":"Product Recall","url":"/"},{"text":"Gift Cards","url":"/"}],"sectionTitle":"Orders and Purchases"},{"items":[{"text":"Support Center","url":"/"},{"text":"Support \u0026 Services","url":"/"},{"text":"Contact Us","url":"/"}],"sectionTitle":"Support \u0026 Services"},{"items":[{"text":"Affiliate Program","url":"/"},{"text":"Marketplace","url":"/"}],"sectionTitle":"Partnerships"}],"footerSocial":{"title":"Follow Us","socialLinks":[{"icon":{"icon":"Facebook"},"alt":"Facebook","url":"https://www.facebook.com"},{"icon":{"icon":"Instagram"},"alt":"Instagram","url":"https://www.instagram.com"},{"icon":{"icon":"Pinterest"},"alt":"Pinterest","url":"https://www.pinterest.com"},{"icon":{"icon":"Twitter"},"alt":"Twitter","url":"https://www.twitter.com"}]},"logo":{"link":{"title":"FastStore Starter","url":"https://starter.vtex.app/"},"src":"https://storeframework.vtexassets.com/assets/vtex.file-manager-graphql/images/ec191c4a-32d8-41a9-9255-f319819bc98c___c24a66e2bef2c3f2bea07571a3636804.png","alt":"Store Logo"},"acceptedPaymentMethods":{"showPaymentMethods":true,"title":"Payment Methods","paymentMethods":[{"icon":{"icon":"Diners"},"alt":"Diners Club"},{"icon":{"icon":"Visa"},"alt":"Visa"},{"icon":{"icon":"Mastercard"},"alt":"Mastercard"},{"icon":{"icon":"EloCard"},"alt":"Elo Card"},{"icon":{"icon":"PayPal"},"alt":"PayPal"},{"icon":{"icon":"GooglePay"},"alt":"GooglePay"},{"icon":{"icon":"ApplePay"},"alt":"Apple Pay"}]},"copyrightInfo":"This website uses VTEX technology. In-store price may vary. Prices and offers are subject to change. 2023 Brandless Store. All rights reserved. Store is a trademark of Store and its affiliated companies. Mount St, 000, New York / NY - 00000."}}]}},"__N_SSG":true},"page":"/account","query":{},"buildId":"Shnxq4E8-HNxCfP-iRIQV","isFallback":false,"gsp":true,"locale":"en-US","locales":["en-US"],"defaultLocale":"en-US","scriptLoader":[]}</script></body></html>
|