@akinon/projectzero 2.0.0-beta.12 → 2.0.0-beta.14
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 +102 -23
- package/app-template/.env.example +1 -0
- package/app-template/.github/instructions/account.instructions.md +749 -0
- package/app-template/.github/instructions/checkout.instructions.md +678 -0
- package/app-template/.github/instructions/default.instructions.md +279 -0
- package/app-template/.github/instructions/edge-cases.instructions.md +73 -0
- package/app-template/.github/instructions/routing.instructions.md +603 -0
- package/app-template/.github/instructions/settings.instructions.md +338 -0
- package/app-template/.gitignore +3 -0
- package/app-template/AGENTS.md +7 -0
- package/app-template/CHANGELOG.md +1387 -310
- package/app-template/Procfile +1 -1
- package/app-template/akinon.json +0 -3
- package/app-template/build.sh +10 -0
- package/app-template/docs/advanced-usage.md +101 -0
- package/app-template/docs/sentry-usage.md +35 -0
- package/app-template/next-env.d.ts +1 -0
- package/app-template/{next.config.ts → next.config.mjs} +6 -6
- package/app-template/package.json +58 -51
- package/app-template/postcss.config.mjs +1 -4
- package/app-template/public/locales/en/checkout.json +11 -0
- package/app-template/public/locales/en/common.json +50 -1
- package/app-template/public/locales/en/product.json +62 -1
- package/app-template/public/locales/tr/checkout.json +11 -0
- package/app-template/public/locales/tr/common.json +50 -1
- package/app-template/public/locales/tr/product.json +63 -0
- package/app-template/public/masterpass-javascript-sdk-web.min.js +1 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/[...prettyurl]/page.tsx +9 -9
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/layout.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/cancellation/page.tsx +6 -6
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/page.tsx +6 -6
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/page.tsx +1 -1
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/profile/page.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/address/stores/page.tsx +2 -2
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/page.tsx +1 -1
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket/page.tsx +2 -2
- package/app-template/src/app/[pz]/category/[pk]/page.tsx +27 -0
- package/app-template/src/app/[pz]/flat-page/[pk]/page.tsx +23 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/forms/[pk]/generate/page.tsx +2 -3
- package/app-template/src/app/[pz]/group-product/[pk]/page.tsx +93 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/page.tsx +2 -4
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/layout.tsx +3 -10
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/page.tsx +2 -4
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/not-found.tsx +5 -7
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/page.tsx +6 -4
- package/app-template/src/app/[pz]/product/[pk]/page.tsx +102 -0
- package/app-template/src/app/[pz]/special-page/[pk]/page.tsx +35 -0
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/email-set-primary/[[...id]]/page.tsx +3 -4
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/registration/account-confirm-email/[[...id]]/page.tsx +3 -3
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/reset/[[...id]]/page.tsx +6 -12
- package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/[node]/route.ts +2 -2
- package/app-template/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/app-template/src/app/api/form/[...id]/route.ts +1 -7
- package/app-template/src/app/api/image-proxy/route.ts +1 -0
- package/app-template/src/app/api/product-categories/route.ts +1 -0
- package/app-template/src/app/api/similar-product-list/route.ts +1 -0
- package/app-template/src/app/api/similar-products/route.ts +1 -0
- package/app-template/src/app/api/virtual-try-on/limited-categories/route.ts +1 -0
- package/app-template/src/app/api/virtual-try-on/route.ts +1 -0
- package/app-template/src/assets/globals.scss +4 -133
- package/app-template/src/auth.ts +3 -0
- package/app-template/src/components/__tests__/badge.test.tsx +2 -2
- package/app-template/src/components/__tests__/link.test.tsx +2 -0
- package/app-template/src/components/accordion.tsx +23 -20
- package/app-template/src/components/button.tsx +1 -1
- package/app-template/src/components/carousel-core.tsx +4 -11
- package/app-template/src/components/checkbox.tsx +1 -1
- package/app-template/src/components/currency-select.tsx +1 -0
- package/app-template/src/components/file-input.tsx +27 -7
- package/app-template/src/components/generate-form-fields.tsx +49 -10
- package/app-template/src/components/input.tsx +11 -5
- package/app-template/src/components/modal.tsx +32 -16
- package/app-template/src/components/pagination.tsx +1 -0
- package/app-template/src/components/price.tsx +1 -1
- package/app-template/src/components/pwa-tags.tsx +1 -0
- package/app-template/src/components/select.tsx +39 -27
- package/app-template/src/components/shimmer.tsx +1 -1
- package/app-template/src/components/types/index.ts +25 -1
- package/app-template/src/hooks/use-fav-button.tsx +4 -8
- package/app-template/src/hooks/use-product-cart.ts +77 -0
- package/app-template/src/hooks/use-stock-alert.ts +74 -0
- package/app-template/src/plugins.js +12 -2
- package/app-template/src/redux/middlewares/category.ts +5 -4
- package/app-template/src/redux/store.ts +21 -1
- package/app-template/src/routes/index.ts +2 -1
- package/app-template/src/settings.js +3 -1
- package/app-template/src/types/index.ts +74 -3
- package/app-template/src/types/next-auth.d.ts +2 -2
- package/app-template/src/utils/variant-validation.ts +41 -0
- package/app-template/src/views/account/address-form.tsx +8 -4
- package/app-template/src/views/account/contact-form.tsx +2 -2
- package/app-template/src/views/account/content-header.tsx +4 -3
- package/app-template/src/views/account/faq/faq-tabs.tsx +8 -2
- package/app-template/src/views/account/order.tsx +1 -1
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +1 -1
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +1 -1
- package/app-template/src/views/basket/basket-item.tsx +6 -1
- package/app-template/src/views/basket/summary.tsx +16 -0
- package/app-template/src/views/breadcrumb.tsx +2 -2
- package/app-template/src/views/category/category-info.tsx +2 -1
- package/app-template/src/views/category/filters/index.tsx +1 -1
- package/app-template/src/views/checkout/auth.tsx +1 -1
- package/app-template/src/views/checkout/layout/header.tsx +1 -1
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +22 -6
- package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +25 -5
- package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +21 -2
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +22 -4
- package/app-template/src/views/checkout/steps/payment/options/store-credit.tsx +121 -0
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +4 -4
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +3 -3
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +1 -1
- package/app-template/src/views/checkout/summary.tsx +12 -2
- package/app-template/src/views/find-in-store/index.tsx +2 -2
- package/app-template/src/views/header/action-menu.tsx +2 -6
- package/app-template/src/views/header/band.tsx +2 -2
- package/app-template/src/views/header/index.tsx +1 -1
- package/app-template/src/views/header/mini-basket.tsx +2 -2
- package/app-template/src/views/header/mobile-menu.tsx +6 -6
- package/app-template/src/views/header/navbar.tsx +1 -1
- package/app-template/src/views/header/pwa-back-button.tsx +1 -1
- package/app-template/src/views/header/search/index.tsx +13 -3
- package/app-template/src/views/header/search/results.tsx +1 -1
- package/app-template/src/views/header/user-menu.tsx +1 -3
- package/app-template/src/views/login/index.tsx +14 -13
- package/app-template/src/views/otp-login/index.tsx +11 -6
- package/app-template/src/views/product/layout.tsx +15 -1
- package/app-template/src/views/product/product-actions.tsx +165 -0
- package/app-template/src/views/product/product-info.tsx +69 -261
- package/app-template/src/views/product/product-share.tsx +56 -0
- package/app-template/src/views/product/product-variants.tsx +26 -0
- package/app-template/src/views/product/slider.tsx +22 -1
- package/app-template/src/views/product-pointer-banner-item.tsx +1 -1
- package/app-template/src/views/register/index.tsx +17 -21
- package/app-template/src/views/sales-contract-modal/index.tsx +17 -17
- package/app-template/src/widgets/footer-info.tsx +1 -1
- package/app-template/src/widgets/footer-menu.tsx +7 -3
- package/app-template/src/widgets/footer-subscription/index.tsx +1 -1
- package/app-template/src/widgets/home-stories-eng.tsx +43 -35
- package/app-template/tailwind.config.js +129 -1
- package/app-template/tsconfig.json +29 -11
- package/codemods/migrate-segments/index.js +591 -0
- package/commands/plugins.ts +62 -14
- package/dist/commands/plugins.js +62 -14
- package/package.json +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +0 -22
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +0 -20
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +0 -74
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +0 -84
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +0 -27
- package/app-template/src/pages/api/auth/[...nextauth].ts +0 -3
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/address/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-email/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-password/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/contact/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/coupons/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/email-verification/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/faq/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/favourite-products/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/my-quotations/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/anonymous-tracking/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/oauth-login/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket-b2b/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/client-root.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/contact-us/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/error.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/checkout/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/layout.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/loading.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/template.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/password/reset/page.tsx +0 -0
- /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/route.ts +0 -0
package/dist/commands/plugins.js
CHANGED
|
@@ -94,45 +94,65 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
94
94
|
process.exit(1);
|
|
95
95
|
}
|
|
96
96
|
const definedPlugins = [
|
|
97
|
+
{
|
|
98
|
+
name: 'Akifast',
|
|
99
|
+
value: 'pz-akifast'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'Apple Pay',
|
|
103
|
+
value: 'pz-apple-pay'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'B2B',
|
|
107
|
+
value: 'pz-b2b'
|
|
108
|
+
},
|
|
97
109
|
{
|
|
98
110
|
name: 'Basket Gift Pack',
|
|
99
111
|
value: 'pz-basket-gift-pack'
|
|
100
112
|
},
|
|
101
113
|
{
|
|
102
|
-
name: '
|
|
103
|
-
value: 'pz-
|
|
114
|
+
name: 'BKM Express',
|
|
115
|
+
value: 'pz-bkm'
|
|
104
116
|
},
|
|
105
117
|
{
|
|
106
118
|
name: 'Checkout Gift Pack',
|
|
107
119
|
value: 'pz-checkout-gift-pack'
|
|
108
120
|
},
|
|
109
121
|
{
|
|
110
|
-
name: '
|
|
111
|
-
value: 'pz-
|
|
122
|
+
name: 'Click & Collect',
|
|
123
|
+
value: 'pz-click-collect'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'Credit Payment',
|
|
127
|
+
value: 'pz-credit-payment'
|
|
112
128
|
},
|
|
113
129
|
{
|
|
114
130
|
name: 'Garanti Pay',
|
|
115
131
|
value: 'pz-gpay'
|
|
116
132
|
},
|
|
117
133
|
{
|
|
118
|
-
name: '
|
|
119
|
-
value: 'pz-
|
|
134
|
+
name: 'Masterpass',
|
|
135
|
+
value: 'pz-masterpass'
|
|
120
136
|
},
|
|
121
137
|
{
|
|
122
|
-
name: '
|
|
123
|
-
value: 'pz-
|
|
138
|
+
name: 'Multi Basket',
|
|
139
|
+
value: 'pz-multi-basket'
|
|
124
140
|
},
|
|
125
141
|
{
|
|
126
|
-
name: '
|
|
127
|
-
value: 'pz-
|
|
142
|
+
name: 'One Click Checkout',
|
|
143
|
+
value: 'pz-one-click-checkout'
|
|
128
144
|
},
|
|
129
145
|
{
|
|
130
|
-
name: '
|
|
131
|
-
value: 'pz-
|
|
146
|
+
name: 'Otp',
|
|
147
|
+
value: 'pz-otp'
|
|
132
148
|
},
|
|
133
149
|
{
|
|
134
|
-
name: '
|
|
135
|
-
value: 'pz-
|
|
150
|
+
name: 'Pay On Delivery',
|
|
151
|
+
value: 'pz-pay-on-delivery'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Saved Card',
|
|
155
|
+
value: 'pz-saved-card'
|
|
136
156
|
},
|
|
137
157
|
{
|
|
138
158
|
name: 'Tabby Payment Extension',
|
|
@@ -141,6 +161,34 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
141
161
|
{
|
|
142
162
|
name: 'Tamara Payment Extension',
|
|
143
163
|
value: 'pz-tamara-extension'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'Hepsipay',
|
|
167
|
+
value: 'pz-hepsipay'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'Flow Payment',
|
|
171
|
+
value: 'pz-flow-payment'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'Virtual Try-On',
|
|
175
|
+
value: 'pz-virtual-try-on'
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'Masterpass Rest',
|
|
179
|
+
value: 'pz-masterpass-rest'
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'Similar Products',
|
|
183
|
+
value: 'pz-similar-products'
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'Haso Payment Gateway',
|
|
187
|
+
value: 'pz-haso'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'Google Pay',
|
|
191
|
+
value: 'pz-google-pay'
|
|
144
192
|
}
|
|
145
193
|
];
|
|
146
194
|
try {
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { getCategoryData } from '@akinon/next/data/server';
|
|
2
|
-
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
|
-
import { PageProps } from '@akinon/next/types';
|
|
4
|
-
import CategoryLayout from '@theme/views/category/layout';
|
|
5
|
-
|
|
6
|
-
async function Page(props: PageProps<{ pk: number }>) {
|
|
7
|
-
const params = await props.params;
|
|
8
|
-
const searchParams = await props.searchParams;
|
|
9
|
-
|
|
10
|
-
const { data, breadcrumbData } = await getCategoryData({
|
|
11
|
-
pk: params.pk,
|
|
12
|
-
searchParams
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<CategoryLayout data={data} breadcrumbData={breadcrumbData} />
|
|
18
|
-
</>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getFlatPageData } from '@akinon/next/data/server';
|
|
2
|
-
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
|
-
import { PageProps } from '@akinon/next/types';
|
|
4
|
-
|
|
5
|
-
async function Page(props: PageProps<{ pk: number }>) {
|
|
6
|
-
const params = await props.params;
|
|
7
|
-
|
|
8
|
-
const data = await getFlatPageData({ pk: params.pk });
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<div className="container mx-auto py-6">
|
|
12
|
-
<div
|
|
13
|
-
className="mx-auto prose prose-headings:text-primary"
|
|
14
|
-
dangerouslySetInnerHTML={{ __html: data.flat_page.content }}
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import ProductLayout from '@theme/views/product/layout';
|
|
2
|
-
import { ProductGroupInfo } from '@theme/views/product';
|
|
3
|
-
import { getProductData, getWidgetData } from '@akinon/next/data/server';
|
|
4
|
-
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
5
|
-
import { PageProps, Metadata } from '@akinon/next/types';
|
|
6
|
-
import { generateJsonLd } from '@theme/utils/generate-jsonld';
|
|
7
|
-
|
|
8
|
-
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
|
9
|
-
let result: Metadata = {};
|
|
10
|
-
const searchParams = await props.searchParams;
|
|
11
|
-
const params = await props.params;
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const {
|
|
15
|
-
data: { product }
|
|
16
|
-
} = await getProductData({
|
|
17
|
-
pk: params.pk,
|
|
18
|
-
searchParams,
|
|
19
|
-
groupProduct: true
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
result = {
|
|
23
|
-
title: product.name,
|
|
24
|
-
description: String(product.attributes.description),
|
|
25
|
-
twitter: {
|
|
26
|
-
title: product.name,
|
|
27
|
-
description: String(product.attributes.description)
|
|
28
|
-
},
|
|
29
|
-
openGraph: {
|
|
30
|
-
title: product.name,
|
|
31
|
-
description: String(product.attributes.description),
|
|
32
|
-
images: product.productimage_set?.map((item) => ({
|
|
33
|
-
url: item.image
|
|
34
|
-
}))
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
// eslint-disable-next-line no-empty
|
|
38
|
-
} catch (error) {}
|
|
39
|
-
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function Page(props: PageProps<{ pk: number }>) {
|
|
44
|
-
const params = await props.params;
|
|
45
|
-
const searchParams = await props.searchParams;
|
|
46
|
-
|
|
47
|
-
const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
|
|
48
|
-
getProductData({
|
|
49
|
-
pk: params.pk,
|
|
50
|
-
searchParams,
|
|
51
|
-
groupProduct: true
|
|
52
|
-
}),
|
|
53
|
-
getWidgetData({ slug: 'product-delivery-returns' })
|
|
54
|
-
]);
|
|
55
|
-
|
|
56
|
-
const jsonLd = generateJsonLd(data.product);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<>
|
|
60
|
-
<ProductLayout data={data} breadcrumbData={breadcrumbData}>
|
|
61
|
-
<ProductGroupInfo
|
|
62
|
-
data={data}
|
|
63
|
-
deliveryReturn={deliveryReturn?.attributes}
|
|
64
|
-
/>
|
|
65
|
-
</ProductLayout>
|
|
66
|
-
<script
|
|
67
|
-
type="application/ld+json"
|
|
68
|
-
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
|
69
|
-
/>
|
|
70
|
-
</>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { getProductData, getWidgetData } from '@akinon/next/data/server';
|
|
2
|
-
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
|
-
import { PageProps, Metadata } from '@akinon/next/types';
|
|
4
|
-
import { generateJsonLd } from '@theme/utils/generate-jsonld';
|
|
5
|
-
import { AccordionWrapper, ProductInfo } from '@theme/views/product';
|
|
6
|
-
import ProductLayout from '@theme/views/product/layout';
|
|
7
|
-
|
|
8
|
-
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
|
9
|
-
let result: Metadata = {};
|
|
10
|
-
|
|
11
|
-
const params = await props.params;
|
|
12
|
-
const searchParams = await props.searchParams;
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const {
|
|
16
|
-
data: { product }
|
|
17
|
-
} = await getProductData({
|
|
18
|
-
pk: params.pk,
|
|
19
|
-
searchParams
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
result = {
|
|
23
|
-
title: product.name,
|
|
24
|
-
description: String(product.attributes.description),
|
|
25
|
-
twitter: {
|
|
26
|
-
title: product.name,
|
|
27
|
-
description: String(product.attributes.description)
|
|
28
|
-
},
|
|
29
|
-
openGraph: {
|
|
30
|
-
title: product.name,
|
|
31
|
-
description: String(product.attributes.description),
|
|
32
|
-
images: product.productimage_set?.map((item) => ({
|
|
33
|
-
url: item.image
|
|
34
|
-
}))
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
// eslint-disable-next-line no-empty
|
|
38
|
-
} catch (error) {}
|
|
39
|
-
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function Page(props: PageProps<{ pk: number }>) {
|
|
44
|
-
const params = await props.params;
|
|
45
|
-
const searchParams = await props.searchParams;
|
|
46
|
-
|
|
47
|
-
const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
|
|
48
|
-
getProductData({
|
|
49
|
-
pk: params.pk,
|
|
50
|
-
searchParams
|
|
51
|
-
}),
|
|
52
|
-
getWidgetData({ slug: 'product-delivery-returns' })
|
|
53
|
-
]);
|
|
54
|
-
|
|
55
|
-
const jsonLd = generateJsonLd(data.product);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<>
|
|
59
|
-
<ProductLayout data={data} breadcrumbData={breadcrumbData}>
|
|
60
|
-
<div className="flex flex-col items-center">
|
|
61
|
-
<h1
|
|
62
|
-
className="mt-4 text-2xl text-center md:mt-0"
|
|
63
|
-
data-testid="product-name"
|
|
64
|
-
>
|
|
65
|
-
{data.product.name}
|
|
66
|
-
</h1>
|
|
67
|
-
|
|
68
|
-
<ProductInfo data={data} />
|
|
69
|
-
|
|
70
|
-
<AccordionWrapper
|
|
71
|
-
data={data}
|
|
72
|
-
deliveryReturn={deliveryReturn?.attributes}
|
|
73
|
-
/>
|
|
74
|
-
</div>
|
|
75
|
-
</ProductLayout>
|
|
76
|
-
<script
|
|
77
|
-
type="application/ld+json"
|
|
78
|
-
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
|
79
|
-
/>
|
|
80
|
-
</>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getSpecialPageData } from '@akinon/next/data/server';
|
|
2
|
-
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
|
-
import { PageProps } from '@akinon/next/types';
|
|
4
|
-
import CategoryLayout from '@theme/views/category/layout';
|
|
5
|
-
import SpecialPageBanner from '@theme/widgets/special-page-banner';
|
|
6
|
-
import SpecialPageCarousel from '@theme/widgets/special-page-carousel';
|
|
7
|
-
|
|
8
|
-
async function Page(props: PageProps<{ pk: number }>) {
|
|
9
|
-
const params = await props.params;
|
|
10
|
-
const searchParams = await props.searchParams;
|
|
11
|
-
const data = await getSpecialPageData({ pk: params.pk, searchParams });
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<>
|
|
15
|
-
<CategoryLayout data={data}>
|
|
16
|
-
{data.special_page && (
|
|
17
|
-
<>
|
|
18
|
-
<SpecialPageBanner data={data.special_page} />
|
|
19
|
-
<SpecialPageCarousel slug={data.special_page.video_embedded_code} />
|
|
20
|
-
</>
|
|
21
|
-
)}
|
|
22
|
-
</CategoryLayout>
|
|
23
|
-
</>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/address/page.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-email/page.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/contact/page.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/coupons/page.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/my-quotations/page.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/layout.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/page.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/anonymous-tracking/page.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/oauth-login/page.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/loading.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/loading.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/loading.tsx
RENAMED
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/loading.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/checkout/page.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/loading.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/password/reset/page.tsx
RENAMED
|
File without changes
|
|
File without changes
|