@akinon/projectzero 1.32.0-rc.2 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -8
- package/commands/create.ts +118 -49
- package/dist/commands/create.js +68 -32
- package/package.json +1 -1
- package/tsconfig.json +8 -9
- package/app-template/.editorconfig +0 -7
- package/app-template/.env.example +0 -9
- package/app-template/.eslintignore +0 -1
- package/app-template/.eslintrc.js +0 -31
- package/app-template/.gitattributes +0 -18
- package/app-template/.husky/pre-commit +0 -4
- package/app-template/.lintstagedrc.js +0 -12
- package/app-template/.prettierrc +0 -13
- package/app-template/.releaserc.json +0 -49
- package/app-template/.stylelintrc.json +0 -37
- package/app-template/.vscode/extensions.json +0 -11
- package/app-template/.vscode/launch.json +0 -29
- package/app-template/.yarnrc +0 -1
- package/app-template/CHANGELOG.md +0 -655
- package/app-template/LICENSE +0 -21
- package/app-template/Procfile +0 -1
- package/app-template/README.md +0 -29
- package/app-template/akinon.json +0 -28
- package/app-template/bitbucket-pipelines.yml +0 -54
- package/app-template/build.sh +0 -7
- package/app-template/docs/CHANGELOG.md +0 -85
- package/app-template/docs/advanced-usage.md +0 -43
- package/app-template/docs/basic-setup.md +0 -59
- package/app-template/docs/data-fetching/client/account.md +0 -1064
- package/app-template/docs/data-fetching/client/address.md +0 -805
- package/app-template/docs/data-fetching/client/basket.md +0 -107
- package/app-template/docs/data-fetching/client/checkout.md +0 -904
- package/app-template/docs/data-fetching/client/misc.md +0 -135
- package/app-template/docs/data-fetching/client/product.md +0 -284
- package/app-template/docs/data-fetching/client/user.md +0 -56
- package/app-template/docs/data-fetching/client/wishlist.md +0 -111
- package/app-template/docs/data-fetching/server/category.md +0 -324
- package/app-template/docs/data-fetching/server/flat-page.md +0 -42
- package/app-template/docs/data-fetching/server/list.md +0 -353
- package/app-template/docs/data-fetching/server/menu.md +0 -363
- package/app-template/docs/data-fetching/server/product.md +0 -131
- package/app-template/docs/data-fetching/server/seo.md +0 -44
- package/app-template/docs/data-fetching/server/special-page.md +0 -79
- package/app-template/docs/data-fetching/server/widget.md +0 -218
- package/app-template/docs/delete-account.md +0 -25
- package/app-template/docs/deployment.md +0 -46
- package/app-template/docs/dynamic-route.md +0 -33
- package/app-template/docs/icons.md +0 -52
- package/app-template/docs/localization.md +0 -204
- package/app-template/docs/logging.md +0 -48
- package/app-template/docs/plugins.md +0 -76
- package/app-template/docs/seo-management.md +0 -125
- package/app-template/docs/static-assets.md +0 -36
- package/app-template/docs/widgets.md +0 -127
- package/app-template/global.d.ts +0 -1
- package/app-template/jest.config.ts +0 -34
- package/app-template/next-env.d.ts +0 -6
- package/app-template/next.config.mjs +0 -34
- package/app-template/package.json +0 -97
- package/app-template/plugins.d.ts +0 -1
- package/app-template/postcss.config.js +0 -6
- package/app-template/public/404.png +0 -0
- package/app-template/public/500.png +0 -0
- package/app-template/public/apple-splash-1125-2436.jpg +0 -0
- package/app-template/public/apple-splash-1136-640.jpg +0 -0
- package/app-template/public/apple-splash-1170-2532.jpg +0 -0
- package/app-template/public/apple-splash-1242-2208.jpg +0 -0
- package/app-template/public/apple-splash-1242-2688.jpg +0 -0
- package/app-template/public/apple-splash-1284-2778.jpg +0 -0
- package/app-template/public/apple-splash-1334-750.jpg +0 -0
- package/app-template/public/apple-splash-1536-2048.jpg +0 -0
- package/app-template/public/apple-splash-1620-2160.jpg +0 -0
- package/app-template/public/apple-splash-1668-2224.jpg +0 -0
- package/app-template/public/apple-splash-1668-2388.jpg +0 -0
- package/app-template/public/apple-splash-1792-828.jpg +0 -0
- package/app-template/public/apple-splash-2048-1536.jpg +0 -0
- package/app-template/public/apple-splash-2048-2732.jpg +0 -0
- package/app-template/public/apple-splash-2160-1620.jpg +0 -0
- package/app-template/public/apple-splash-2208-1242.jpg +0 -0
- package/app-template/public/apple-splash-2224-1668.jpg +0 -0
- package/app-template/public/apple-splash-2388-1668.jpg +0 -0
- package/app-template/public/apple-splash-2436-1125.jpg +0 -0
- package/app-template/public/apple-splash-2532-1170.jpg +0 -0
- package/app-template/public/apple-splash-2688-1242.jpg +0 -0
- package/app-template/public/apple-splash-2732-2048.jpg +0 -0
- package/app-template/public/apple-splash-2778-1284.jpg +0 -0
- package/app-template/public/apple-splash-640-1136.jpg +0 -0
- package/app-template/public/apple-splash-750-1334.jpg +0 -0
- package/app-template/public/apple-splash-828-1792.jpg +0 -0
- package/app-template/public/apple-touch-icon-152x152.png +0 -0
- package/app-template/public/apple-touch-icon-167x167.png +0 -0
- package/app-template/public/apple-touch-icon-180x180.png +0 -0
- package/app-template/public/apple-touch-icon.png +0 -0
- package/app-template/public/apple.svg +0 -47
- package/app-template/public/cvv.jpg +0 -0
- package/app-template/public/facebook.svg +0 -3
- package/app-template/public/google.svg +0 -12
- package/app-template/public/icon-192x192.png +0 -0
- package/app-template/public/icon-256x256.png +0 -0
- package/app-template/public/icon-384x384.png +0 -0
- package/app-template/public/icon-512x512.png +0 -0
- package/app-template/public/icon-sprite.svg +0 -528
- package/app-template/public/locales/en/account.json +0 -487
- package/app-template/public/locales/en/auth.json +0 -100
- package/app-template/public/locales/en/basket.json +0 -50
- package/app-template/public/locales/en/category.json +0 -26
- package/app-template/public/locales/en/checkout.json +0 -152
- package/app-template/public/locales/en/common.json +0 -65
- package/app-template/public/locales/en/forgot_password.json +0 -41
- package/app-template/public/locales/en/form.json +0 -5
- package/app-template/public/locales/en/not_found.json +0 -5
- package/app-template/public/locales/en/product.json +0 -39
- package/app-template/public/locales/tr/account.json +0 -487
- package/app-template/public/locales/tr/auth.json +0 -100
- package/app-template/public/locales/tr/basket.json +0 -50
- package/app-template/public/locales/tr/category.json +0 -26
- package/app-template/public/locales/tr/checkout.json +0 -152
- package/app-template/public/locales/tr/common.json +0 -65
- package/app-template/public/locales/tr/forgot_password.json +0 -41
- package/app-template/public/locales/tr/form.json +0 -5
- package/app-template/public/locales/tr/not_found.json +0 -5
- package/app-template/public/locales/tr/product.json +0 -39
- package/app-template/public/logo.svg +0 -29
- package/app-template/public/manifest.json +0 -35
- package/app-template/public/mastercard.png +0 -0
- package/app-template/public/mastersecure.png +0 -0
- package/app-template/public/mfs-client.min.js +0 -3
- package/app-template/public/noimage.jpg +0 -0
- package/app-template/public/safari-pinned-tab.svg +0 -320
- package/app-template/public/ssl-secure.png +0 -0
- package/app-template/public/vbv.png +0 -0
- package/app-template/public/visa.png +0 -0
- package/app-template/public/zepto.min.js +0 -2
- package/app-template/sentry.client.config.ts +0 -16
- package/app-template/sentry.edge.config.ts +0 -3
- package/app-template/sentry.properties +0 -4
- package/app-template/sentry.server.config.ts +0 -3
- package/app-template/setupTests.ts +0 -4
- package/app-template/src/__tests__/index.test.tsx +0 -7
- package/app-template/src/__tests__/tsconfig.json +0 -7
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/address/page.tsx +0 -74
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-email/page.tsx +0 -174
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-password/page.tsx +0 -206
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/contact/page.tsx +0 -7
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/coupons/page.tsx +0 -210
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/email-verification/page.tsx +0 -5
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/faq/page.tsx +0 -23
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/favourite-products/page.tsx +0 -32
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/layout.tsx +0 -28
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/my-quotations/page.tsx +0 -7
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +0 -255
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/layout.tsx +0 -5
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +0 -309
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/page.tsx +0 -137
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/page.tsx +0 -226
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +0 -400
- package/app-template/src/app/[commerce]/[locale]/[currency]/address/stores/page.tsx +0 -271
- package/app-template/src/app/[commerce]/[locale]/[currency]/anonymous-tracking/page.tsx +0 -33
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/oauth-login/page.tsx +0 -3
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/page.tsx +0 -76
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +0 -77
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket-b2b/page.tsx +0 -7
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/loading.tsx +0 -53
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +0 -16
- package/app-template/src/app/[commerce]/[locale]/[currency]/client-root.tsx +0 -9
- package/app-template/src/app/[commerce]/[locale]/[currency]/contact-us/page.tsx +0 -11
- package/app-template/src/app/[commerce]/[locale]/[currency]/error.tsx +0 -20
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/loading.tsx +0 -5
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +0 -18
- package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +0 -48
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/loading.tsx +0 -5
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +0 -72
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/loading.tsx +0 -5
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +0 -23
- package/app-template/src/app/[commerce]/[locale]/[currency]/layout.tsx +0 -78
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/loading.tsx +0 -53
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/page.tsx +0 -16
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/checkout/page.tsx +0 -140
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/layout.tsx +0 -5
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +0 -284
- package/app-template/src/app/[commerce]/[locale]/[currency]/page.tsx +0 -50
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +0 -67
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +0 -81
- package/app-template/src/app/[commerce]/[locale]/[currency]/pz-not-found/page.tsx +0 -24
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/loading.tsx +0 -53
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +0 -25
- package/app-template/src/app/[commerce]/[locale]/[currency]/template.tsx +0 -75
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/email-set-primary/[[...id]]/page.tsx +0 -43
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/password/reset/page.tsx +0 -79
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/registration/account-confirm-email/[[...id]]/page.tsx +0 -43
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/reset/[[...id]]/page.tsx +0 -110
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +0 -25
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/route.ts +0 -37
- package/app-template/src/app/api/cache/route.ts +0 -1
- package/app-template/src/app/api/client/[...slug]/route.ts +0 -1
- package/app-template/src/app/api/form/[...id]/route.ts +0 -7
- package/app-template/src/app/api/logout/route.ts +0 -1
- package/app-template/src/app/api/sentry/route.ts +0 -9
- package/app-template/src/app/api/web-vitals/route.ts +0 -1
- package/app-template/src/app/favicon.ico +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/index.scss +0 -269
- package/app-template/src/assets/fonts/index.scss +0 -1
- package/app-template/src/assets/fonts/pz-icon.css +0 -154
- package/app-template/src/assets/fonts/pz-icon.eot +0 -0
- package/app-template/src/assets/fonts/pz-icon.html +0 -456
- package/app-template/src/assets/fonts/pz-icon.scss +0 -300
- package/app-template/src/assets/fonts/pz-icon.svg +0 -144
- package/app-template/src/assets/fonts/pz-icon.ttf +0 -0
- package/app-template/src/assets/fonts/pz-icon.woff +0 -0
- package/app-template/src/assets/fonts/pz-icon.woff2 +0 -0
- package/app-template/src/assets/globals.scss +0 -65
- package/app-template/src/assets/icons/akinon.svg +0 -11
- package/app-template/src/assets/icons/arrow-up.svg +0 -11
- package/app-template/src/assets/icons/bell.svg +0 -1
- package/app-template/src/assets/icons/cart.svg +0 -13
- package/app-template/src/assets/icons/check.svg +0 -19
- package/app-template/src/assets/icons/chevron-down.svg +0 -8
- package/app-template/src/assets/icons/chevron-end.svg +0 -8
- package/app-template/src/assets/icons/chevron-start.svg +0 -8
- package/app-template/src/assets/icons/chevron-up.svg +0 -8
- package/app-template/src/assets/icons/close.svg +0 -12
- package/app-template/src/assets/icons/cvc.svg +0 -54
- package/app-template/src/assets/icons/default.svg +0 -6
- package/app-template/src/assets/icons/directions.svg +0 -14
- package/app-template/src/assets/icons/eye-off.svg +0 -10
- package/app-template/src/assets/icons/eye-on.svg +0 -17
- package/app-template/src/assets/icons/facebook-login.svg +0 -11
- package/app-template/src/assets/icons/facebook.svg +0 -9
- package/app-template/src/assets/icons/giftbox.svg +0 -22
- package/app-template/src/assets/icons/globe.svg +0 -12
- package/app-template/src/assets/icons/google-login.svg +0 -19
- package/app-template/src/assets/icons/google.svg +0 -9
- package/app-template/src/assets/icons/hamburger.svg +0 -5
- package/app-template/src/assets/icons/heart-full.svg +0 -20
- package/app-template/src/assets/icons/heart-stroke.svg +0 -22
- package/app-template/src/assets/icons/info.svg +0 -1
- package/app-template/src/assets/icons/instagram.svg +0 -14
- package/app-template/src/assets/icons/layout-2.svg +0 -7
- package/app-template/src/assets/icons/layout-3.svg +0 -4
- package/app-template/src/assets/icons/logo.svg +0 -24
- package/app-template/src/assets/icons/mail.svg +0 -1
- package/app-template/src/assets/icons/minus.svg +0 -4
- package/app-template/src/assets/icons/money.svg +0 -4
- package/app-template/src/assets/icons/mp-otp.svg +0 -1
- package/app-template/src/assets/icons/pin.svg +0 -16
- package/app-template/src/assets/icons/pinterest.svg +0 -12
- package/app-template/src/assets/icons/plus.svg +0 -5
- package/app-template/src/assets/icons/search.svg +0 -13
- package/app-template/src/assets/icons/share.svg +0 -10
- package/app-template/src/assets/icons/spinner.svg +0 -6
- package/app-template/src/assets/icons/store-pin.svg +0 -14
- package/app-template/src/assets/icons/track-order.svg +0 -1
- package/app-template/src/assets/icons/twitter.svg +0 -11
- package/app-template/src/assets/icons/user.svg +0 -14
- package/app-template/src/assets/icons/whatsapp.svg +0 -45
- package/app-template/src/components/__tests__/Modal.test.tsx +0 -103
- package/app-template/src/components/__tests__/accordion.test.tsx +0 -65
- package/app-template/src/components/__tests__/badge.test.tsx +0 -20
- package/app-template/src/components/__tests__/button.test.tsx +0 -59
- package/app-template/src/components/__tests__/checkbox.test.tsx +0 -57
- package/app-template/src/components/__tests__/file-input.test.tsx +0 -42
- package/app-template/src/components/__tests__/icon.test.tsx +0 -39
- package/app-template/src/components/__tests__/input.test.tsx +0 -69
- package/app-template/src/components/__tests__/language-select.test.tsx +0 -81
- package/app-template/src/components/__tests__/link.test.tsx +0 -65
- package/app-template/src/components/__tests__/price.test.tsx +0 -72
- package/app-template/src/components/__tests__/radio.test.tsx +0 -52
- package/app-template/src/components/__tests__/select.test.tsx +0 -115
- package/app-template/src/components/__tests__/tab.test.tsx +0 -101
- package/app-template/src/components/accordion.tsx +0 -64
- package/app-template/src/components/badge.tsx +0 -21
- package/app-template/src/components/button.tsx +0 -46
- package/app-template/src/components/canonical-url.tsx +0 -21
- package/app-template/src/components/carousel-core.tsx +0 -42
- package/app-template/src/components/checkbox.tsx +0 -29
- package/app-template/src/components/currency-select.tsx +0 -81
- package/app-template/src/components/custom-loader.tsx +0 -21
- package/app-template/src/components/dynamic-form.tsx +0 -17
- package/app-template/src/components/file-input.tsx +0 -8
- package/app-template/src/components/generate-form-fields.tsx +0 -349
- package/app-template/src/components/icon.tsx +0 -18
- package/app-template/src/components/index.ts +0 -41
- package/app-template/src/components/input.tsx +0 -122
- package/app-template/src/components/language-select.tsx +0 -33
- package/app-template/src/components/link.tsx +0 -53
- package/app-template/src/components/loader-spinner.tsx +0 -23
- package/app-template/src/components/modal.tsx +0 -66
- package/app-template/src/components/pagination.tsx +0 -267
- package/app-template/src/components/password-rules-feedback.tsx +0 -60
- package/app-template/src/components/price.tsx +0 -54
- package/app-template/src/components/pwa-tags.tsx +0 -233
- package/app-template/src/components/radio.tsx +0 -18
- package/app-template/src/components/react-portal.tsx +0 -47
- package/app-template/src/components/select.tsx +0 -70
- package/app-template/src/components/shimmer.tsx +0 -21
- package/app-template/src/components/skeleton-article.tsx +0 -15
- package/app-template/src/components/skeleton-product.tsx +0 -14
- package/app-template/src/components/skeleton-profile.tsx +0 -19
- package/app-template/src/components/skeleton-wrapper.tsx +0 -19
- package/app-template/src/components/skeleton.tsx +0 -37
- package/app-template/src/components/source.tsx +0 -12
- package/app-template/src/components/tab-panel.tsx +0 -10
- package/app-template/src/components/tab.tsx +0 -58
- package/app-template/src/components/tabs.tsx +0 -58
- package/app-template/src/components/types/index.ts +0 -89
- package/app-template/src/hooks/index.ts +0 -1
- package/app-template/src/hooks/use-add-product-to-basket.ts +0 -48
- package/app-template/src/hooks/use-contract.tsx +0 -58
- package/app-template/src/hooks/use-fav-button.tsx +0 -99
- package/app-template/src/instrumentation.ts +0 -1
- package/app-template/src/middleware.ts +0 -33
- package/app-template/src/pages/_error.js +0 -14
- package/app-template/src/pages/api/auth/[...nextauth].ts +0 -3
- package/app-template/src/plugins.js +0 -14
- package/app-template/src/redux/middlewares/category.ts +0 -42
- package/app-template/src/redux/reducers/category.ts +0 -67
- package/app-template/src/redux/store.ts +0 -47
- package/app-template/src/routes/index.ts +0 -46
- package/app-template/src/settings.js +0 -63
- package/app-template/src/theme.js +0 -1
- package/app-template/src/types/index.ts +0 -72
- package/app-template/src/types/next-auth.d.ts +0 -24
- package/app-template/src/types/widgets.ts +0 -115
- package/app-template/src/utils/convert-facet-search-params.ts +0 -15
- package/app-template/src/utils/generate-jsonld.ts +0 -23
- package/app-template/src/utils/gtm.ts +0 -247
- package/app-template/src/utils/index.ts +0 -60
- package/app-template/src/views/account/account-menu.tsx +0 -117
- package/app-template/src/views/account/address-card.tsx +0 -107
- package/app-template/src/views/account/address-form.tsx +0 -374
- package/app-template/src/views/account/back-button.tsx +0 -27
- package/app-template/src/views/account/contact-form.tsx +0 -283
- package/app-template/src/views/account/content-header.tsx +0 -52
- package/app-template/src/views/account/faq/faq-footer.tsx +0 -30
- package/app-template/src/views/account/faq/faq-search.tsx +0 -35
- package/app-template/src/views/account/faq/faq-tabs.tsx +0 -54
- package/app-template/src/views/account/faq/index.ts +0 -3
- package/app-template/src/views/account/favorite-item.tsx +0 -191
- package/app-template/src/views/account/favourite-products/favourite-products-list.tsx +0 -65
- package/app-template/src/views/account/index.ts +0 -4
- package/app-template/src/views/account/order.tsx +0 -89
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +0 -99
- package/app-template/src/views/account/orders/order-detail-header.tsx +0 -39
- package/app-template/src/views/anonymous-tracking/index.tsx +0 -109
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +0 -318
- package/app-template/src/views/basket/basket-item.tsx +0 -231
- package/app-template/src/views/basket/index.ts +0 -2
- package/app-template/src/views/basket/summary.tsx +0 -220
- package/app-template/src/views/breadcrumb.tsx +0 -35
- package/app-template/src/views/category/category-active-filters.tsx +0 -98
- package/app-template/src/views/category/category-banner.tsx +0 -34
- package/app-template/src/views/category/category-header.tsx +0 -143
- package/app-template/src/views/category/category-info.tsx +0 -123
- package/app-template/src/views/category/filters/index.tsx +0 -177
- package/app-template/src/views/category/filters/size-filter.tsx +0 -27
- package/app-template/src/views/category/layout.tsx +0 -38
- package/app-template/src/views/checkout/auth.tsx +0 -54
- package/app-template/src/views/checkout/index.tsx +0 -3
- package/app-template/src/views/checkout/layout/footer.tsx +0 -48
- package/app-template/src/views/checkout/layout/header.tsx +0 -38
- package/app-template/src/views/checkout/step-button.tsx +0 -69
- package/app-template/src/views/checkout/step-list.tsx +0 -51
- package/app-template/src/views/checkout/steps/payment/agreements.tsx +0 -42
- package/app-template/src/views/checkout/steps/payment/index.tsx +0 -31
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +0 -382
- package/app-template/src/views/checkout/steps/payment/options/credit-card/installments.tsx +0 -100
- package/app-template/src/views/checkout/steps/payment/options/credit-payment.tsx +0 -14
- package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +0 -174
- package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +0 -19
- package/app-template/src/views/checkout/steps/payment/options/pay-on-delivery.tsx +0 -15
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +0 -94
- package/app-template/src/views/checkout/steps/payment/payment-header.tsx +0 -17
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +0 -73
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +0 -204
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +0 -189
- package/app-template/src/views/checkout/steps/shipping/index.tsx +0 -27
- package/app-template/src/views/checkout/steps/shipping/shipping-options.tsx +0 -72
- package/app-template/src/views/checkout/summary.tsx +0 -181
- package/app-template/src/views/coupon-item/index.tsx +0 -80
- package/app-template/src/views/find-in-store/index.tsx +0 -183
- package/app-template/src/views/footer.tsx +0 -21
- package/app-template/src/views/guest-login/index.tsx +0 -130
- package/app-template/src/views/header/action-menu.tsx +0 -117
- package/app-template/src/views/header/band.tsx +0 -32
- package/app-template/src/views/header/index.tsx +0 -66
- package/app-template/src/views/header/mini-basket.tsx +0 -267
- package/app-template/src/views/header/mobile-hamburger-button.tsx +0 -35
- package/app-template/src/views/header/mobile-menu.tsx +0 -144
- package/app-template/src/views/header/navbar.tsx +0 -186
- package/app-template/src/views/header/pwa-back-button.tsx +0 -60
- package/app-template/src/views/header/search/index.tsx +0 -82
- package/app-template/src/views/header/search/results.tsx +0 -123
- package/app-template/src/views/header/user-menu.tsx +0 -72
- package/app-template/src/views/index.tsx +0 -2
- package/app-template/src/views/installment-options/index.tsx +0 -127
- package/app-template/src/views/login/index.tsx +0 -233
- package/app-template/src/views/otp-login/index.tsx +0 -152
- package/app-template/src/views/page-loader-spinner/index.tsx +0 -9
- package/app-template/src/views/product/accordion-wrapper.tsx +0 -59
- package/app-template/src/views/product/combine-product-card.tsx +0 -82
- package/app-template/src/views/product/index.ts +0 -8
- package/app-template/src/views/product/layout.tsx +0 -40
- package/app-template/src/views/product/misc-buttons.tsx +0 -65
- package/app-template/src/views/product/price-wrapper.tsx +0 -41
- package/app-template/src/views/product/product-group-info.tsx +0 -63
- package/app-template/src/views/product/product-info.tsx +0 -273
- package/app-template/src/views/product/slider.tsx +0 -124
- package/app-template/src/views/product/variant.tsx +0 -104
- package/app-template/src/views/product-item/index.tsx +0 -96
- package/app-template/src/views/product-pointer-banner-item.tsx +0 -243
- package/app-template/src/views/register/index.tsx +0 -417
- package/app-template/src/views/root-modal.tsx +0 -21
- package/app-template/src/views/sales-contract-modal/index.tsx +0 -288
- package/app-template/src/views/share/index.tsx +0 -71
- package/app-template/src/views/widgets/home-hero-slider-content.tsx +0 -54
- package/app-template/src/views/widgets/recommendation-content.tsx +0 -86
- package/app-template/src/widgets/footer-copyright.tsx +0 -25
- package/app-template/src/widgets/footer-info.tsx +0 -78
- package/app-template/src/widgets/footer-menu.tsx +0 -258
- package/app-template/src/widgets/footer-social.tsx +0 -53
- package/app-template/src/widgets/footer-subscription/footer-subscription-form.tsx +0 -110
- package/app-template/src/widgets/footer-subscription/index.tsx +0 -30
- package/app-template/src/widgets/header-band-text.tsx +0 -21
- package/app-template/src/widgets/home-discovery.tsx +0 -191
- package/app-template/src/widgets/home-hero-slider.tsx +0 -36
- package/app-template/src/widgets/home-product-recommendation.tsx +0 -18
- package/app-template/src/widgets/home-single-banner.tsx +0 -87
- package/app-template/src/widgets/home-stories-eng.tsx +0 -112
- package/app-template/src/widgets/index.ts +0 -25
- package/app-template/src/widgets/product-pointer-banners.tsx +0 -35
- package/app-template/src/widgets/special-page-banner.tsx +0 -49
- package/app-template/src/widgets/special-page-carousel.tsx +0 -68
- package/app-template/src/widgets/widget-order.tsx +0 -1
- package/app-template/tailwind.config.js +0 -170
- package/app-template/tsconfig.json +0 -44
- package/app-template/tsconfig.test.json +0 -6
- package/app-template/yarn.lock +0 -11278
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useSession } from 'next-auth/react';
|
|
4
|
-
import { useForm, SubmitHandler } from 'react-hook-form';
|
|
5
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
6
|
-
import * as yup from 'yup';
|
|
7
|
-
import clsx from 'clsx';
|
|
8
|
-
import { AccountChangeEmailFormType } from '@akinon/next/types';
|
|
9
|
-
|
|
10
|
-
import { Button, Input, Link } from '@theme/components';
|
|
11
|
-
import { ROUTES } from '@theme/routes';
|
|
12
|
-
import { useUpdateEmailMutation } from '@akinon/next/data/client/account';
|
|
13
|
-
import { useMemo, useState } from 'react';
|
|
14
|
-
import { useSearchParams, usePathname } from 'next/navigation';
|
|
15
|
-
import { useRouter, useLocalization } from '@akinon/next/hooks';
|
|
16
|
-
import { useGetProfileInfoQuery } from '@akinon/next/data/client/account';
|
|
17
|
-
import { Trans } from '@akinon/next/components/trans';
|
|
18
|
-
|
|
19
|
-
const accountChangeEmailSchema = (t) =>
|
|
20
|
-
yup.object().shape({
|
|
21
|
-
email: yup
|
|
22
|
-
.string()
|
|
23
|
-
.email(t('account.change_email.form.email.error'))
|
|
24
|
-
.required(t('account.change_email.form.required')),
|
|
25
|
-
emailConfirm: yup
|
|
26
|
-
.string()
|
|
27
|
-
.email(t('account.change_email.form.email.error'))
|
|
28
|
-
.oneOf(
|
|
29
|
-
[yup.ref('email')],
|
|
30
|
-
t('account.change_email.form.email_confirm.error.not_same')
|
|
31
|
-
)
|
|
32
|
-
.required(t('account.change_email.form.required')),
|
|
33
|
-
password: yup.string().required(t('account.change_email.form.required'))
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export default function Page() {
|
|
37
|
-
const { data } = useSession();
|
|
38
|
-
const { data: profileInfo } = useGetProfileInfoQuery();
|
|
39
|
-
|
|
40
|
-
const { t } = useLocalization();
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
register,
|
|
44
|
-
handleSubmit,
|
|
45
|
-
formState: { errors }
|
|
46
|
-
} = useForm<AccountChangeEmailFormType>({
|
|
47
|
-
resolver: yupResolver(accountChangeEmailSchema(t))
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const [formError, setFormError] = useState(null);
|
|
51
|
-
const [updateEmail] = useUpdateEmailMutation();
|
|
52
|
-
|
|
53
|
-
const router = useRouter();
|
|
54
|
-
const searchParams = useSearchParams();
|
|
55
|
-
const pathname = usePathname();
|
|
56
|
-
|
|
57
|
-
const onSubmit: SubmitHandler<AccountChangeEmailFormType> = async (data) => {
|
|
58
|
-
updateEmail(data)
|
|
59
|
-
.unwrap()
|
|
60
|
-
.then(() => {
|
|
61
|
-
router.push(pathname + '?formSuccess=true');
|
|
62
|
-
})
|
|
63
|
-
.catch((error) => setFormError(error.data));
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const LinkText = (props) => {
|
|
67
|
-
return (
|
|
68
|
-
<Link {...props} href={props.href || '#'} className="underline">
|
|
69
|
-
{props.title}
|
|
70
|
-
</Link>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const successParam = searchParams.get('formSuccess');
|
|
75
|
-
|
|
76
|
-
const isSuccess = useMemo(() => successParam === 'true', [successParam]);
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<div>
|
|
80
|
-
<div className="p-6 bg-gray-150">
|
|
81
|
-
<h3 className="text-3xl text-center mb-5">
|
|
82
|
-
{t('account.change_email.header.title')}
|
|
83
|
-
</h3>
|
|
84
|
-
<p className="text-center">
|
|
85
|
-
{' '}
|
|
86
|
-
{t('account.change_email.header.subtitle')}
|
|
87
|
-
</p>
|
|
88
|
-
</div>
|
|
89
|
-
<div className="flex flex-col lg:flex-row">
|
|
90
|
-
{isSuccess ? (
|
|
91
|
-
<div className="border border-gray-500 mt-5 p-6 lg:px-24 lg:py-10 lg:w-[670px]">
|
|
92
|
-
<h3 className="text-3xl mb-5">
|
|
93
|
-
{t('account.change_email.form.success.title')}
|
|
94
|
-
</h3>
|
|
95
|
-
<p className="text-sm mb-4">
|
|
96
|
-
{t('account.change_email.form.success.description')}
|
|
97
|
-
</p>
|
|
98
|
-
<Link href={'/'} className="underline">
|
|
99
|
-
{t('account.change_email.form.success.button')}
|
|
100
|
-
</Link>
|
|
101
|
-
</div>
|
|
102
|
-
) : (
|
|
103
|
-
<form
|
|
104
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
105
|
-
className="border border-gray-500 mt-5 p-6 lg:px-24 lg:py-10 lg:w-[670px]"
|
|
106
|
-
>
|
|
107
|
-
<div className="text-sm mb-10">
|
|
108
|
-
<p>{t('account.change_email.form.current_email')}</p>
|
|
109
|
-
<p>{profileInfo?.email}</p>
|
|
110
|
-
{formError && (
|
|
111
|
-
<div className="text-sm text-error">
|
|
112
|
-
{formError.non_field_errors}
|
|
113
|
-
</div>
|
|
114
|
-
)}
|
|
115
|
-
</div>
|
|
116
|
-
<div className={clsx(errors.email ? 'mb-8' : 'mb-5')}>
|
|
117
|
-
<Input
|
|
118
|
-
label={t('account.change_email.form.email.placeholder')}
|
|
119
|
-
{...register('email')}
|
|
120
|
-
error={errors.email}
|
|
121
|
-
required
|
|
122
|
-
/>
|
|
123
|
-
</div>
|
|
124
|
-
<div className={clsx(errors.emailConfirm ? 'mb-8' : 'mb-5')}>
|
|
125
|
-
<Input
|
|
126
|
-
label={t('account.change_email.form.email_confirm.placeholder')}
|
|
127
|
-
{...register('emailConfirm')}
|
|
128
|
-
error={errors.emailConfirm}
|
|
129
|
-
required
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
<div className={clsx(errors.password ? 'mb-8' : 'mb-5')}>
|
|
133
|
-
<Input
|
|
134
|
-
label={t('account.change_email.form.password.placeholder')}
|
|
135
|
-
type="password"
|
|
136
|
-
{...register('password')}
|
|
137
|
-
error={errors.password}
|
|
138
|
-
required
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
<Button type="submit" className="w-full font-medium">
|
|
143
|
-
{t('account.change_email.form.submit_button')}
|
|
144
|
-
</Button>
|
|
145
|
-
</form>
|
|
146
|
-
)}
|
|
147
|
-
<div className="my-6 lg:ml-8">
|
|
148
|
-
<h2 className="text-3xl mb-4">
|
|
149
|
-
{t('account.change_email.info.title')}
|
|
150
|
-
</h2>
|
|
151
|
-
<p className="text-sm font-medium">
|
|
152
|
-
<Trans
|
|
153
|
-
i18nKey="account.change_email.info.content"
|
|
154
|
-
components={{
|
|
155
|
-
ContactLink: (
|
|
156
|
-
<LinkText
|
|
157
|
-
href={ROUTES.ACCOUNT_CONTACT}
|
|
158
|
-
title={t('account.change_email.info.contact')}
|
|
159
|
-
/>
|
|
160
|
-
),
|
|
161
|
-
Faq: (
|
|
162
|
-
<LinkText
|
|
163
|
-
href={ROUTES.ACCOUNT_FAQ}
|
|
164
|
-
title={t('account.change_email.info.faq')}
|
|
165
|
-
/>
|
|
166
|
-
)
|
|
167
|
-
}}
|
|
168
|
-
/>
|
|
169
|
-
</p>
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
}
|
package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-password/page.tsx
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useForm, SubmitHandler } from 'react-hook-form';
|
|
4
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
5
|
-
import * as yup from 'yup';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { AccountChangePasswordFormType } from '@akinon/next/types';
|
|
8
|
-
|
|
9
|
-
import { Button, Input, Link } from '@theme/components';
|
|
10
|
-
import { ROUTES } from 'routes';
|
|
11
|
-
import { useUpdatePasswordMutation } from '@akinon/next/data/client/account';
|
|
12
|
-
import { useMemo, useState } from 'react';
|
|
13
|
-
import { useSearchParams, usePathname } from 'next/navigation';
|
|
14
|
-
import { useRouter } from '@akinon/next/hooks';
|
|
15
|
-
import { useLocalization } from '@akinon/next/hooks';
|
|
16
|
-
import PasswordRulesFeedback from '@theme/components/password-rules-feedback';
|
|
17
|
-
import { Trans } from '@akinon/next/components/trans';
|
|
18
|
-
|
|
19
|
-
const accountChangePasswordSchema = (t) =>
|
|
20
|
-
yup.object().shape({
|
|
21
|
-
old_password: yup
|
|
22
|
-
.string()
|
|
23
|
-
.required(t('account.change_password.form.required')),
|
|
24
|
-
new_password1: yup
|
|
25
|
-
.string()
|
|
26
|
-
.required(t('account.change_password.form.required'))
|
|
27
|
-
.matches(
|
|
28
|
-
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{6,}$/,
|
|
29
|
-
t('account.change_password.form.error.password_rule')
|
|
30
|
-
)
|
|
31
|
-
.max(50, t('account.change_password.form.error.password_max')),
|
|
32
|
-
new_password2: yup
|
|
33
|
-
.string()
|
|
34
|
-
.oneOf(
|
|
35
|
-
[yup.ref('new_password1')],
|
|
36
|
-
t('account.change_password.form.new_password_repeat.error.not_same')
|
|
37
|
-
)
|
|
38
|
-
.required(t('account.change_password.form.required'))
|
|
39
|
-
});
|
|
40
|
-
export default function Page() {
|
|
41
|
-
const { t } = useLocalization();
|
|
42
|
-
const {
|
|
43
|
-
register,
|
|
44
|
-
handleSubmit,
|
|
45
|
-
watch,
|
|
46
|
-
formState: { errors }
|
|
47
|
-
} = useForm<AccountChangePasswordFormType>({
|
|
48
|
-
resolver: yupResolver(accountChangePasswordSchema(t))
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const [formError, setFormError] = useState(null);
|
|
52
|
-
const [updatePassword] = useUpdatePasswordMutation();
|
|
53
|
-
|
|
54
|
-
const router = useRouter();
|
|
55
|
-
const searchParams = useSearchParams();
|
|
56
|
-
const pathname = usePathname();
|
|
57
|
-
const passwordValue = watch('new_password1', '');
|
|
58
|
-
|
|
59
|
-
const onSubmit: SubmitHandler<AccountChangePasswordFormType> = (data) => {
|
|
60
|
-
updatePassword(data)
|
|
61
|
-
.unwrap()
|
|
62
|
-
.then(() => {
|
|
63
|
-
router.push(pathname + '?formSuccess=true');
|
|
64
|
-
})
|
|
65
|
-
.catch((error) => setFormError(error.data));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const LinkText = (props) => {
|
|
69
|
-
return (
|
|
70
|
-
<Link {...props} href={props.href || '#'} className="underline">
|
|
71
|
-
{props.title}
|
|
72
|
-
</Link>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const successParam = searchParams.get('formSuccess');
|
|
77
|
-
|
|
78
|
-
const isSuccess = useMemo(() => successParam === 'true', [successParam]);
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<div>
|
|
82
|
-
<div className="p-6 bg-gray-150">
|
|
83
|
-
<h3 className="text-3xl text-center mb-5">
|
|
84
|
-
{t('account.change_password.header.title')}
|
|
85
|
-
</h3>
|
|
86
|
-
</div>
|
|
87
|
-
<div className="flex flex-col lg:flex-row">
|
|
88
|
-
{isSuccess ? (
|
|
89
|
-
<div className="border border-gray-500 mt-5 p-6 lg:px-24 lg:py-10 lg:w-[670px]">
|
|
90
|
-
<h3
|
|
91
|
-
className="text-3xl mb-5"
|
|
92
|
-
data-testid="account-change-password-response"
|
|
93
|
-
>
|
|
94
|
-
{t('account.change_password.form.success.title')}
|
|
95
|
-
</h3>
|
|
96
|
-
|
|
97
|
-
<p className="text-sm mb-4">
|
|
98
|
-
{t('account.change_password.form.success.description')}
|
|
99
|
-
</p>
|
|
100
|
-
|
|
101
|
-
<Link
|
|
102
|
-
href={'/'}
|
|
103
|
-
className="underline"
|
|
104
|
-
data-testid="account-change-password-response-button"
|
|
105
|
-
>
|
|
106
|
-
{t('account.change_password.form.success.button')}
|
|
107
|
-
</Link>
|
|
108
|
-
</div>
|
|
109
|
-
) : (
|
|
110
|
-
<form
|
|
111
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
112
|
-
className="border border-gray-500 mt-5 p-6 lg:px-24 lg:py-10 lg:w-[670px]"
|
|
113
|
-
>
|
|
114
|
-
<div className={clsx(errors.old_password ? 'mb-8' : 'mb-5')}>
|
|
115
|
-
<Input
|
|
116
|
-
label={t(
|
|
117
|
-
'account.change_password.form.current_password.placeholder'
|
|
118
|
-
)}
|
|
119
|
-
data-testid="account-current-password"
|
|
120
|
-
type="password"
|
|
121
|
-
{...register('old_password')}
|
|
122
|
-
error={errors.old_password}
|
|
123
|
-
required
|
|
124
|
-
/>
|
|
125
|
-
|
|
126
|
-
{formError && (
|
|
127
|
-
<div className="text-sm text-error mb-2">
|
|
128
|
-
{formError.old_password}
|
|
129
|
-
</div>
|
|
130
|
-
)}
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
<div
|
|
134
|
-
className={clsx(
|
|
135
|
-
'relative',
|
|
136
|
-
errors.new_password1 ? 'mb-8' : 'mb-5'
|
|
137
|
-
)}
|
|
138
|
-
>
|
|
139
|
-
<Input
|
|
140
|
-
label={t(
|
|
141
|
-
'account.change_password.form.new_password.placeholder'
|
|
142
|
-
)}
|
|
143
|
-
type="password"
|
|
144
|
-
data-testid="account-new-password"
|
|
145
|
-
{...register('new_password1')}
|
|
146
|
-
error={errors.new_password1}
|
|
147
|
-
required
|
|
148
|
-
/>
|
|
149
|
-
|
|
150
|
-
<PasswordRulesFeedback
|
|
151
|
-
password={passwordValue}
|
|
152
|
-
isVisible={errors?.new_password1 ? true : false}
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
<div className={clsx(errors.new_password2 ? 'mb-8' : 'mb-5')}>
|
|
157
|
-
<Input
|
|
158
|
-
label={t(
|
|
159
|
-
'account.change_password.form.new_password_repeat.placeholder'
|
|
160
|
-
)}
|
|
161
|
-
type="password"
|
|
162
|
-
data-testid="account-repeat-password"
|
|
163
|
-
{...register('new_password2')}
|
|
164
|
-
error={errors.new_password2}
|
|
165
|
-
required
|
|
166
|
-
/>
|
|
167
|
-
</div>
|
|
168
|
-
|
|
169
|
-
<Button
|
|
170
|
-
type="submit"
|
|
171
|
-
className="w-full font-medium"
|
|
172
|
-
data-testid="account-password-change"
|
|
173
|
-
>
|
|
174
|
-
{t('account.change_password.form.submit_button')}
|
|
175
|
-
</Button>
|
|
176
|
-
</form>
|
|
177
|
-
)}
|
|
178
|
-
|
|
179
|
-
<div className="my-6 lg:ml-8">
|
|
180
|
-
<h2 className="text-3xl mb-4">
|
|
181
|
-
{t('account.change_password.info.title')}
|
|
182
|
-
</h2>
|
|
183
|
-
<p className="text-sm font-medium">
|
|
184
|
-
<Trans
|
|
185
|
-
i18nKey="account.change_password.info.content"
|
|
186
|
-
components={{
|
|
187
|
-
ContactLink: (
|
|
188
|
-
<LinkText
|
|
189
|
-
href={ROUTES.ACCOUNT_CONTACT}
|
|
190
|
-
title={t('account.change_password.info.contact')}
|
|
191
|
-
/>
|
|
192
|
-
),
|
|
193
|
-
Faq: (
|
|
194
|
-
<LinkText
|
|
195
|
-
href={ROUTES.ACCOUNT_FAQ}
|
|
196
|
-
title={t('account.change_password.info.faq')}
|
|
197
|
-
/>
|
|
198
|
-
)
|
|
199
|
-
}}
|
|
200
|
-
/>
|
|
201
|
-
</p>
|
|
202
|
-
</div>
|
|
203
|
-
</div>
|
|
204
|
-
</div>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { CouponItem } from '@theme/views/coupon-item';
|
|
4
|
-
import { LoaderSpinner } from '@theme/components';
|
|
5
|
-
import {
|
|
6
|
-
useGetBasketOffersQuery,
|
|
7
|
-
useGetFutureBasketOffersQuery,
|
|
8
|
-
useGetExpiredBasketOffersQuery,
|
|
9
|
-
useGetDiscountItemsQuery
|
|
10
|
-
} from '@akinon/next/data/client/account';
|
|
11
|
-
import { useLocalization } from '@akinon/next/hooks';
|
|
12
|
-
|
|
13
|
-
export default function Page() {
|
|
14
|
-
const { t } = useLocalization();
|
|
15
|
-
const {
|
|
16
|
-
data: basketOffers,
|
|
17
|
-
isLoading: basketOffersLoading,
|
|
18
|
-
isSuccess: basketOffersSuccess
|
|
19
|
-
} = useGetBasketOffersQuery();
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
data: futureBasketOffers,
|
|
23
|
-
isLoading: futureBasketOffersLoading,
|
|
24
|
-
isSuccess: futureBasketOffersSuccess
|
|
25
|
-
} = useGetFutureBasketOffersQuery();
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
data: expiredBasketOffers,
|
|
29
|
-
isLoading: expiredBasketOffersLoading,
|
|
30
|
-
isSuccess: expiredBasketOffersSuccess
|
|
31
|
-
} = useGetExpiredBasketOffersQuery();
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
data: discountItems,
|
|
35
|
-
isLoading: discountItemsLoading,
|
|
36
|
-
isSuccess: discountItemsSuccess
|
|
37
|
-
} = useGetDiscountItemsQuery();
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div>
|
|
41
|
-
<div className="bg-gray-150 p-4 lg:p-8">
|
|
42
|
-
<h2 className="text-3xl text-center">
|
|
43
|
-
{t('account.my_vouchers.header.title')}
|
|
44
|
-
</h2>
|
|
45
|
-
<p className="text-center mt-5">
|
|
46
|
-
{t('account.my_vouchers.header.subtitle')}
|
|
47
|
-
</p>
|
|
48
|
-
</div>
|
|
49
|
-
<div className="flex flex-col lg:flex-row">
|
|
50
|
-
<div className="border border-gray-500 mt-5 p-6 w-full lg:px-24 lg:py-10 relative h-full">
|
|
51
|
-
{basketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
52
|
-
{basketOffersSuccess && (
|
|
53
|
-
<CouponItem
|
|
54
|
-
mainTitle={t('account.my_vouchers.title.campaings.active')}
|
|
55
|
-
subTitles={[
|
|
56
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
57
|
-
t('account.my_vouchers.card.starting_date'),
|
|
58
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
59
|
-
t('account.my_vouchers.card.amount')
|
|
60
|
-
]}
|
|
61
|
-
data={basketOffers.discounts}
|
|
62
|
-
offerType="coupon"
|
|
63
|
-
values={['label', 'start_datetime', 'end_datetime', 'amount']}
|
|
64
|
-
emptyText={t('account.my_vouchers.card.empty_campaign')}
|
|
65
|
-
/>
|
|
66
|
-
)}
|
|
67
|
-
|
|
68
|
-
{futureBasketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
69
|
-
{futureBasketOffersSuccess && (
|
|
70
|
-
<CouponItem
|
|
71
|
-
mainTitle={t('account.my_vouchers.title.campaings.to_be_active')}
|
|
72
|
-
subTitles={[
|
|
73
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
74
|
-
t('account.my_vouchers.card.starting_date'),
|
|
75
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
76
|
-
t('account.my_vouchers.card.amount')
|
|
77
|
-
]}
|
|
78
|
-
data={futureBasketOffers.results}
|
|
79
|
-
offerType="coupon"
|
|
80
|
-
values={['label', 'start_datetime', 'end_datetime', 'amount']}
|
|
81
|
-
emptyText={t('account.my_vouchers.card.empty_campaign')}
|
|
82
|
-
/>
|
|
83
|
-
)}
|
|
84
|
-
|
|
85
|
-
{expiredBasketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
86
|
-
{expiredBasketOffersSuccess && (
|
|
87
|
-
<CouponItem
|
|
88
|
-
mainTitle={t('account.my_vouchers.title.campaings.expired')}
|
|
89
|
-
subTitles={[
|
|
90
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
91
|
-
t('account.my_vouchers.card.starting_date'),
|
|
92
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
93
|
-
t('account.my_vouchers.card.amount')
|
|
94
|
-
]}
|
|
95
|
-
data={expiredBasketOffers.results}
|
|
96
|
-
offerType="coupon"
|
|
97
|
-
values={['label', 'start_datetime', 'end_datetime', 'amount']}
|
|
98
|
-
emptyText={t('account.my_vouchers.card.empty_campaign')}
|
|
99
|
-
/>
|
|
100
|
-
)}
|
|
101
|
-
|
|
102
|
-
{discountItemsLoading && <LoaderSpinner className="mb-8" />}
|
|
103
|
-
{discountItemsSuccess && (
|
|
104
|
-
<CouponItem
|
|
105
|
-
mainTitle={t('account.my_vouchers.title.campaings.used')}
|
|
106
|
-
subTitles={[
|
|
107
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
108
|
-
t('account.my_vouchers.card.starting_date'),
|
|
109
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
110
|
-
t('account.my_vouchers.card.amount')
|
|
111
|
-
]}
|
|
112
|
-
data={discountItems.discounts}
|
|
113
|
-
offerType="coupon"
|
|
114
|
-
values={['label', 'created_date', 'order_number', 'amount']}
|
|
115
|
-
emptyText={t('account.my_vouchers.card.empty_campaign')}
|
|
116
|
-
/>
|
|
117
|
-
)}
|
|
118
|
-
|
|
119
|
-
{basketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
120
|
-
{basketOffersSuccess && (
|
|
121
|
-
<CouponItem
|
|
122
|
-
mainTitle={t('account.my_vouchers.title.coupons.active')}
|
|
123
|
-
subTitles={[
|
|
124
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
125
|
-
t('account.my_vouchers.card.starting_date'),
|
|
126
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
127
|
-
t('account.my_vouchers.card.amount')
|
|
128
|
-
]}
|
|
129
|
-
data={basketOffers.discounts}
|
|
130
|
-
offerType="coupon_code"
|
|
131
|
-
values={[
|
|
132
|
-
'voucher_code',
|
|
133
|
-
'start_datetime',
|
|
134
|
-
'end_datetime',
|
|
135
|
-
'amount'
|
|
136
|
-
]}
|
|
137
|
-
emptyText={t('account.my_vouchers.card.empty_coupon')}
|
|
138
|
-
/>
|
|
139
|
-
)}
|
|
140
|
-
|
|
141
|
-
{futureBasketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
142
|
-
{futureBasketOffersSuccess && (
|
|
143
|
-
<CouponItem
|
|
144
|
-
mainTitle={t('account.my_vouchers.title.coupons.to_be_active')}
|
|
145
|
-
subTitles={[
|
|
146
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
147
|
-
t('account.my_vouchers.card.starting_date'),
|
|
148
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
149
|
-
t('account.my_vouchers.card.amount')
|
|
150
|
-
]}
|
|
151
|
-
data={futureBasketOffers.discounts}
|
|
152
|
-
offerType="coupon_code"
|
|
153
|
-
values={[
|
|
154
|
-
'voucher_code',
|
|
155
|
-
'start_datetime',
|
|
156
|
-
'end_datetime',
|
|
157
|
-
'amount'
|
|
158
|
-
]}
|
|
159
|
-
emptyText={t('account.my_vouchers.card.empty_coupon')}
|
|
160
|
-
/>
|
|
161
|
-
)}
|
|
162
|
-
|
|
163
|
-
{expiredBasketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
164
|
-
{expiredBasketOffersSuccess && (
|
|
165
|
-
<CouponItem
|
|
166
|
-
mainTitle={t('account.my_vouchers.title.coupons.expired')}
|
|
167
|
-
subTitles={[
|
|
168
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
169
|
-
t('account.my_vouchers.card.starting_date'),
|
|
170
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
171
|
-
t('account.my_vouchers.card.amount')
|
|
172
|
-
]}
|
|
173
|
-
data={expiredBasketOffers.results}
|
|
174
|
-
offerType="coupon_code"
|
|
175
|
-
values={[
|
|
176
|
-
'voucher_code',
|
|
177
|
-
'start_datetime',
|
|
178
|
-
'end_datetime',
|
|
179
|
-
'amount'
|
|
180
|
-
]}
|
|
181
|
-
emptyText={t('account.my_vouchers.card.empty_coupon')}
|
|
182
|
-
/>
|
|
183
|
-
)}
|
|
184
|
-
|
|
185
|
-
{discountItemsLoading && <LoaderSpinner className="mb-8" />}
|
|
186
|
-
{discountItemsSuccess && (
|
|
187
|
-
<CouponItem
|
|
188
|
-
mainTitle={t('account.my_vouchers.title.coupons.used')}
|
|
189
|
-
subTitles={[
|
|
190
|
-
t('account.my_vouchers.card.campaign_name'),
|
|
191
|
-
t('account.my_vouchers.card.starting_date'),
|
|
192
|
-
t('account.my_vouchers.card.expiration_date'),
|
|
193
|
-
t('account.my_vouchers.card.amount')
|
|
194
|
-
]}
|
|
195
|
-
data={discountItems.discounts}
|
|
196
|
-
offerType="coupon_code"
|
|
197
|
-
values={[
|
|
198
|
-
'voucher_code',
|
|
199
|
-
'created_date',
|
|
200
|
-
'order_number',
|
|
201
|
-
'amount'
|
|
202
|
-
]}
|
|
203
|
-
emptyText={t('account.my_vouchers.card.empty_coupon')}
|
|
204
|
-
/>
|
|
205
|
-
)}
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { FaqFooter, FaqSearch, FaqTabs } from '@theme/views/account/faq';
|
|
5
|
-
|
|
6
|
-
export default function AccountFaqPage() {
|
|
7
|
-
const [searchKey, setSearchKey] = useState('');
|
|
8
|
-
|
|
9
|
-
const handleChange = (e) => {
|
|
10
|
-
const { value } = e.target;
|
|
11
|
-
setSearchKey(value);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div className="flex-1">
|
|
16
|
-
<FaqSearch handleChange={handleChange} searchKey={searchKey} />
|
|
17
|
-
|
|
18
|
-
<FaqTabs searchKey={searchKey} />
|
|
19
|
-
|
|
20
|
-
<FaqFooter />
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
}
|
package/app-template/src/app/[commerce]/[locale]/[currency]/account/favourite-products/page.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useLocalization } from '@akinon/next/hooks';
|
|
4
|
-
import { useGetFavoritesQuery } from '@akinon/next/data/client/wishlist';
|
|
5
|
-
import { useSearchParams } from 'next/navigation';
|
|
6
|
-
import FavoriteProductsList from '@theme/views/account/favourite-products/favourite-products-list';
|
|
7
|
-
|
|
8
|
-
const AccountWishlist = () => {
|
|
9
|
-
const { t } = useLocalization();
|
|
10
|
-
const searchParams = useSearchParams();
|
|
11
|
-
const { data: favorites } = useGetFavoritesQuery({
|
|
12
|
-
page: Number(searchParams.get('page')),
|
|
13
|
-
limit: Number(searchParams.get('limit'))
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<div className="flex-1">
|
|
18
|
-
<div className="bg-gray-150 p-4 lg:p-8">
|
|
19
|
-
<h2 className="text-3xl text-center mb-5">
|
|
20
|
-
{t('account.my_wishlist.header.title')}
|
|
21
|
-
</h2>
|
|
22
|
-
<p className="text-center">
|
|
23
|
-
<span>{t('account.my_wishlist.header.subtitle')}</span> (
|
|
24
|
-
<span data-testid="favorites-count">{favorites?.count || 0}</span>)
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
<FavoriteProductsList />
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default AccountWishlist;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import AccountBackButton from '@theme/views/account/back-button';
|
|
2
|
-
import AccountMenu from '@theme/views/account/account-menu';
|
|
3
|
-
import { getServerSession } from 'next-auth/next';
|
|
4
|
-
import { ROUTES } from 'routes';
|
|
5
|
-
import { redirect } from '@akinon/next/utils/redirect';
|
|
6
|
-
|
|
7
|
-
export default async function AccountLayout({
|
|
8
|
-
children
|
|
9
|
-
}: {
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
}) {
|
|
12
|
-
const session = await getServerSession();
|
|
13
|
-
|
|
14
|
-
if (!session?.user) {
|
|
15
|
-
return redirect(ROUTES.AUTH);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="container flex py-10 px-4 xl:px-0">
|
|
20
|
-
<AccountMenu />
|
|
21
|
-
<div className="w-full flex-1">
|
|
22
|
-
<AccountBackButton />
|
|
23
|
-
|
|
24
|
-
{children}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|