@akinon/projectzero 1.76.0-rc.0 → 2.0.0-beta.1

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 (41) hide show
  1. package/CHANGELOG.md +8 -3
  2. package/app-template/.gitignore +0 -2
  3. package/app-template/CHANGELOG.md +167 -2620
  4. package/app-template/next-env.d.ts +1 -1
  5. package/app-template/package.json +35 -35
  6. package/app-template/sentry.edge.config.ts +3 -0
  7. package/app-template/sentry.server.config.ts +3 -0
  8. package/app-template/src/app/[commerce]/[locale]/[currency]/[...prettyurl]/page.tsx +6 -4
  9. package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +5 -3
  10. package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +5 -3
  11. package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +1 -1
  12. package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +82 -9
  13. package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +4 -1
  14. package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +3 -1
  15. package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +4 -2
  16. package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +7 -5
  17. package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +3 -1
  18. package/app-template/src/app/[commerce]/[locale]/[currency]/layout.tsx +3 -1
  19. package/app-template/src/app/[commerce]/[locale]/[currency]/list/page.tsx +3 -1
  20. package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +3 -7
  21. package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +8 -5
  22. package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +3 -1
  23. package/app-template/src/app/[commerce]/[locale]/[currency]/users/email-set-primary/[[...id]]/page.tsx +4 -1
  24. package/app-template/src/app/[commerce]/[locale]/[currency]/users/registration/account-confirm-email/[[...id]]/page.tsx +3 -1
  25. package/app-template/src/app/[commerce]/[locale]/[currency]/users/reset/[[...id]]/page.tsx +11 -3
  26. package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +1 -1
  27. package/app-template/src/components/pwa-tags.tsx +0 -1
  28. package/app-template/src/settings.js +1 -6
  29. package/app-template/src/views/account/address-form.tsx +2 -2
  30. package/app-template/src/views/account/contact-form.tsx +1 -1
  31. package/app-template/src/views/basket/basket-item.tsx +13 -16
  32. package/app-template/src/views/basket/summary.tsx +7 -10
  33. package/app-template/src/views/guest-login/index.tsx +1 -1
  34. package/app-template/src/views/header/mini-basket.tsx +1 -1
  35. package/app-template/src/views/otp-login/index.tsx +1 -1
  36. package/app-template/src/views/register/index.tsx +1 -1
  37. package/dist/commands/commerce-url.js +17 -7
  38. package/dist/commands/create.js +17 -7
  39. package/dist/commands/plugins.js +17 -7
  40. package/package.json +1 -1
  41. package/app-template/src/views/basket/basket-content.tsx +0 -106
@@ -3,4 +3,4 @@
3
3
  /// <reference types="next/navigation-types/compat/navigation" />
4
4
 
5
5
  // NOTE: This file should not be edited
6
- // see https://nextjs.org/docs/basic-features/typescript for more information.
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "1.76.0-rc.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -22,34 +22,34 @@
22
22
  "prestart": "pz-prestart"
23
23
  },
24
24
  "dependencies": {
25
- "@akinon/next": "1.76.0-rc.0",
26
- "@akinon/pz-akifast": "1.76.0-rc.0",
27
- "@akinon/pz-b2b": "1.76.0-rc.0",
28
- "@akinon/pz-basket-gift-pack": "1.76.0-rc.0",
29
- "@akinon/pz-bkm": "1.76.0-rc.0",
30
- "@akinon/pz-checkout-gift-pack": "1.76.0-rc.0",
31
- "@akinon/pz-click-collect": "1.76.0-rc.0",
32
- "@akinon/pz-credit-payment": "1.76.0-rc.0",
33
- "@akinon/pz-gpay": "1.76.0-rc.0",
34
- "@akinon/pz-masterpass": "1.76.0-rc.0",
35
- "@akinon/pz-one-click-checkout": "1.76.0-rc.0",
36
- "@akinon/pz-otp": "1.76.0-rc.0",
37
- "@akinon/pz-pay-on-delivery": "1.76.0-rc.0",
38
- "@akinon/pz-saved-card": "1.76.0-rc.0",
39
- "@akinon/pz-tabby-extension": "1.76.0-rc.0",
25
+ "@akinon/next": "2.0.0-beta.1",
26
+ "@akinon/pz-akifast": "2.0.0-beta.1",
27
+ "@akinon/pz-b2b": "2.0.0-beta.1",
28
+ "@akinon/pz-basket-gift-pack": "2.0.0-beta.1",
29
+ "@akinon/pz-bkm": "2.0.0-beta.1",
30
+ "@akinon/pz-checkout-gift-pack": "2.0.0-beta.1",
31
+ "@akinon/pz-click-collect": "2.0.0-beta.1",
32
+ "@akinon/pz-credit-payment": "2.0.0-beta.1",
33
+ "@akinon/pz-gpay": "2.0.0-beta.1",
34
+ "@akinon/pz-masterpass": "2.0.0-beta.1",
35
+ "@akinon/pz-one-click-checkout": "2.0.0-beta.1",
36
+ "@akinon/pz-otp": "2.0.0-beta.1",
37
+ "@akinon/pz-pay-on-delivery": "2.0.0-beta.1",
38
+ "@akinon/pz-saved-card": "2.0.0-beta.1",
39
+ "@akinon/pz-tabby-extension": "2.0.0-beta.1",
40
40
  "@hookform/resolvers": "2.9.0",
41
41
  "@next/third-parties": "14.1.0",
42
42
  "@react-google-maps/api": "2.17.1",
43
- "@sentry/nextjs": "8.35.0",
43
+ "@sentry/nextjs": "7.116.0",
44
44
  "dayjs": "1.11.5",
45
45
  "lossless-json": "2.0.5",
46
- "next": "14.2.5",
47
- "next-auth": "4.24.5",
46
+ "next": "15.1.2",
47
+ "next-auth": "4.24.11",
48
48
  "next-pwa": "5.6.0",
49
49
  "pino": "8.11.0",
50
- "postcss": "8.4.49",
51
- "react": "18.2.0",
52
- "react-dom": "18.2.0",
50
+ "postcss": "8.4.31",
51
+ "react": "19.0.0",
52
+ "react-dom": "19.0.0",
53
53
  "react-google-recaptcha": "2.1.0",
54
54
  "react-hook-form": "7.31.3",
55
55
  "react-intersection-observer": "9.4.0",
@@ -61,7 +61,7 @@
61
61
  "yup": "0.32.11"
62
62
  },
63
63
  "devDependencies": {
64
- "@akinon/eslint-plugin-projectzero": "1.76.0-rc.0",
64
+ "@akinon/eslint-plugin-projectzero": "2.0.0-beta.1",
65
65
  "@semantic-release/changelog": "6.0.2",
66
66
  "@semantic-release/exec": "6.0.3",
67
67
  "@semantic-release/git": "10.0.1",
@@ -72,23 +72,23 @@
72
72
  "@testing-library/user-event": "14.1.1",
73
73
  "@types/googlemaps": "3.43.3",
74
74
  "@types/jest": "27.4.1",
75
- "@types/react": "18.2.27",
76
- "@types/react-dom": "18.2.12",
77
- "@typescript-eslint/eslint-plugin": "6.7.4",
78
- "@typescript-eslint/parser": "6.7.4",
79
- "autoprefixer": "10.4.20",
75
+ "@types/react": "19.0.2",
76
+ "@types/react-dom": "19.0.2",
77
+ "@typescript-eslint/eslint-plugin": "8.18.2",
78
+ "@typescript-eslint/parser": "8.18.2",
79
+ "autoprefixer": "10.4.13",
80
80
  "client-only": "0.0.1",
81
81
  "clsx": "1.1.1",
82
82
  "currency-symbol-map": "5.1.0",
83
- "eslint": "8.14.0",
84
- "eslint-config-next": "14.2.3",
85
- "eslint-config-prettier": "8.5.0",
83
+ "eslint": "9.17.0",
84
+ "eslint-config-next": "15.1.2",
85
+ "eslint-config-prettier": "9.1.0",
86
86
  "husky": "8.0.0",
87
87
  "jest": "29.7.0",
88
88
  "jest-css-modules-transform": "4.3.0",
89
89
  "lint-staged": "13.1.0",
90
- "prettier": "2.6.2",
91
- "react-number-format": "5.3.4",
90
+ "prettier": "3.4.2",
91
+ "react-number-format": "5.4.2",
92
92
  "sass": "1.49.9",
93
93
  "semantic-release": "19.0.5",
94
94
  "server-only": "0.0.1",
@@ -100,10 +100,10 @@
100
100
  "tailwindcss": "3.4.14",
101
101
  "ts-jest": "29.1.1",
102
102
  "ts-node": "10.7.0",
103
- "typescript": "5.2.2"
103
+ "typescript": "5.7.2"
104
104
  },
105
105
  "resolutions": {
106
106
  "**/postcss": "8.4.31"
107
107
  },
108
- "packageManager": "yarn@1.22.17"
108
+ "packageManager": "yarn@1.22.22"
109
109
  }
@@ -0,0 +1,3 @@
1
+ import { initSentry } from '@akinon/next/sentry';
2
+
3
+ initSentry('Edge');
@@ -0,0 +1,3 @@
1
+ import { initSentry } from '@akinon/next/sentry';
2
+
3
+ initSentry('Server');
@@ -56,7 +56,8 @@ const resolvePrettyUrlHandler =
56
56
  return prettyUrlResult;
57
57
  };
58
58
 
59
- export async function generateMetadata({ params }: PageProps) {
59
+ export async function generateMetadata(props: PageProps) {
60
+ const params = await props.params;
60
61
  let result: Metadata = {};
61
62
  const { prettyurl } = params;
62
63
  const pageSlug = prettyurl
@@ -81,7 +82,7 @@ export async function generateMetadata({ params }: PageProps) {
81
82
  ...params,
82
83
  pk: prettyUrlResult.pk
83
84
  },
84
- searchParams
85
+ searchParams: Promise.resolve(searchParams)
85
86
  };
86
87
 
87
88
  try {
@@ -123,7 +124,8 @@ export async function generateMetadata({ params }: PageProps) {
123
124
  export const dynamic = 'force-static';
124
125
  export const revalidate = 300;
125
126
 
126
- export default async function Page({ params }) {
127
+ export default async function Page(props) {
128
+ const params = await props.params;
127
129
  const { prettyurl } = params;
128
130
  const pageSlug = prettyurl
129
131
  .filter((x) => !x.startsWith('searchparams'))
@@ -159,7 +161,7 @@ export default async function Page({ params }) {
159
161
  ...params,
160
162
  pk: result.pk
161
163
  },
162
- searchParams: urlSearchParams
164
+ searchParams: Promise.resolve(urlSearchParams)
163
165
  };
164
166
 
165
167
  if (result.path.startsWith('/category/')) {
@@ -8,7 +8,7 @@ import {
8
8
  useGetOrderQuery,
9
9
  useGetCancellationReasonsQuery
10
10
  } from '@akinon/next/data/client/account';
11
- import { AccountOrderCancellation } from '@akinon/next/types';
11
+ import type { AccountOrderCancellation } from '@akinon/next/types';
12
12
  import {
13
13
  Button,
14
14
  Checkbox,
@@ -17,7 +17,7 @@ import {
17
17
  LoaderSpinner,
18
18
  Link
19
19
  } from '@theme/components';
20
- import { useState } from 'react';
20
+ import { useState, use } from 'react';
21
21
  import { OrderDetailHeader } from '@theme/views/account/orders/order-detail-header';
22
22
  import { OrderCancellationItem } from '@theme/views/account/orders/order-cancellation-item';
23
23
  import { useLocalization } from '@akinon/next/hooks';
@@ -27,6 +27,8 @@ const accountOrderCancellationSchema = yup.object().shape({
27
27
  });
28
28
 
29
29
  const AccountOrderCancellation = ({ params }) => {
30
+ const pageParams = use(params) as { id: string };
31
+
30
32
  const { t } = useLocalization();
31
33
  const {
32
34
  register,
@@ -46,7 +48,7 @@ const AccountOrderCancellation = ({ params }) => {
46
48
  data: order,
47
49
  isLoading,
48
50
  isSuccess: orderSuccess
49
- } = useGetOrderQuery(params.id);
51
+ } = useGetOrderQuery(pageParams.id);
50
52
 
51
53
  const [isModalOpen, setIsModalOpen] = useState(false);
52
54
  const [responseMessage, setResponseMessage] = useState({
@@ -5,7 +5,7 @@ import { Image } from '@akinon/next/components/image';
5
5
  import clsx from 'clsx';
6
6
  import { SalesContractModal } from '@theme/views/sales-contract-modal';
7
7
  import { useGetOrderQuery } from '@akinon/next/data/client/account';
8
- import { useEffect, useState } from 'react';
8
+ import { useEffect, useState, use } from 'react';
9
9
 
10
10
  import { OrderDetailHeader } from '@theme/views/account/orders/order-detail-header';
11
11
  import { ROUTES } from '@theme/routes';
@@ -13,7 +13,9 @@ import { useLocalization } from '@akinon/next/hooks';
13
13
  import settings from 'settings';
14
14
  import { getOrderStatus } from 'utils';
15
15
 
16
- const AccountOrderDetail = ({ params: { id } }) => {
16
+ const AccountOrderDetail = ({ params }) => {
17
+ const pageParams = use(params) as { id: string };
18
+
17
19
  const { locale, t } = useLocalization();
18
20
 
19
21
  const localeValue = settings.localization.locales.find(
@@ -25,7 +27,7 @@ const AccountOrderDetail = ({ params: { id } }) => {
25
27
  isLoading,
26
28
  isSuccess,
27
29
  isFetching
28
- } = useGetOrderQuery(id);
30
+ } = useGetOrderQuery(pageParams.id);
29
31
  const [orderDate, setOrderDate] = useState('');
30
32
 
31
33
  const groupedOrder = [];
@@ -252,7 +252,7 @@ export default function Page() {
252
252
  <Input
253
253
  label={t('account.my_profile.form.phone.placeholder')}
254
254
  type="tel"
255
- format={user_phone_format.replace(/\9/g, '#')}
255
+ format={user_phone_format.replace(/9/g, '#')}
256
256
  mask="_"
257
257
  allowEmptyFormatting={true}
258
258
  control={control}
@@ -1,14 +1,87 @@
1
- import { BasketContent } from '@theme/views/basket/basket-content';
2
- import { getBasketData } from '@akinon/next/data/server/basket';
1
+ 'use client';
2
+
3
+ import { useEffect } from 'react';
4
+ import { ROUTES } from '@theme/routes';
5
+ import { useGetBasketQuery } from '@akinon/next/data/client/basket';
6
+ import { pushCartView } from '@theme/utils/gtm';
7
+ import { Button, LoaderSpinner, Link } from '@theme/components';
8
+ import { BasketItem, Summary } from '@theme/views/basket';
9
+ import { useLocalization } from '@akinon/next/hooks';
10
+ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
3
11
  import settings from '@theme/settings';
4
12
 
5
- export default async function Page() {
6
- const { basket } = await getBasketData();
13
+ export default function Page() {
14
+ const { data: basket, isLoading, isSuccess } = useGetBasketQuery();
15
+ const { t } = useLocalization();
16
+ const multiBasket = settings.plugins?.multiBasket ?? false;
17
+
18
+ useEffect(() => {
19
+ if (isSuccess) {
20
+ const products = basket.basketitem_set.map((basketItem) => ({
21
+ ...basketItem.product
22
+ }));
23
+ pushCartView(products);
24
+ }
25
+ }, [basket, isSuccess]);
26
+
27
+ return (
28
+ <div className="max-w-screen-xl p-4 flex flex-col text-primary-800 lg:p-8 xl:flex-row xl:mx-auto">
29
+ {isLoading && (
30
+ <div className="flex justify-center w-full">
31
+ <LoaderSpinner />
32
+ </div>
33
+ )}
34
+ {isSuccess &&
35
+ (basket && basket.basketitem_set && basket.basketitem_set.length > 0 ? (
36
+ <>
37
+ <div className="flex-1 xl:mr-16">
38
+ <div className="flex items-center justify-between py-2 border-b border-gray-200 lg:py-3">
39
+ <h2 className="text-xl lg:text-2xl font-light">
40
+ {t('basket.my_cart')}
41
+ </h2>
42
+ <Link
43
+ href={ROUTES.HOME}
44
+ className="text-xs hover:text-secondary-500"
45
+ >
46
+ {t('basket.back_to_shopping')}
47
+ </Link>
48
+ </div>
49
+ <ul>
50
+ {multiBasket ? (
51
+ <PluginModule
52
+ component={Component.MultiBasket}
53
+ props={{ BasketItem }}
54
+ />
55
+ ) : (
56
+ basket.basketitem_set.map((basketItem, index) => (
57
+ <BasketItem basketItem={basketItem} key={index} />
58
+ ))
59
+ )}
60
+ </ul>
61
+ </div>
62
+ <Summary basket={basket} />
63
+ </>
64
+ ) : (
65
+ <div className="flex flex-col items-center container max-w-screen-sm py-4 px-4 xs:py-6 xs:px-6 sm:py-8 sm:px-8 lg:max-w-screen-xl">
66
+ <h1
67
+ className="w-full text-xl font-light text-secondary text-center sm:text-2xl"
68
+ data-testid="basket-empty"
69
+ >
70
+ {t('basket.empty.title')}
71
+ </h1>
7
72
 
8
- const multiBasket: boolean =
9
- typeof settings.plugins?.multiBasket === 'boolean'
10
- ? settings.plugins.multiBasket
11
- : false;
73
+ <div className="w-full text-sm text-black-800 text-center my-4 mb-2 sm:text-base">
74
+ <p>{t('basket.empty.content_first')}</p>
75
+ <p>{t('basket.empty.content_second')}.</p>
76
+ </div>
12
77
 
13
- return <BasketContent initialBasket={basket} multiBasket={multiBasket} />;
78
+ <Link href={ROUTES.HOME} passHref>
79
+ <Button className="px-10 mt-2" appearance="filled">
80
+ {t('basket.empty.button')}
81
+ </Button>
82
+ </Link>
83
+ </div>
84
+ ))}
85
+ </div>
86
+ );
14
87
  }
@@ -3,7 +3,10 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
5
 
6
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
6
+ async function Page(props: PageProps<{ pk: number }>) {
7
+ const params = await props.params;
8
+ const searchParams = await props.searchParams;
9
+
7
10
  const { data, breadcrumbData } = await getCategoryData({
8
11
  pk: params.pk,
9
12
  searchParams
@@ -2,7 +2,9 @@ import { getFlatPageData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
 
5
- async function Page({ params }: PageProps<{ pk: number }>) {
5
+ async function Page(props: PageProps<{ pk: number }>) {
6
+ const params = await props.params;
7
+
6
8
  const data = await getFlatPageData({ pk: params.pk });
7
9
 
8
10
  return (
@@ -2,7 +2,9 @@ import { getFormData } from '@akinon/next/data/server';
2
2
  import { t } from '@akinon/next/utils/server-translation';
3
3
  import { GenerateFormFields } from '@theme/components/generate-form-fields';
4
4
 
5
- export default async function Page({ params }) {
5
+ export default async function Page(props) {
6
+ const params = await props.params;
7
+
6
8
  const data = await getFormData({ pk: params.pk });
7
9
  const { schema, is_active, name, pk } = data;
8
10
 
@@ -39,7 +41,7 @@ export default async function Page({ params }) {
39
41
  formProperties={{
40
42
  actionUrl: `/api/form/${pk}/`,
41
43
  className:
42
- 'w-[calc(100%-36px)] md:w-[570px] px-[18px] py-[60px] md:p-[100px] border border-[#cbc8c8] border-t-[3px] border-t-[#e95151] mx-auto -mt-[100px] bg-white mb-14',
44
+ 'w-[calc(100%-36px)] md:w-[570px] px-[18px] py-[60px] md:p-[100px] border border-[#cbc8c8] border-t-[3px] border-t-[#e95151] mx-auto -mt-[100px] bg-white mb-14'
43
45
  }}
44
46
  submitButtonText={t('form.form_page.submit_button_text')}
45
47
  />
@@ -5,11 +5,10 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
5
5
  import { PageProps, Metadata } from '@akinon/next/types';
6
6
  import { generateJsonLd } from '@theme/utils/generate-jsonld';
7
7
 
8
- export async function generateMetadata({
9
- params,
10
- searchParams
11
- }: PageProps<{ pk: number }>) {
8
+ export async function generateMetadata(props: PageProps): Promise<Metadata> {
12
9
  let result: Metadata = {};
10
+ const searchParams = await props.searchParams;
11
+ const params = await props.params;
13
12
 
14
13
  try {
15
14
  const {
@@ -41,7 +40,10 @@ export async function generateMetadata({
41
40
  return result;
42
41
  }
43
42
 
44
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
43
+ async function Page(props: PageProps<{ pk: number }>) {
44
+ const params = await props.params;
45
+ const searchParams = await props.searchParams;
46
+
45
47
  const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
46
48
  getProductData({
47
49
  pk: params.pk,
@@ -2,7 +2,9 @@ import { getLandingPageData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
 
5
- async function Page({ params }: PageProps<{ pk: number }>) {
5
+ async function Page(props: PageProps<{ pk: number }>) {
6
+ const params = await props.params;
7
+
6
8
  const data = await getLandingPageData({ pk: params.pk });
7
9
 
8
10
  const content = data.landing_page;
@@ -48,11 +48,13 @@ async function RootLayout({
48
48
  translations,
49
49
  children
50
50
  }: RootLayoutProps) {
51
+ const layoutParams = await params;
52
+
51
53
  return (
52
54
  <html lang={locale.isoCode} {...(locale.rtl ? { dir: 'rtl' } : {})}>
53
55
  <head />
54
56
  <body className="overflow-x-hidden">
55
- <PzRoot translations={translations} {...params}>
57
+ <PzRoot translations={translations} {...layoutParams}>
56
58
  <ClientRoot>
57
59
  <div className="overflow-x-hidden">
58
60
  <MobileAppToggler>
@@ -3,7 +3,9 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
5
 
6
- async function Page({ searchParams }: PageProps) {
6
+ async function Page(props: PageProps) {
7
+ const searchParams = await props.searchParams;
8
+
7
9
  const data = await getListData({ searchParams });
8
10
 
9
11
  return (
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { useEffect, useRef } from 'react';
3
+ import { useEffect, useRef, use } from 'react';
4
4
  import { useAppDispatch } from '@akinon/next/redux/hooks';
5
5
  import { setCurrentStep } from '@akinon/next/redux/reducers/checkout';
6
6
  import { ROUTES } from '@theme/routes';
@@ -14,14 +14,10 @@ import { Image } from '@akinon/next/components/image';
14
14
  import { Trans } from '@akinon/next/components/trans';
15
15
  import { pushPurchaseEvent } from '@theme/utils/gtm';
16
16
 
17
- const CheckoutCompleted = ({
18
- params
19
- }: PageProps<{
20
- token: string;
21
- }>) => {
17
+ const CheckoutCompleted = (props) => {
22
18
  const { t } = useLocalization();
23
19
  const dispatch = useAppDispatch();
24
-
20
+ const params = use(props.params) as { token: string };
25
21
  const { data, isLoading } = useFetchCheckoutResultQuery(String(params.token));
26
22
 
27
23
  const carouselRef = useRef(null);
@@ -5,12 +5,12 @@ import { generateJsonLd } from '@theme/utils/generate-jsonld';
5
5
  import { AccordionWrapper, ProductInfo } from '@theme/views/product';
6
6
  import ProductLayout from '@theme/views/product/layout';
7
7
 
8
- export async function generateMetadata({
9
- params,
10
- searchParams
11
- }: PageProps<{ pk: number }>) {
8
+ export async function generateMetadata(props: PageProps): Promise<Metadata> {
12
9
  let result: Metadata = {};
13
10
 
11
+ const params = await props.params;
12
+ const searchParams = await props.searchParams;
13
+
14
14
  try {
15
15
  const {
16
16
  data: { product }
@@ -40,7 +40,10 @@ export async function generateMetadata({
40
40
  return result;
41
41
  }
42
42
 
43
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
43
+ async function Page(props: PageProps<{ pk: number }>) {
44
+ const params = await props.params;
45
+ const searchParams = await props.searchParams;
46
+
44
47
  const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
45
48
  getProductData({
46
49
  pk: params.pk,
@@ -5,7 +5,9 @@ import CategoryLayout from '@theme/views/category/layout';
5
5
  import SpecialPageBanner from '@theme/widgets/special-page-banner';
6
6
  import SpecialPageCarousel from '@theme/widgets/special-page-carousel';
7
7
 
8
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
8
+ async function Page(props: PageProps<{ pk: number }>) {
9
+ const params = await props.params;
10
+ const searchParams = await props.searchParams;
9
11
  const data = await getSpecialPageData({ pk: params.pk, searchParams });
10
12
 
11
13
  return (
@@ -2,8 +2,11 @@
2
2
  import { Icon, Link, LoaderSpinner } from '@theme/components';
3
3
  import { useLocalization } from '@akinon/next/hooks';
4
4
  import { useChangeEmailVerificationQuery } from '@akinon/next/data/client/user';
5
+ import { use } from 'react';
6
+
7
+ export default function Page(props) {
8
+ const { id } = use(props.params) as { id: string[] };
5
9
 
6
- export default function Page({ params: { id } }) {
7
10
  const { t } = useLocalization();
8
11
  const { isSuccess, isLoading } = useChangeEmailVerificationQuery(
9
12
  id.join('/')
@@ -2,8 +2,10 @@
2
2
  import { Icon, Link, LoaderSpinner } from '@theme/components';
3
3
  import { useLocalization } from '@akinon/next/hooks';
4
4
  import { useConfirmEmailVerificationQuery } from '@akinon/next/data/client/user';
5
+ import { use } from 'react';
5
6
 
6
- export default function Page({ params: { id } }) {
7
+ export default function Page(props) {
8
+ const { id } = use(props.params) as { id: string[] };
7
9
  const { t } = useLocalization();
8
10
  const { isSuccess, isLoading } = useConfirmEmailVerificationQuery(
9
11
  id.join('/')
@@ -10,8 +10,10 @@ import {
10
10
  } from '@akinon/next/data/client/account';
11
11
  import { useLocalization } from '@akinon/next/hooks';
12
12
  import PasswordRulesFeedback from '@theme/components/password-rules-feedback';
13
+ import { use } from 'react';
13
14
 
14
- export default function NewPassword({ params: { id } }) {
15
+ export default function NewPassword(props) {
16
+ const { id } = use(props.params) as { id: string };
15
17
  const { t } = useLocalization();
16
18
  const [newPassword, { isSuccess: formSuccess }] = usePasswordResetMutation();
17
19
 
@@ -24,7 +26,10 @@ export default function NewPassword({ params: { id } }) {
24
26
  /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{6,}$/,
25
27
  t('forgot_password.create_new_password.form.error.password_rule')
26
28
  )
27
- .max(50, t('forgot_password.create_new_password.form.error.password_max')),
29
+ .max(
30
+ 50,
31
+ t('forgot_password.create_new_password.form.error.password_max')
32
+ ),
28
33
  repeatPassword: yup
29
34
  .string()
30
35
  .required(t('forgot_password.create_new_password.form.error.required'))
@@ -79,7 +84,10 @@ export default function NewPassword({ params: { id } }) {
79
84
  required
80
85
  />
81
86
 
82
- <PasswordRulesFeedback password={passwordValue} isVisible={errors?.password ? true : false}/>
87
+ <PasswordRulesFeedback
88
+ password={passwordValue}
89
+ isVisible={errors?.password ? true : false}
90
+ />
83
91
  </div>
84
92
 
85
93
  <div className="mb-2 text-left">
@@ -3,7 +3,7 @@ import { urlLocaleMatcherRegex } from '@akinon/next/utils';
3
3
  export const dynamic = 'force-dynamic';
4
4
 
5
5
  export async function GET(request: Request, context: { params }) {
6
- const node = context.params.node;
6
+ const node = (await context.params).node;
7
7
  const url = new URL(request.url);
8
8
  const matchedLocale = url.pathname.match(urlLocaleMatcherRegex);
9
9
 
@@ -2,7 +2,6 @@ import { Metadata } from '@akinon/next/types';
2
2
 
3
3
  const pwaTags: Metadata = {
4
4
  manifest: '/manifest.json',
5
- themeColor: '#FFFFFF',
6
5
  formatDetection: {
7
6
  telephone: false
8
7
  },
@@ -1,10 +1,6 @@
1
1
  const { LocaleUrlStrategy } = require('@akinon/next/localization');
2
2
  const { ROUTES } = require('@theme/routes');
3
3
 
4
- /* IMPORTANT *
5
- * In order to use one locale in the locales array and hide the default locale in the URL, you need to set the localeUrlStrategy to LocaleUrlStrategy.ShowAllLocales.
6
- */
7
-
8
4
  const commerceUrl = encodeURI(process.env.SERVICE_BACKEND_URL ?? 'default');
9
5
 
10
6
  /** @type {import('@akinon/next/types').Settings} */
@@ -18,7 +14,6 @@ module.exports = {
18
14
  { translationKey: 'size', key: 'size' }
19
15
  ],
20
16
  localization: {
21
- // If there is one locale in the locales array, the default locale will be hidden in the URL.
22
17
  locales: [
23
18
  {
24
19
  label: 'EN',
@@ -46,7 +41,7 @@ module.exports = {
46
41
  }
47
42
  ],
48
43
  defaultLocaleValue: 'en',
49
- localeUrlStrategy: LocaleUrlStrategy.HideDefaultLocale, // If there is one locale in the locales array, the default locale will be hidden in the URL and localeUrlStrategy should be set to LocaleUrlStrategy.ShowAllLocales.
44
+ localeUrlStrategy: LocaleUrlStrategy.HideDefaultLocale,
50
45
  redirectToDefaultLocale: true,
51
46
  defaultCurrencyCode: 'usd'
52
47
  },