@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.
Files changed (179) hide show
  1. package/CHANGELOG.md +102 -23
  2. package/app-template/.env.example +1 -0
  3. package/app-template/.github/instructions/account.instructions.md +749 -0
  4. package/app-template/.github/instructions/checkout.instructions.md +678 -0
  5. package/app-template/.github/instructions/default.instructions.md +279 -0
  6. package/app-template/.github/instructions/edge-cases.instructions.md +73 -0
  7. package/app-template/.github/instructions/routing.instructions.md +603 -0
  8. package/app-template/.github/instructions/settings.instructions.md +338 -0
  9. package/app-template/.gitignore +3 -0
  10. package/app-template/AGENTS.md +7 -0
  11. package/app-template/CHANGELOG.md +1387 -310
  12. package/app-template/Procfile +1 -1
  13. package/app-template/akinon.json +0 -3
  14. package/app-template/build.sh +10 -0
  15. package/app-template/docs/advanced-usage.md +101 -0
  16. package/app-template/docs/sentry-usage.md +35 -0
  17. package/app-template/next-env.d.ts +1 -0
  18. package/app-template/{next.config.ts → next.config.mjs} +6 -6
  19. package/app-template/package.json +58 -51
  20. package/app-template/postcss.config.mjs +1 -4
  21. package/app-template/public/locales/en/checkout.json +11 -0
  22. package/app-template/public/locales/en/common.json +50 -1
  23. package/app-template/public/locales/en/product.json +62 -1
  24. package/app-template/public/locales/tr/checkout.json +11 -0
  25. package/app-template/public/locales/tr/common.json +50 -1
  26. package/app-template/public/locales/tr/product.json +63 -0
  27. package/app-template/public/masterpass-javascript-sdk-web.min.js +1 -0
  28. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/[...prettyurl]/page.tsx +9 -9
  29. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/layout.tsx +2 -2
  30. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/cancellation/page.tsx +6 -6
  31. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/page.tsx +6 -6
  32. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/page.tsx +1 -1
  33. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/profile/page.tsx +2 -2
  34. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/address/stores/page.tsx +2 -2
  35. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/page.tsx +1 -1
  36. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket/page.tsx +2 -2
  37. package/app-template/src/app/[pz]/category/[pk]/page.tsx +27 -0
  38. package/app-template/src/app/[pz]/flat-page/[pk]/page.tsx +23 -0
  39. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/forms/[pk]/generate/page.tsx +2 -3
  40. package/app-template/src/app/[pz]/group-product/[pk]/page.tsx +93 -0
  41. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/page.tsx +2 -4
  42. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/layout.tsx +3 -10
  43. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/page.tsx +2 -4
  44. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/not-found.tsx +5 -7
  45. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/page.tsx +6 -4
  46. package/app-template/src/app/[pz]/product/[pk]/page.tsx +102 -0
  47. package/app-template/src/app/[pz]/special-page/[pk]/page.tsx +35 -0
  48. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/email-set-primary/[[...id]]/page.tsx +3 -4
  49. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/registration/account-confirm-email/[[...id]]/page.tsx +3 -3
  50. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/reset/[[...id]]/page.tsx +6 -12
  51. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/[node]/route.ts +2 -2
  52. package/app-template/src/app/api/auth/[...nextauth]/route.ts +3 -0
  53. package/app-template/src/app/api/form/[...id]/route.ts +1 -7
  54. package/app-template/src/app/api/image-proxy/route.ts +1 -0
  55. package/app-template/src/app/api/product-categories/route.ts +1 -0
  56. package/app-template/src/app/api/similar-product-list/route.ts +1 -0
  57. package/app-template/src/app/api/similar-products/route.ts +1 -0
  58. package/app-template/src/app/api/virtual-try-on/limited-categories/route.ts +1 -0
  59. package/app-template/src/app/api/virtual-try-on/route.ts +1 -0
  60. package/app-template/src/assets/globals.scss +4 -133
  61. package/app-template/src/auth.ts +3 -0
  62. package/app-template/src/components/__tests__/badge.test.tsx +2 -2
  63. package/app-template/src/components/__tests__/link.test.tsx +2 -0
  64. package/app-template/src/components/accordion.tsx +23 -20
  65. package/app-template/src/components/button.tsx +1 -1
  66. package/app-template/src/components/carousel-core.tsx +4 -11
  67. package/app-template/src/components/checkbox.tsx +1 -1
  68. package/app-template/src/components/currency-select.tsx +1 -0
  69. package/app-template/src/components/file-input.tsx +27 -7
  70. package/app-template/src/components/generate-form-fields.tsx +49 -10
  71. package/app-template/src/components/input.tsx +11 -5
  72. package/app-template/src/components/modal.tsx +32 -16
  73. package/app-template/src/components/pagination.tsx +1 -0
  74. package/app-template/src/components/price.tsx +1 -1
  75. package/app-template/src/components/pwa-tags.tsx +1 -0
  76. package/app-template/src/components/select.tsx +39 -27
  77. package/app-template/src/components/shimmer.tsx +1 -1
  78. package/app-template/src/components/types/index.ts +25 -1
  79. package/app-template/src/hooks/use-fav-button.tsx +4 -8
  80. package/app-template/src/hooks/use-product-cart.ts +77 -0
  81. package/app-template/src/hooks/use-stock-alert.ts +74 -0
  82. package/app-template/src/plugins.js +12 -2
  83. package/app-template/src/redux/middlewares/category.ts +5 -4
  84. package/app-template/src/redux/store.ts +21 -1
  85. package/app-template/src/routes/index.ts +2 -1
  86. package/app-template/src/settings.js +3 -1
  87. package/app-template/src/types/index.ts +74 -3
  88. package/app-template/src/types/next-auth.d.ts +2 -2
  89. package/app-template/src/utils/variant-validation.ts +41 -0
  90. package/app-template/src/views/account/address-form.tsx +8 -4
  91. package/app-template/src/views/account/contact-form.tsx +2 -2
  92. package/app-template/src/views/account/content-header.tsx +4 -3
  93. package/app-template/src/views/account/faq/faq-tabs.tsx +8 -2
  94. package/app-template/src/views/account/order.tsx +1 -1
  95. package/app-template/src/views/account/orders/order-cancellation-item.tsx +1 -1
  96. package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +1 -1
  97. package/app-template/src/views/basket/basket-item.tsx +6 -1
  98. package/app-template/src/views/basket/summary.tsx +16 -0
  99. package/app-template/src/views/breadcrumb.tsx +2 -2
  100. package/app-template/src/views/category/category-info.tsx +2 -1
  101. package/app-template/src/views/category/filters/index.tsx +1 -1
  102. package/app-template/src/views/checkout/auth.tsx +1 -1
  103. package/app-template/src/views/checkout/layout/header.tsx +1 -1
  104. package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +22 -6
  105. package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +25 -5
  106. package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +21 -2
  107. package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +22 -4
  108. package/app-template/src/views/checkout/steps/payment/options/store-credit.tsx +121 -0
  109. package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +4 -4
  110. package/app-template/src/views/checkout/steps/shipping/address-box.tsx +3 -3
  111. package/app-template/src/views/checkout/steps/shipping/addresses.tsx +1 -1
  112. package/app-template/src/views/checkout/summary.tsx +12 -2
  113. package/app-template/src/views/find-in-store/index.tsx +2 -2
  114. package/app-template/src/views/header/action-menu.tsx +2 -6
  115. package/app-template/src/views/header/band.tsx +2 -2
  116. package/app-template/src/views/header/index.tsx +1 -1
  117. package/app-template/src/views/header/mini-basket.tsx +2 -2
  118. package/app-template/src/views/header/mobile-menu.tsx +6 -6
  119. package/app-template/src/views/header/navbar.tsx +1 -1
  120. package/app-template/src/views/header/pwa-back-button.tsx +1 -1
  121. package/app-template/src/views/header/search/index.tsx +13 -3
  122. package/app-template/src/views/header/search/results.tsx +1 -1
  123. package/app-template/src/views/header/user-menu.tsx +1 -3
  124. package/app-template/src/views/login/index.tsx +14 -13
  125. package/app-template/src/views/otp-login/index.tsx +11 -6
  126. package/app-template/src/views/product/layout.tsx +15 -1
  127. package/app-template/src/views/product/product-actions.tsx +165 -0
  128. package/app-template/src/views/product/product-info.tsx +69 -261
  129. package/app-template/src/views/product/product-share.tsx +56 -0
  130. package/app-template/src/views/product/product-variants.tsx +26 -0
  131. package/app-template/src/views/product/slider.tsx +22 -1
  132. package/app-template/src/views/product-pointer-banner-item.tsx +1 -1
  133. package/app-template/src/views/register/index.tsx +17 -21
  134. package/app-template/src/views/sales-contract-modal/index.tsx +17 -17
  135. package/app-template/src/widgets/footer-info.tsx +1 -1
  136. package/app-template/src/widgets/footer-menu.tsx +7 -3
  137. package/app-template/src/widgets/footer-subscription/index.tsx +1 -1
  138. package/app-template/src/widgets/home-stories-eng.tsx +43 -35
  139. package/app-template/tailwind.config.js +129 -1
  140. package/app-template/tsconfig.json +29 -11
  141. package/codemods/migrate-segments/index.js +591 -0
  142. package/commands/plugins.ts +62 -14
  143. package/dist/commands/plugins.js +62 -14
  144. package/package.json +1 -1
  145. package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +0 -22
  146. package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +0 -20
  147. package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +0 -74
  148. package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +0 -84
  149. package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +0 -27
  150. package/app-template/src/pages/api/auth/[...nextauth].ts +0 -3
  151. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/address/page.tsx +0 -0
  152. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-email/page.tsx +0 -0
  153. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-password/page.tsx +0 -0
  154. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/contact/page.tsx +0 -0
  155. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/coupons/page.tsx +0 -0
  156. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/email-verification/page.tsx +0 -0
  157. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/faq/page.tsx +0 -0
  158. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/favourite-products/page.tsx +0 -0
  159. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/my-quotations/page.tsx +0 -0
  160. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/layout.tsx +0 -0
  161. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/page.tsx +0 -0
  162. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/anonymous-tracking/page.tsx +0 -0
  163. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/oauth-login/page.tsx +0 -0
  164. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket-b2b/page.tsx +0 -0
  165. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/loading.tsx +0 -0
  166. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/client-root.tsx +0 -0
  167. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/contact-us/page.tsx +0 -0
  168. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/error.tsx +0 -0
  169. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/loading.tsx +0 -0
  170. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/loading.tsx +0 -0
  171. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/loading.tsx +0 -0
  172. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/loading.tsx +0 -0
  173. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/checkout/page.tsx +0 -0
  174. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/layout.tsx +0 -0
  175. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/page.tsx +0 -0
  176. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/loading.tsx +0 -0
  177. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/template.tsx +0 -0
  178. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/password/reset/page.tsx +0 -0
  179. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/route.ts +0 -0
@@ -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: 'Click & Collect',
103
- value: 'pz-click-collect'
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: 'One Click Checkout',
111
- value: 'pz-one-click-checkout'
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: 'Pay On Delivery',
119
- value: 'pz-pay-on-delivery'
134
+ name: 'Masterpass',
135
+ value: 'pz-masterpass'
120
136
  },
121
137
  {
122
- name: 'Otp',
123
- value: 'pz-otp'
138
+ name: 'Multi Basket',
139
+ value: 'pz-multi-basket'
124
140
  },
125
141
  {
126
- name: 'BKM Express',
127
- value: 'pz-bkm'
142
+ name: 'One Click Checkout',
143
+ value: 'pz-one-click-checkout'
128
144
  },
129
145
  {
130
- name: 'Credit Payment',
131
- value: 'pz-credit-payment'
146
+ name: 'Otp',
147
+ value: 'pz-otp'
132
148
  },
133
149
  {
134
- name: 'Multi Basket',
135
- value: 'pz-multi-basket'
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.0-beta.12",
3
+ "version": "2.0.0-beta.14",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {
@@ -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' });
@@ -1,3 +0,0 @@
1
- import Auth from '@akinon/next/api/auth';
2
-
3
- export default Auth;