@akinon/projectzero 1.32.0 → 1.33.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 +6 -0
- package/app-template/.editorconfig +7 -0
- package/app-template/.env.example +9 -0
- package/app-template/.eslintignore +1 -0
- package/app-template/.eslintrc.js +31 -0
- package/app-template/.gitattributes +18 -0
- package/app-template/.husky/pre-commit +4 -0
- package/app-template/.lintstagedrc.js +12 -0
- package/app-template/.prettierrc +13 -0
- package/app-template/.releaserc.json +49 -0
- package/app-template/.stylelintrc.json +37 -0
- package/app-template/.vscode/extensions.json +11 -0
- package/app-template/.vscode/launch.json +29 -0
- package/app-template/.yarnrc +1 -0
- package/app-template/CHANGELOG.md +636 -0
- package/app-template/LICENSE +21 -0
- package/app-template/Procfile +1 -0
- package/app-template/README.md +29 -0
- package/app-template/akinon.json +28 -0
- package/app-template/bitbucket-pipelines.yml +54 -0
- package/app-template/build.sh +7 -0
- package/app-template/docs/CHANGELOG.md +85 -0
- package/app-template/docs/advanced-usage.md +43 -0
- package/app-template/docs/basic-setup.md +59 -0
- package/app-template/docs/data-fetching/client/account.md +1064 -0
- package/app-template/docs/data-fetching/client/address.md +805 -0
- package/app-template/docs/data-fetching/client/basket.md +107 -0
- package/app-template/docs/data-fetching/client/checkout.md +904 -0
- package/app-template/docs/data-fetching/client/misc.md +135 -0
- package/app-template/docs/data-fetching/client/product.md +284 -0
- package/app-template/docs/data-fetching/client/user.md +56 -0
- package/app-template/docs/data-fetching/client/wishlist.md +111 -0
- package/app-template/docs/data-fetching/server/category.md +324 -0
- package/app-template/docs/data-fetching/server/flat-page.md +42 -0
- package/app-template/docs/data-fetching/server/list.md +353 -0
- package/app-template/docs/data-fetching/server/menu.md +363 -0
- package/app-template/docs/data-fetching/server/product.md +131 -0
- package/app-template/docs/data-fetching/server/seo.md +44 -0
- package/app-template/docs/data-fetching/server/special-page.md +79 -0
- package/app-template/docs/data-fetching/server/widget.md +218 -0
- package/app-template/docs/delete-account.md +25 -0
- package/app-template/docs/deployment.md +46 -0
- package/app-template/docs/dynamic-route.md +33 -0
- package/app-template/docs/icons.md +52 -0
- package/app-template/docs/localization.md +204 -0
- package/app-template/docs/logging.md +48 -0
- package/app-template/docs/plugins.md +76 -0
- package/app-template/docs/seo-management.md +125 -0
- package/app-template/docs/static-assets.md +36 -0
- package/app-template/docs/widgets.md +127 -0
- package/app-template/global.d.ts +1 -0
- package/app-template/jest.config.ts +34 -0
- package/app-template/next-env.d.ts +6 -0
- package/app-template/next.config.mjs +34 -0
- package/app-template/package.json +97 -0
- package/app-template/plugins.d.ts +1 -0
- package/app-template/postcss.config.js +6 -0
- 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 +47 -0
- package/app-template/public/cvv.jpg +0 -0
- package/app-template/public/facebook.svg +3 -0
- package/app-template/public/google.svg +12 -0
- 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 +528 -0
- package/app-template/public/locales/en/account.json +490 -0
- package/app-template/public/locales/en/auth.json +100 -0
- package/app-template/public/locales/en/basket.json +50 -0
- package/app-template/public/locales/en/category.json +26 -0
- package/app-template/public/locales/en/checkout.json +152 -0
- package/app-template/public/locales/en/common.json +65 -0
- package/app-template/public/locales/en/forgot_password.json +41 -0
- package/app-template/public/locales/en/form.json +5 -0
- package/app-template/public/locales/en/product.json +39 -0
- package/app-template/public/locales/tr/account.json +490 -0
- package/app-template/public/locales/tr/auth.json +100 -0
- package/app-template/public/locales/tr/basket.json +50 -0
- package/app-template/public/locales/tr/category.json +26 -0
- package/app-template/public/locales/tr/checkout.json +152 -0
- package/app-template/public/locales/tr/common.json +65 -0
- package/app-template/public/locales/tr/forgot_password.json +41 -0
- package/app-template/public/locales/tr/form.json +5 -0
- package/app-template/public/locales/tr/product.json +39 -0
- package/app-template/public/logo.svg +29 -0
- package/app-template/public/manifest.json +35 -0
- package/app-template/public/mastercard.png +0 -0
- package/app-template/public/mastersecure.png +0 -0
- package/app-template/public/mfs-client.min.js +3 -0
- package/app-template/public/noimage.jpg +0 -0
- package/app-template/public/safari-pinned-tab.svg +320 -0
- 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 +2 -0
- package/app-template/sentry.client.config.ts +16 -0
- package/app-template/sentry.edge.config.ts +3 -0
- package/app-template/sentry.properties +4 -0
- package/app-template/sentry.server.config.ts +3 -0
- package/app-template/setupTests.ts +4 -0
- package/app-template/src/__tests__/index.test.tsx +7 -0
- package/app-template/src/__tests__/tsconfig.json +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/address/page.tsx +74 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-email/page.tsx +174 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-password/page.tsx +206 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/contact/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/coupons/page.tsx +210 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/email-verification/page.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/faq/page.tsx +23 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/favourite-products/page.tsx +32 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/layout.tsx +28 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/my-quotations/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +255 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/layout.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +309 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/page.tsx +137 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/page.tsx +226 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +399 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/address/stores/page.tsx +271 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/anonymous-tracking/page.tsx +33 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/oauth-login/page.tsx +3 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/page.tsx +76 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +77 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket-b2b/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +16 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/client-root.tsx +9 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/contact-us/page.tsx +11 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/error.tsx +20 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +18 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +48 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +72 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +23 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/layout.tsx +78 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/page.tsx +16 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/checkout/page.tsx +140 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/layout.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +284 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/page.tsx +50 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +67 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +81 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +25 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/template.tsx +75 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/email-set-primary/[[...id]]/page.tsx +43 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/password/reset/page.tsx +79 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/registration/account-confirm-email/[[...id]]/page.tsx +43 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/reset/[[...id]]/page.tsx +110 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +25 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/route.ts +37 -0
- package/app-template/src/app/api/cache/route.ts +1 -0
- package/app-template/src/app/api/client/[...slug]/route.ts +1 -0
- package/app-template/src/app/api/form/[...id]/route.ts +7 -0
- package/app-template/src/app/api/logout/route.ts +1 -0
- package/app-template/src/app/api/sentry/route.ts +9 -0
- package/app-template/src/app/api/web-vitals/route.ts +1 -0
- 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 +269 -0
- package/app-template/src/assets/fonts/index.scss +1 -0
- package/app-template/src/assets/fonts/pz-icon.css +154 -0
- package/app-template/src/assets/fonts/pz-icon.eot +0 -0
- package/app-template/src/assets/fonts/pz-icon.html +456 -0
- package/app-template/src/assets/fonts/pz-icon.scss +300 -0
- package/app-template/src/assets/fonts/pz-icon.svg +144 -0
- 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 +65 -0
- package/app-template/src/assets/icons/akinon.svg +11 -0
- package/app-template/src/assets/icons/arrow-up.svg +11 -0
- package/app-template/src/assets/icons/bell.svg +1 -0
- package/app-template/src/assets/icons/cart.svg +13 -0
- package/app-template/src/assets/icons/check.svg +19 -0
- package/app-template/src/assets/icons/chevron-down.svg +8 -0
- package/app-template/src/assets/icons/chevron-end.svg +8 -0
- package/app-template/src/assets/icons/chevron-start.svg +8 -0
- package/app-template/src/assets/icons/chevron-up.svg +8 -0
- package/app-template/src/assets/icons/close.svg +12 -0
- package/app-template/src/assets/icons/cvc.svg +54 -0
- package/app-template/src/assets/icons/default.svg +6 -0
- package/app-template/src/assets/icons/directions.svg +14 -0
- package/app-template/src/assets/icons/eye-off.svg +10 -0
- package/app-template/src/assets/icons/eye-on.svg +17 -0
- package/app-template/src/assets/icons/facebook-login.svg +11 -0
- package/app-template/src/assets/icons/facebook.svg +9 -0
- package/app-template/src/assets/icons/giftbox.svg +22 -0
- package/app-template/src/assets/icons/globe.svg +12 -0
- package/app-template/src/assets/icons/google-login.svg +19 -0
- package/app-template/src/assets/icons/google.svg +9 -0
- package/app-template/src/assets/icons/hamburger.svg +5 -0
- package/app-template/src/assets/icons/heart-full.svg +20 -0
- package/app-template/src/assets/icons/heart-stroke.svg +22 -0
- package/app-template/src/assets/icons/info.svg +1 -0
- package/app-template/src/assets/icons/instagram.svg +14 -0
- package/app-template/src/assets/icons/layout-2.svg +7 -0
- package/app-template/src/assets/icons/layout-3.svg +4 -0
- package/app-template/src/assets/icons/logo.svg +24 -0
- package/app-template/src/assets/icons/mail.svg +1 -0
- package/app-template/src/assets/icons/minus.svg +4 -0
- package/app-template/src/assets/icons/money.svg +4 -0
- package/app-template/src/assets/icons/mp-otp.svg +1 -0
- package/app-template/src/assets/icons/pin.svg +16 -0
- package/app-template/src/assets/icons/pinterest.svg +12 -0
- package/app-template/src/assets/icons/plus.svg +5 -0
- package/app-template/src/assets/icons/search.svg +13 -0
- package/app-template/src/assets/icons/share.svg +10 -0
- package/app-template/src/assets/icons/spinner.svg +6 -0
- package/app-template/src/assets/icons/store-pin.svg +14 -0
- package/app-template/src/assets/icons/track-order.svg +1 -0
- package/app-template/src/assets/icons/twitter.svg +11 -0
- package/app-template/src/assets/icons/user.svg +14 -0
- package/app-template/src/assets/icons/whatsapp.svg +45 -0
- package/app-template/src/components/__tests__/Modal.test.tsx +103 -0
- package/app-template/src/components/__tests__/accordion.test.tsx +65 -0
- package/app-template/src/components/__tests__/badge.test.tsx +20 -0
- package/app-template/src/components/__tests__/button.test.tsx +59 -0
- package/app-template/src/components/__tests__/checkbox.test.tsx +57 -0
- package/app-template/src/components/__tests__/file-input.test.tsx +42 -0
- package/app-template/src/components/__tests__/icon.test.tsx +39 -0
- package/app-template/src/components/__tests__/input.test.tsx +69 -0
- package/app-template/src/components/__tests__/language-select.test.tsx +81 -0
- package/app-template/src/components/__tests__/link.test.tsx +65 -0
- package/app-template/src/components/__tests__/price.test.tsx +72 -0
- package/app-template/src/components/__tests__/radio.test.tsx +52 -0
- package/app-template/src/components/__tests__/select.test.tsx +115 -0
- package/app-template/src/components/__tests__/tab.test.tsx +101 -0
- package/app-template/src/components/accordion.tsx +64 -0
- package/app-template/src/components/badge.tsx +21 -0
- package/app-template/src/components/button.tsx +46 -0
- package/app-template/src/components/canonical-url.tsx +21 -0
- package/app-template/src/components/carousel-core.tsx +42 -0
- package/app-template/src/components/checkbox.tsx +28 -0
- package/app-template/src/components/currency-select.tsx +81 -0
- package/app-template/src/components/custom-loader.tsx +21 -0
- package/app-template/src/components/dynamic-form.tsx +17 -0
- package/app-template/src/components/file-input.tsx +8 -0
- package/app-template/src/components/generate-form-fields.tsx +349 -0
- package/app-template/src/components/icon.tsx +18 -0
- package/app-template/src/components/index.ts +41 -0
- package/app-template/src/components/input.tsx +110 -0
- package/app-template/src/components/language-select.tsx +33 -0
- package/app-template/src/components/link.tsx +53 -0
- package/app-template/src/components/loader-spinner.tsx +23 -0
- package/app-template/src/components/modal.tsx +66 -0
- package/app-template/src/components/pagination.tsx +267 -0
- package/app-template/src/components/password-rules-feedback.tsx +60 -0
- package/app-template/src/components/price.tsx +54 -0
- package/app-template/src/components/pwa-tags.tsx +233 -0
- package/app-template/src/components/radio.tsx +18 -0
- package/app-template/src/components/react-portal.tsx +47 -0
- package/app-template/src/components/select.tsx +70 -0
- package/app-template/src/components/shimmer.tsx +21 -0
- package/app-template/src/components/skeleton-article.tsx +15 -0
- package/app-template/src/components/skeleton-product.tsx +14 -0
- package/app-template/src/components/skeleton-profile.tsx +19 -0
- package/app-template/src/components/skeleton-wrapper.tsx +19 -0
- package/app-template/src/components/skeleton.tsx +37 -0
- package/app-template/src/components/source.tsx +12 -0
- package/app-template/src/components/tab-panel.tsx +10 -0
- package/app-template/src/components/tab.tsx +58 -0
- package/app-template/src/components/tabs.tsx +58 -0
- package/app-template/src/components/types/index.ts +89 -0
- package/app-template/src/hooks/index.ts +1 -0
- package/app-template/src/hooks/use-add-product-to-basket.ts +48 -0
- package/app-template/src/hooks/use-contract.tsx +58 -0
- package/app-template/src/hooks/use-fav-button.tsx +99 -0
- package/app-template/src/instrumentation.ts +1 -0
- package/app-template/src/middleware.ts +33 -0
- package/app-template/src/pages/_error.js +14 -0
- package/app-template/src/pages/api/auth/[...nextauth].ts +3 -0
- package/app-template/src/plugins.js +14 -0
- package/app-template/src/redux/middlewares/category.ts +42 -0
- package/app-template/src/redux/reducers/category.ts +67 -0
- package/app-template/src/redux/store.ts +47 -0
- package/app-template/src/routes/index.ts +46 -0
- package/app-template/src/settings.js +62 -0
- package/app-template/src/theme.js +1 -0
- package/app-template/src/types/index.ts +72 -0
- package/app-template/src/types/next-auth.d.ts +24 -0
- package/app-template/src/types/widgets.ts +115 -0
- package/app-template/src/utils/convert-facet-search-params.ts +15 -0
- package/app-template/src/utils/generate-jsonld.ts +23 -0
- package/app-template/src/utils/gtm.ts +247 -0
- package/app-template/src/utils/index.ts +60 -0
- package/app-template/src/views/account/account-menu.tsx +117 -0
- package/app-template/src/views/account/address-card.tsx +157 -0
- package/app-template/src/views/account/address-form.tsx +374 -0
- package/app-template/src/views/account/back-button.tsx +27 -0
- package/app-template/src/views/account/contact-form.tsx +283 -0
- package/app-template/src/views/account/content-header.tsx +52 -0
- package/app-template/src/views/account/faq/faq-footer.tsx +30 -0
- package/app-template/src/views/account/faq/faq-search.tsx +35 -0
- package/app-template/src/views/account/faq/faq-tabs.tsx +54 -0
- package/app-template/src/views/account/faq/index.ts +3 -0
- package/app-template/src/views/account/favorite-item.tsx +191 -0
- package/app-template/src/views/account/favourite-products/favourite-products-list.tsx +65 -0
- package/app-template/src/views/account/index.ts +4 -0
- package/app-template/src/views/account/order.tsx +89 -0
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +99 -0
- package/app-template/src/views/account/orders/order-detail-header.tsx +39 -0
- package/app-template/src/views/anonymous-tracking/index.tsx +109 -0
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +318 -0
- package/app-template/src/views/basket/basket-item.tsx +231 -0
- package/app-template/src/views/basket/index.ts +2 -0
- package/app-template/src/views/basket/summary.tsx +220 -0
- package/app-template/src/views/breadcrumb.tsx +35 -0
- package/app-template/src/views/category/category-active-filters.tsx +98 -0
- package/app-template/src/views/category/category-banner.tsx +34 -0
- package/app-template/src/views/category/category-header.tsx +143 -0
- package/app-template/src/views/category/category-info.tsx +123 -0
- package/app-template/src/views/category/filters/index.tsx +163 -0
- package/app-template/src/views/category/filters/size-filter.tsx +27 -0
- package/app-template/src/views/category/layout.tsx +38 -0
- package/app-template/src/views/checkout/auth.tsx +54 -0
- package/app-template/src/views/checkout/index.tsx +3 -0
- package/app-template/src/views/checkout/layout/footer.tsx +48 -0
- package/app-template/src/views/checkout/layout/header.tsx +38 -0
- package/app-template/src/views/checkout/step-button.tsx +69 -0
- package/app-template/src/views/checkout/step-list.tsx +51 -0
- package/app-template/src/views/checkout/steps/payment/agreements.tsx +42 -0
- package/app-template/src/views/checkout/steps/payment/index.tsx +31 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +382 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-card/installments.tsx +100 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-payment.tsx +14 -0
- package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +174 -0
- package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +19 -0
- package/app-template/src/views/checkout/steps/payment/options/pay-on-delivery.tsx +15 -0
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +94 -0
- package/app-template/src/views/checkout/steps/payment/payment-header.tsx +17 -0
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +73 -0
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +244 -0
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +189 -0
- package/app-template/src/views/checkout/steps/shipping/index.tsx +27 -0
- package/app-template/src/views/checkout/steps/shipping/shipping-options.tsx +72 -0
- package/app-template/src/views/checkout/summary.tsx +181 -0
- package/app-template/src/views/coupon-item/index.tsx +80 -0
- package/app-template/src/views/find-in-store/index.tsx +183 -0
- package/app-template/src/views/footer.tsx +21 -0
- package/app-template/src/views/guest-login/index.tsx +130 -0
- package/app-template/src/views/header/action-menu.tsx +117 -0
- package/app-template/src/views/header/band.tsx +32 -0
- package/app-template/src/views/header/index.tsx +66 -0
- package/app-template/src/views/header/mini-basket.tsx +267 -0
- package/app-template/src/views/header/mobile-hamburger-button.tsx +35 -0
- package/app-template/src/views/header/mobile-menu.tsx +144 -0
- package/app-template/src/views/header/navbar.tsx +186 -0
- package/app-template/src/views/header/pwa-back-button.tsx +60 -0
- package/app-template/src/views/header/search/index.tsx +82 -0
- package/app-template/src/views/header/search/results.tsx +123 -0
- package/app-template/src/views/header/user-menu.tsx +72 -0
- package/app-template/src/views/index.tsx +2 -0
- package/app-template/src/views/installment-options/index.tsx +127 -0
- package/app-template/src/views/login/index.tsx +233 -0
- package/app-template/src/views/otp-login/index.tsx +152 -0
- package/app-template/src/views/page-loader-spinner/index.tsx +9 -0
- package/app-template/src/views/product/accordion-wrapper.tsx +59 -0
- package/app-template/src/views/product/combine-product-card.tsx +82 -0
- package/app-template/src/views/product/index.ts +8 -0
- package/app-template/src/views/product/layout.tsx +40 -0
- package/app-template/src/views/product/misc-buttons.tsx +65 -0
- package/app-template/src/views/product/price-wrapper.tsx +41 -0
- package/app-template/src/views/product/product-group-info.tsx +63 -0
- package/app-template/src/views/product/product-info.tsx +273 -0
- package/app-template/src/views/product/slider.tsx +124 -0
- package/app-template/src/views/product/variant.tsx +104 -0
- package/app-template/src/views/product-item/index.tsx +96 -0
- package/app-template/src/views/product-pointer-banner-item.tsx +243 -0
- package/app-template/src/views/register/index.tsx +417 -0
- package/app-template/src/views/root-modal.tsx +21 -0
- package/app-template/src/views/sales-contract-modal/index.tsx +288 -0
- package/app-template/src/views/share/index.tsx +71 -0
- package/app-template/src/views/widgets/home-hero-slider-content.tsx +54 -0
- package/app-template/src/views/widgets/recommendation-content.tsx +86 -0
- package/app-template/src/widgets/footer-copyright.tsx +25 -0
- package/app-template/src/widgets/footer-info.tsx +78 -0
- package/app-template/src/widgets/footer-menu.tsx +258 -0
- package/app-template/src/widgets/footer-social.tsx +53 -0
- package/app-template/src/widgets/footer-subscription/footer-subscription-form.tsx +110 -0
- package/app-template/src/widgets/footer-subscription/index.tsx +30 -0
- package/app-template/src/widgets/header-band-text.tsx +21 -0
- package/app-template/src/widgets/home-discovery.tsx +191 -0
- package/app-template/src/widgets/home-hero-slider.tsx +36 -0
- package/app-template/src/widgets/home-product-recommendation.tsx +18 -0
- package/app-template/src/widgets/home-single-banner.tsx +87 -0
- package/app-template/src/widgets/home-stories-eng.tsx +112 -0
- package/app-template/src/widgets/index.ts +25 -0
- package/app-template/src/widgets/product-pointer-banners.tsx +35 -0
- package/app-template/src/widgets/special-page-banner.tsx +49 -0
- package/app-template/src/widgets/special-page-carousel.tsx +68 -0
- package/app-template/src/widgets/widget-order.tsx +1 -0
- package/app-template/tailwind.config.js +170 -0
- package/app-template/tsconfig.json +44 -0
- package/app-template/tsconfig.test.json +6 -0
- package/app-template/yarn.lock +11278 -0
- package/commands/create.ts +49 -118
- package/dist/commands/create.js +32 -68
- package/package.json +1 -1
- package/tsconfig.json +9 -8
|
@@ -0,0 +1,174 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|