@akinon/projectzero 2.0.41-beta.0 → 2.0.41
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/CHANGELOG.md +1 -1
- package/app-template/CHANGELOG.md +32 -32
- package/app-template/package.json +29 -29
- package/app-template/src/app/[pz]/account/(dashboard)/layout.tsx +20 -0
- package/app-template/src/app/[pz]/account/account-page-slot.tsx +34 -0
- package/app-template/src/app/[pz]/account/address/layout.tsx +18 -0
- package/app-template/src/app/[pz]/account/change-email/layout.tsx +18 -0
- package/app-template/src/app/[pz]/account/change-password/layout.tsx +18 -0
- package/app-template/src/app/[pz]/account/contact/layout.tsx +18 -0
- package/app-template/src/app/[pz]/account/coupons/layout.tsx +18 -0
- package/app-template/src/app/[pz]/account/faq/layout.tsx +15 -0
- package/app-template/src/app/[pz]/account/favourite-products/layout.tsx +18 -0
- package/app-template/src/app/[pz]/account/layout.tsx +23 -2
- package/app-template/src/app/[pz]/account/orders/(list)/layout.tsx +20 -0
- package/app-template/src/app/[pz]/account/orders/[id]/{layout.tsx → (detail)/layout.tsx} +11 -1
- package/app-template/src/app/[pz]/account/profile/layout.tsx +18 -0
- package/app-template/src/app/[pz]/layout.tsx +12 -2
- package/package.json +1 -1
- /package/app-template/src/app/[pz]/account/{page.tsx → (dashboard)/page.tsx} +0 -0
- /package/app-template/src/app/[pz]/account/orders/{page.tsx → (list)/page.tsx} +0 -0
- /package/app-template/src/app/[pz]/account/orders/[id]/{page.tsx → (detail)/page.tsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
-
## 2.0.41
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
- @akinon/
|
|
9
|
-
- @akinon/
|
|
10
|
-
- @akinon/pz-
|
|
11
|
-
- @akinon/pz-
|
|
12
|
-
- @akinon/pz-
|
|
13
|
-
- @akinon/pz-
|
|
14
|
-
- @akinon/pz-
|
|
15
|
-
- @akinon/pz-
|
|
16
|
-
- @akinon/pz-
|
|
17
|
-
- @akinon/pz-
|
|
18
|
-
- @akinon/pz-
|
|
19
|
-
- @akinon/pz-
|
|
20
|
-
- @akinon/pz-
|
|
21
|
-
- @akinon/pz-
|
|
22
|
-
- @akinon/pz-
|
|
23
|
-
- @akinon/pz-
|
|
24
|
-
- @akinon/pz-
|
|
25
|
-
- @akinon/pz-masterpass@2.0.41
|
|
26
|
-
- @akinon/pz-
|
|
27
|
-
- @akinon/pz-
|
|
28
|
-
- @akinon/pz-
|
|
29
|
-
- @akinon/pz-
|
|
30
|
-
- @akinon/pz-
|
|
31
|
-
- @akinon/pz-
|
|
32
|
-
- @akinon/pz-
|
|
33
|
-
- @akinon/pz-
|
|
34
|
-
- @akinon/pz-
|
|
3
|
+
## 2.0.41
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [02840711]
|
|
8
|
+
- @akinon/pz-theme@2.0.41
|
|
9
|
+
- @akinon/next@2.0.41
|
|
10
|
+
- @akinon/pz-akifast@2.0.41
|
|
11
|
+
- @akinon/pz-apple-pay@2.0.41
|
|
12
|
+
- @akinon/pz-b2b@2.0.41
|
|
13
|
+
- @akinon/pz-basket-gift-pack@2.0.41
|
|
14
|
+
- @akinon/pz-bkm@2.0.41
|
|
15
|
+
- @akinon/pz-checkout-gift-pack@2.0.41
|
|
16
|
+
- @akinon/pz-click-collect@2.0.41
|
|
17
|
+
- @akinon/pz-credit-payment@2.0.41
|
|
18
|
+
- @akinon/pz-cybersource-uc@2.0.41
|
|
19
|
+
- @akinon/pz-flow-payment@2.0.41
|
|
20
|
+
- @akinon/pz-google-pay@2.0.41
|
|
21
|
+
- @akinon/pz-gpay@2.0.41
|
|
22
|
+
- @akinon/pz-haso@2.0.41
|
|
23
|
+
- @akinon/pz-hepsipay@2.0.41
|
|
24
|
+
- @akinon/pz-masterpass@2.0.41
|
|
25
|
+
- @akinon/pz-masterpass-rest@2.0.41
|
|
26
|
+
- @akinon/pz-multi-basket@2.0.41
|
|
27
|
+
- @akinon/pz-one-click-checkout@2.0.41
|
|
28
|
+
- @akinon/pz-otp@2.0.41
|
|
29
|
+
- @akinon/pz-pay-on-delivery@2.0.41
|
|
30
|
+
- @akinon/pz-saved-card@2.0.41
|
|
31
|
+
- @akinon/pz-similar-products@2.0.41
|
|
32
|
+
- @akinon/pz-tabby-extension@2.0.41
|
|
33
|
+
- @akinon/pz-tamara-extension@2.0.41
|
|
34
|
+
- @akinon/pz-virtual-try-on@2.0.41
|
|
35
35
|
|
|
36
36
|
## 2.0.40
|
|
37
37
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "2.0.41
|
|
3
|
+
"version": "2.0.41",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,33 +24,33 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "2.0.41
|
|
28
|
-
"@akinon/pz-akifast": "2.0.41
|
|
29
|
-
"@akinon/pz-apple-pay": "2.0.41
|
|
30
|
-
"@akinon/pz-b2b": "2.0.41
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "2.0.41
|
|
32
|
-
"@akinon/pz-bkm": "2.0.41
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "2.0.41
|
|
34
|
-
"@akinon/pz-click-collect": "2.0.41
|
|
35
|
-
"@akinon/pz-credit-payment": "2.0.41
|
|
36
|
-
"@akinon/pz-cybersource-uc": "2.0.41
|
|
37
|
-
"@akinon/pz-flow-payment": "2.0.41
|
|
38
|
-
"@akinon/pz-google-pay": "2.0.41
|
|
39
|
-
"@akinon/pz-gpay": "2.0.41
|
|
40
|
-
"@akinon/pz-haso": "2.0.41
|
|
41
|
-
"@akinon/pz-hepsipay": "2.0.41
|
|
42
|
-
"@akinon/pz-masterpass": "2.0.41
|
|
43
|
-
"@akinon/pz-masterpass-rest": "2.0.41
|
|
44
|
-
"@akinon/pz-multi-basket": "2.0.41
|
|
45
|
-
"@akinon/pz-one-click-checkout": "2.0.41
|
|
46
|
-
"@akinon/pz-otp": "2.0.41
|
|
47
|
-
"@akinon/pz-pay-on-delivery": "2.0.41
|
|
48
|
-
"@akinon/pz-saved-card": "2.0.41
|
|
49
|
-
"@akinon/pz-similar-products": "2.0.41
|
|
50
|
-
"@akinon/pz-tabby-extension": "2.0.41
|
|
51
|
-
"@akinon/pz-tamara-extension": "2.0.41
|
|
52
|
-
"@akinon/pz-theme": "2.0.41
|
|
53
|
-
"@akinon/pz-virtual-try-on": "2.0.41
|
|
27
|
+
"@akinon/next": "2.0.41",
|
|
28
|
+
"@akinon/pz-akifast": "2.0.41",
|
|
29
|
+
"@akinon/pz-apple-pay": "2.0.41",
|
|
30
|
+
"@akinon/pz-b2b": "2.0.41",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "2.0.41",
|
|
32
|
+
"@akinon/pz-bkm": "2.0.41",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "2.0.41",
|
|
34
|
+
"@akinon/pz-click-collect": "2.0.41",
|
|
35
|
+
"@akinon/pz-credit-payment": "2.0.41",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "2.0.41",
|
|
37
|
+
"@akinon/pz-flow-payment": "2.0.41",
|
|
38
|
+
"@akinon/pz-google-pay": "2.0.41",
|
|
39
|
+
"@akinon/pz-gpay": "2.0.41",
|
|
40
|
+
"@akinon/pz-haso": "2.0.41",
|
|
41
|
+
"@akinon/pz-hepsipay": "2.0.41",
|
|
42
|
+
"@akinon/pz-masterpass": "2.0.41",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "2.0.41",
|
|
44
|
+
"@akinon/pz-multi-basket": "2.0.41",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "2.0.41",
|
|
46
|
+
"@akinon/pz-otp": "2.0.41",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "2.0.41",
|
|
48
|
+
"@akinon/pz-saved-card": "2.0.41",
|
|
49
|
+
"@akinon/pz-similar-products": "2.0.41",
|
|
50
|
+
"@akinon/pz-tabby-extension": "2.0.41",
|
|
51
|
+
"@akinon/pz-tamara-extension": "2.0.41",
|
|
52
|
+
"@akinon/pz-theme": "2.0.41",
|
|
53
|
+
"@akinon/pz-virtual-try-on": "2.0.41",
|
|
54
54
|
"@hookform/resolvers": "2.9.0",
|
|
55
55
|
"@next/third-parties": "16.2.6",
|
|
56
56
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"yup": "0.32.11"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@akinon/eslint-plugin-projectzero": "2.0.41
|
|
77
|
+
"@akinon/eslint-plugin-projectzero": "2.0.41",
|
|
78
78
|
"@semantic-release/changelog": "6.0.2",
|
|
79
79
|
"@semantic-release/exec": "6.0.3",
|
|
80
80
|
"@semantic-release/git": "10.0.1",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
// The account root screen lives in its own route group so its takeover slug
|
|
6
|
+
// covers exactly this screen, not the whole account subtree.
|
|
7
|
+
export default function DashboardLayout({
|
|
8
|
+
children
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<AccountPageSlot
|
|
14
|
+
slug={PLACEHOLDER_SLUGS.accountDashboard}
|
|
15
|
+
path={ROUTES.ACCOUNT}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</AccountPageSlot>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
|
|
2
|
+
import { buildAccountPageContext } from '@akinon/pz-theme/src/chrome/page-context';
|
|
3
|
+
import { auth } from 'auth';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shared takeover slot for the account subpages. Each subpage keeps its own
|
|
7
|
+
* layout so a composition replaces exactly one screen — a single slot higher
|
|
8
|
+
* up would leak one composition across every account route.
|
|
9
|
+
*/
|
|
10
|
+
export default async function AccountPageSlot({
|
|
11
|
+
slug,
|
|
12
|
+
path,
|
|
13
|
+
children
|
|
14
|
+
}: {
|
|
15
|
+
slug: string;
|
|
16
|
+
path: string;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}) {
|
|
19
|
+
// The account layout above already gates auth; this read only feeds the
|
|
20
|
+
// context's user fields. Null-safe on purpose: nested layouts render in
|
|
21
|
+
// parallel with the parent's redirect for signed-out visitors.
|
|
22
|
+
const session = await auth();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<ChromeSlot
|
|
26
|
+
slug={slug}
|
|
27
|
+
fallback={children}
|
|
28
|
+
pageContext={buildAccountPageContext({
|
|
29
|
+
path,
|
|
30
|
+
sessionUser: (session?.user as Record<string, unknown>) ?? null
|
|
31
|
+
})}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function AddressLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountAddresses}
|
|
13
|
+
path={ROUTES.ACCOUNT_ADDRESS}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function ChangeEmailLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountChangeEmail}
|
|
13
|
+
path={ROUTES.ACCOUNT_CHANGE_EMAIL}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function ChangePasswordLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountChangePassword}
|
|
13
|
+
path={ROUTES.ACCOUNT_CHANGE_PASSWORD}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function ContactLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountContact}
|
|
13
|
+
path={ROUTES.ACCOUNT_CONTACT}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function CouponsLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountCoupons}
|
|
13
|
+
path={ROUTES.ACCOUNT_COUPONS}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function FaqLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot slug={PLACEHOLDER_SLUGS.accountFaq} path={ROUTES.ACCOUNT_FAQ}>
|
|
12
|
+
{children}
|
|
13
|
+
</AccountPageSlot>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function FavouriteProductsLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountFavourites}
|
|
13
|
+
path={ROUTES.ACCOUNT_WISHLIST}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -19,13 +19,34 @@ export default async function AccountLayout({
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Stacked on mobile, two columns on desktop. The brand markup hides
|
|
23
|
+
// itself on the breakpoints it does not serve, but a COMPOSED menu or
|
|
24
|
+
// page body has no such classes — in a no-wrap row it would render
|
|
25
|
+
// crushed next to its sibling on a phone; in a column it stacks.
|
|
26
|
+
<div className="container flex flex-col lg:flex-row py-10 px-4 xl:px-0">
|
|
27
|
+
{/* The menu keeps its own responsive column classes (incl. hiding
|
|
28
|
+
itself on mobile subpages), so the slot chain must stay
|
|
29
|
+
layout-transparent — hence `contents` on both wrappers. A menu
|
|
30
|
+
takeover renders on every account screen and replaces the logout
|
|
31
|
+
button too; the designer rebuilds it from the block vocabulary. */}
|
|
32
|
+
<ChromeSlot
|
|
33
|
+
slug={PLACEHOLDER_SLUGS.accountMenu}
|
|
34
|
+
fallback={<AccountMenu />}
|
|
35
|
+
className="contents"
|
|
36
|
+
fallbackClassName="contents"
|
|
37
|
+
pageContext={buildAccountPageContext({
|
|
38
|
+
path: ROUTES.ACCOUNT,
|
|
39
|
+
sessionUser: session.user as Record<string, unknown>
|
|
40
|
+
})}
|
|
41
|
+
/>
|
|
24
42
|
<div className="w-full flex-1">
|
|
25
43
|
<AccountBackButton />
|
|
26
44
|
{/* The session is already awaited above, so the account context costs
|
|
27
45
|
no extra fetch. Profile-only fields (phone, gender) stay empty
|
|
28
46
|
until a live provider merges them in. */}
|
|
47
|
+
{/* Layout-level band on EVERY account screen. Never give this slot a
|
|
48
|
+
`fallback`: taking the shell over would replace `children` — and
|
|
49
|
+
with it every per-subpage slot mounted below. */}
|
|
29
50
|
<ChromeSlot
|
|
30
51
|
slug={PLACEHOLDER_SLUGS.accountShell}
|
|
31
52
|
pageContext={buildAccountPageContext({
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../../account-page-slot';
|
|
4
|
+
|
|
5
|
+
// The order list lives in its own route group so its takeover slug cannot
|
|
6
|
+
// swallow the order detail and cancellation screens under the same segment.
|
|
7
|
+
export default function OrdersLayout({
|
|
8
|
+
children
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<AccountPageSlot
|
|
14
|
+
slug={PLACEHOLDER_SLUGS.accountOrders}
|
|
15
|
+
path={ROUTES.ACCOUNT_ORDERS}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</AccountPageSlot>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -2,10 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
|
|
3
3
|
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
4
4
|
import { LiveAccountOrderPageContext } from '@akinon/pz-theme/src/chrome/live-order-page-context';
|
|
5
|
+
import { buildAccountPageContext } from '@akinon/pz-theme/src/chrome/page-context';
|
|
6
|
+
import { auth } from 'auth';
|
|
7
|
+
import { ROUTES } from 'routes';
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Account order detail. Publishes the SAME `order` root as the success page,
|
|
8
|
-
* so a composition authored on one resolves on the other.
|
|
11
|
+
* so a composition authored on one resolves on the other. Scoped to its own
|
|
12
|
+
* route group so a composed detail page cannot swallow the cancellation
|
|
13
|
+
* screen under the same order segment.
|
|
9
14
|
*/
|
|
10
15
|
export default async function Layout({
|
|
11
16
|
children,
|
|
@@ -15,6 +20,7 @@ export default async function Layout({
|
|
|
15
20
|
params: Promise<{ id: string }>;
|
|
16
21
|
}) {
|
|
17
22
|
const { id } = await params;
|
|
23
|
+
const session = await auth();
|
|
18
24
|
|
|
19
25
|
return (
|
|
20
26
|
<div>
|
|
@@ -22,6 +28,10 @@ export default async function Layout({
|
|
|
22
28
|
<ChromeSlot
|
|
23
29
|
slug={PLACEHOLDER_SLUGS.accountOrderDetail}
|
|
24
30
|
fallback={children}
|
|
31
|
+
pageContext={buildAccountPageContext({
|
|
32
|
+
path: ROUTES.ACCOUNT_ORDERS,
|
|
33
|
+
sessionUser: (session?.user as Record<string, unknown>) ?? null
|
|
34
|
+
})}
|
|
25
35
|
/>
|
|
26
36
|
</LiveAccountOrderPageContext>
|
|
27
37
|
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
2
|
+
import { ROUTES } from 'routes';
|
|
3
|
+
import AccountPageSlot from '../account-page-slot';
|
|
4
|
+
|
|
5
|
+
export default function ProfileLayout({
|
|
6
|
+
children
|
|
7
|
+
}: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<AccountPageSlot
|
|
12
|
+
slug={PLACEHOLDER_SLUGS.accountProfile}
|
|
13
|
+
path={ROUTES.ACCOUNT_PROFILE}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</AccountPageSlot>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -16,6 +16,9 @@ import { InstallPrompt } from '@theme/components/install-prompt';
|
|
|
16
16
|
import type { Viewport } from 'next';
|
|
17
17
|
import settings from '@theme/settings';
|
|
18
18
|
import RouteHandler from '@theme/components/route-handler';
|
|
19
|
+
import { PreviewAuthStateReporter } from '@akinon/pz-theme/src/chrome/preview-auth-state';
|
|
20
|
+
import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
|
|
21
|
+
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
19
22
|
import './configure-page-context';
|
|
20
23
|
|
|
21
24
|
export const viewport: Viewport = {
|
|
@@ -59,15 +62,22 @@ async function RootLayout({
|
|
|
59
62
|
<ClientRoot>
|
|
60
63
|
<div className="overflow-x-clip">
|
|
61
64
|
<MobileAppToggler>
|
|
62
|
-
<
|
|
65
|
+
<ChromeSlot
|
|
66
|
+
slug={PLACEHOLDER_SLUGS.header}
|
|
67
|
+
fallback={<Header />}
|
|
68
|
+
/>
|
|
63
69
|
</MobileAppToggler>
|
|
64
70
|
<main>
|
|
65
71
|
<OfflineFallback>{children}</OfflineFallback>
|
|
66
72
|
<RouteHandler />
|
|
73
|
+
<PreviewAuthStateReporter />
|
|
67
74
|
<RootModal />
|
|
68
75
|
</main>
|
|
69
76
|
<MobileAppToggler>
|
|
70
|
-
<
|
|
77
|
+
<ChromeSlot
|
|
78
|
+
slug={PLACEHOLDER_SLUGS.footer}
|
|
79
|
+
fallback={<Footer />}
|
|
80
|
+
/>
|
|
71
81
|
</MobileAppToggler>
|
|
72
82
|
<MobileAppToggler>
|
|
73
83
|
<InstallPrompt />
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|