@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,140 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { CheckoutStepList, Summary } from '@theme/views/checkout';
|
|
4
|
+
import PaymentStep from '@theme/views/checkout/steps/payment';
|
|
5
|
+
import ShippingStep from '@theme/views/checkout/steps/shipping';
|
|
6
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
7
|
+
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
8
|
+
import {
|
|
9
|
+
resetCheckoutState,
|
|
10
|
+
setCurrentStep
|
|
11
|
+
} from '@akinon/next/redux/reducers/checkout';
|
|
12
|
+
import { RootState } from '@theme/redux/store';
|
|
13
|
+
import { ROUTES } from '@theme/routes';
|
|
14
|
+
import { useFetchCheckoutQuery } from '@akinon/next/data/client/checkout';
|
|
15
|
+
import { Button, LoaderSpinner } from '@theme/components';
|
|
16
|
+
import { pushAddPaymentInfo, pushAddShippingInfo } from '@theme/utils/gtm';
|
|
17
|
+
import { CheckoutStep } from '@akinon/next/types';
|
|
18
|
+
import { useRouter, useLocalization } from '@akinon/next/hooks';
|
|
19
|
+
import dynamic from 'next/dynamic';
|
|
20
|
+
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
21
|
+
|
|
22
|
+
const Checkout = () => {
|
|
23
|
+
const { t } = useLocalization();
|
|
24
|
+
const { steps, preOrder } = useAppSelector(
|
|
25
|
+
(state: RootState) => state.checkout
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const {
|
|
29
|
+
data: checkoutData,
|
|
30
|
+
isFetching,
|
|
31
|
+
isError,
|
|
32
|
+
isSuccess,
|
|
33
|
+
refetch: refetchCheckout
|
|
34
|
+
} = useFetchCheckoutQuery(null, {
|
|
35
|
+
refetchOnMountOrArgChange: true
|
|
36
|
+
});
|
|
37
|
+
const initialStepChanged = useRef<boolean>(false);
|
|
38
|
+
const router = useRouter();
|
|
39
|
+
const dispatch = useAppDispatch();
|
|
40
|
+
|
|
41
|
+
const CheckoutAuth = useMemo(
|
|
42
|
+
() =>
|
|
43
|
+
dynamic(() => {
|
|
44
|
+
return import('@theme/views/checkout/auth');
|
|
45
|
+
}),
|
|
46
|
+
[]
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (steps.shipping.completed && !initialStepChanged.current) {
|
|
51
|
+
dispatch(setCurrentStep(CheckoutStep.Payment));
|
|
52
|
+
initialStepChanged.current = true;
|
|
53
|
+
}
|
|
54
|
+
}, [steps.shipping.completed]);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (preOrder && !preOrder.shipping_option) {
|
|
58
|
+
initialStepChanged.current = true;
|
|
59
|
+
}
|
|
60
|
+
}, [preOrder]);
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
return () => {
|
|
64
|
+
dispatch(resetCheckoutState());
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (isSuccess) {
|
|
70
|
+
const products = checkoutData?.pre_order?.basket?.basketitem_set.map(
|
|
71
|
+
(basketItem) => ({
|
|
72
|
+
...basketItem.product
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
if (steps.current === 'shipping') {
|
|
76
|
+
pushAddShippingInfo(products);
|
|
77
|
+
}
|
|
78
|
+
if (steps.current === 'payment') {
|
|
79
|
+
pushAddPaymentInfo(products, String(preOrder?.payment_option?.name));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, [isSuccess, steps, checkoutData, preOrder?.payment_option?.name]);
|
|
83
|
+
|
|
84
|
+
if (checkoutData?.redirect_url?.includes('basket')) {
|
|
85
|
+
router.push(ROUTES.BASKET);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (checkoutData?.template_name === 'orders/index.html') {
|
|
90
|
+
return (
|
|
91
|
+
<section className="container px-4 my-7 md:mt-20 lg:px-0 lg:mx-auto">
|
|
92
|
+
<CheckoutAuth />
|
|
93
|
+
</section>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (isFetching || isError) {
|
|
98
|
+
return (
|
|
99
|
+
<div className="flex flex-col items-center justify-center h-80">
|
|
100
|
+
{isFetching ? (
|
|
101
|
+
<LoaderSpinner />
|
|
102
|
+
) : (
|
|
103
|
+
<>
|
|
104
|
+
<div>{t('checkout.error.title')}</div>
|
|
105
|
+
<div className="mt-5">
|
|
106
|
+
<Button onClick={refetchCheckout}>
|
|
107
|
+
{t('checkout.error.button')}
|
|
108
|
+
</Button>
|
|
109
|
+
</div>
|
|
110
|
+
</>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<PluginModule component={Component.MasterpassProvider}>
|
|
118
|
+
<PluginModule component={Component.MasterpassDeleteConfirmationModal} />
|
|
119
|
+
<PluginModule component={Component.MasterpassOtpModal} />
|
|
120
|
+
<PluginModule component={Component.MasterpassLinkModal} />
|
|
121
|
+
|
|
122
|
+
<div className="container flex flex-col flex-wrap w-full px-4 md:px-0">
|
|
123
|
+
<CheckoutStepList />
|
|
124
|
+
|
|
125
|
+
<div className="w-full flex flex-wrap">
|
|
126
|
+
<div className="w-full h-fit-content lg:w-2/3">
|
|
127
|
+
{steps.current === CheckoutStep.Shipping && <ShippingStep />}
|
|
128
|
+
{steps.current === CheckoutStep.Payment && <PaymentStep />}
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div className="w-full h-fit-content mt-6 lg:w-1/3 lg:pl-8 lg:mt-0">
|
|
132
|
+
<Summary />
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</PluginModule>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export default Checkout;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useAppDispatch } from '@akinon/next/redux/hooks';
|
|
5
|
+
import { setCurrentStep } from '@akinon/next/redux/reducers/checkout';
|
|
6
|
+
import { ROUTES } from '@theme/routes';
|
|
7
|
+
import { useFetchCheckoutResultQuery } from '@akinon/next/data/client/checkout';
|
|
8
|
+
import { CheckoutStep, PageProps } from '@akinon/next/types';
|
|
9
|
+
import { CarouselCore } from '@theme/components/carousel-core';
|
|
10
|
+
import { Price, Button, Icon, LoaderSpinner, Link } from '@theme/components';
|
|
11
|
+
import { CheckoutStepList } from '@theme/views/checkout';
|
|
12
|
+
import { useLocalization } from '@akinon/next/hooks';
|
|
13
|
+
import { Image } from '@akinon/next/components/image';
|
|
14
|
+
import { Trans } from '@akinon/next/components/trans';
|
|
15
|
+
import { pushPurchaseEvent } from '@theme/utils/gtm';
|
|
16
|
+
|
|
17
|
+
const CheckoutCompleted = ({
|
|
18
|
+
params
|
|
19
|
+
}: PageProps<{
|
|
20
|
+
token: string;
|
|
21
|
+
}>) => {
|
|
22
|
+
const { t } = useLocalization();
|
|
23
|
+
const dispatch = useAppDispatch();
|
|
24
|
+
|
|
25
|
+
const { data, isLoading } = useFetchCheckoutResultQuery(String(params.token));
|
|
26
|
+
|
|
27
|
+
const carouselRef = useRef(null);
|
|
28
|
+
|
|
29
|
+
const goToPrev = () => {
|
|
30
|
+
carouselRef.current?.previous();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const goToNext = () => {
|
|
34
|
+
carouselRef.current?.next();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
dispatch(setCurrentStep(CheckoutStep.Confirmation));
|
|
39
|
+
|
|
40
|
+
return () => {
|
|
41
|
+
dispatch(setCurrentStep(CheckoutStep.Shipping));
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (data?.order) {
|
|
47
|
+
pushPurchaseEvent(data?.order);
|
|
48
|
+
}
|
|
49
|
+
}, [data]);
|
|
50
|
+
|
|
51
|
+
if (isLoading) {
|
|
52
|
+
return (
|
|
53
|
+
<div className="flex items-center justify-center min-h-[300px]">
|
|
54
|
+
<LoaderSpinner />
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!data || !data?.order) {
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex items-center justify-center py-20">
|
|
62
|
+
{t('checkout.completed.not_found')}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const LinkText = ({ orderNumber, href }) => {
|
|
68
|
+
return (
|
|
69
|
+
<Link
|
|
70
|
+
href={href || '#'}
|
|
71
|
+
className="underline cursor-pointer transition-all hover:text-secondary"
|
|
72
|
+
passHref
|
|
73
|
+
>
|
|
74
|
+
<span data-testid="order-number">{orderNumber}</span>
|
|
75
|
+
</Link>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div className="container pb-16 px-4 lg:px-0">
|
|
81
|
+
<CheckoutStepList />
|
|
82
|
+
|
|
83
|
+
<div className="flex flex-wrap">
|
|
84
|
+
<div className="w-full lg:w-6/10 2xl:w-2/3 mb-6 lg:mb-0">
|
|
85
|
+
<div className="p-6 w-full h-full border border-solid border-gray-400 md:px-20 md:py-14">
|
|
86
|
+
<div className="mb-4 text-black-800 text-xl font-light sm:text-2xl md:mb-8">
|
|
87
|
+
{t('checkout.completed.title')}
|
|
88
|
+
</div>
|
|
89
|
+
<div className="text-xs leading-6 text-black-400 mb-6">
|
|
90
|
+
<p>{t('checkout.completed.thank_you')}</p>
|
|
91
|
+
<p>
|
|
92
|
+
<Trans
|
|
93
|
+
i18nKey="checkout.completed.confirmation_message"
|
|
94
|
+
components={{
|
|
95
|
+
OrderNumber: (
|
|
96
|
+
<LinkText
|
|
97
|
+
href={`${ROUTES.ACCOUNT_ORDERS}/${data.order.id}`}
|
|
98
|
+
orderNumber={data.order.number}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
</p>
|
|
104
|
+
<p>{t('checkout.completed.purchase_info')}</p>
|
|
105
|
+
</div>
|
|
106
|
+
<div>
|
|
107
|
+
<div className="mb-4">
|
|
108
|
+
<div className="text-xs text-gray-950 uppercase tracking-wider mb-1">
|
|
109
|
+
{t('checkout.completed.your_email')}
|
|
110
|
+
</div>
|
|
111
|
+
<div className="text-xs text-black-400">
|
|
112
|
+
{data.order.user_email}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div className="mb-4">
|
|
116
|
+
<div className="text-xs text-gray-950 uppercase tracking-wider mb-1">
|
|
117
|
+
{t('checkout.completed.order_total')}
|
|
118
|
+
</div>
|
|
119
|
+
<div className="text-xs text-black-400">
|
|
120
|
+
<Price
|
|
121
|
+
value={data.order.amount}
|
|
122
|
+
data-testid="order-total-price"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<div className="mb-8">
|
|
127
|
+
<div className="text-xs text-gray-950 uppercase tracking-wider mb-1">
|
|
128
|
+
{t('checkout.completed.payment_type')}
|
|
129
|
+
</div>
|
|
130
|
+
<div
|
|
131
|
+
className="text-xs text-black-400"
|
|
132
|
+
data-testid="order-payment-type"
|
|
133
|
+
>
|
|
134
|
+
{data.order.payment_option.name}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div>
|
|
139
|
+
<div className="flex items-center justify-center border-t border-solid border-gray-400 py-6">
|
|
140
|
+
<span className="text-black-800 text-lg font-light">
|
|
141
|
+
{t('checkout.completed.order_summary')}
|
|
142
|
+
</span>
|
|
143
|
+
<span className="text-gray-950 text-sm ml-4">
|
|
144
|
+
<span data-testid="order-item-count">
|
|
145
|
+
{data.order.orderitem_set.length}
|
|
146
|
+
</span>{' '}
|
|
147
|
+
{t('checkout.completed.items')}
|
|
148
|
+
</span>
|
|
149
|
+
</div>
|
|
150
|
+
<div className="flex gap-6">
|
|
151
|
+
<div
|
|
152
|
+
onClick={goToPrev}
|
|
153
|
+
className="items-center justify-center hidden sm:flex"
|
|
154
|
+
>
|
|
155
|
+
<div className="flex justify-center p-2 border border-gray-100 rounded-full cursor-pointer">
|
|
156
|
+
<Icon
|
|
157
|
+
name="chevron-start"
|
|
158
|
+
size={15}
|
|
159
|
+
className="fill-[#000000]"
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
<div className="w-full overflow-hidden">
|
|
164
|
+
<CarouselCore
|
|
165
|
+
ref={carouselRef}
|
|
166
|
+
responsive={{
|
|
167
|
+
large: {
|
|
168
|
+
breakpoint: { max: 5000, min: 1370 },
|
|
169
|
+
items: 2
|
|
170
|
+
},
|
|
171
|
+
default: {
|
|
172
|
+
breakpoint: { max: 1369, min: 0 },
|
|
173
|
+
items: 1
|
|
174
|
+
}
|
|
175
|
+
}}
|
|
176
|
+
swipeable={true}
|
|
177
|
+
arrows={false}
|
|
178
|
+
itemClass="pr-[50px]"
|
|
179
|
+
containerAspectRatio={{
|
|
180
|
+
mobile: 460 / 88,
|
|
181
|
+
desktop: 637 / 88
|
|
182
|
+
}}
|
|
183
|
+
>
|
|
184
|
+
{data.order.orderitem_set.map((item) => (
|
|
185
|
+
<div key={`order-item-${item.id}`} className="flex">
|
|
186
|
+
<Link href={item.product.absolute_url} passHref>
|
|
187
|
+
<Image
|
|
188
|
+
src={item.product.image}
|
|
189
|
+
alt={item.product.name}
|
|
190
|
+
width={64}
|
|
191
|
+
height={96}
|
|
192
|
+
/>
|
|
193
|
+
</Link>
|
|
194
|
+
<div className="flex justify-between flex-1 items-center ml-4">
|
|
195
|
+
<>
|
|
196
|
+
<div className="text-xs text-black-800 transition-all w-full hover:text-secondary">
|
|
197
|
+
{item.product.name}
|
|
198
|
+
</div>
|
|
199
|
+
</>
|
|
200
|
+
<div>
|
|
201
|
+
{item.retail_price !== item.price && (
|
|
202
|
+
<div className="text-black-800 line-through text-xs min-w-max sm:text-sm">
|
|
203
|
+
<Price value={item.retail_price} />
|
|
204
|
+
</div>
|
|
205
|
+
)}
|
|
206
|
+
<div className="text-xs text-secondary min-w-max sm:text-sm">
|
|
207
|
+
<Price value={item.price} />
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
))}
|
|
213
|
+
</CarouselCore>
|
|
214
|
+
</div>
|
|
215
|
+
<div
|
|
216
|
+
onClick={goToNext}
|
|
217
|
+
className="items-center justify-center hidden sm:flex"
|
|
218
|
+
>
|
|
219
|
+
<div className="flex justify-center p-2 border border-gray-100 rounded-full cursor-pointer">
|
|
220
|
+
<Icon
|
|
221
|
+
name="chevron-end"
|
|
222
|
+
size={15}
|
|
223
|
+
className="fill-[#000000]"
|
|
224
|
+
/>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
<div className="w-full lg:pl-8 lg:w-4/10 2xl:w-1/3">
|
|
232
|
+
<div className="p-6 w-full h-full border border-solid border-gray-400 md:px-20 md:py-14">
|
|
233
|
+
<div className="mb-4 text-black-800 text-xl font-light sm:text-2xl md:mb-8">
|
|
234
|
+
{t('checkout.completed.side.whats_next')}
|
|
235
|
+
</div>
|
|
236
|
+
<div className="text-xs leading-6 text-black-400 mb-6">
|
|
237
|
+
<p>{t('checkout.completed.side.description_first')}</p>
|
|
238
|
+
</div>
|
|
239
|
+
<div className="text-xs leading-6 text-black-400 mb-6">
|
|
240
|
+
<p>{t('checkout.completed.side.description_second')}:</p>
|
|
241
|
+
<ul>
|
|
242
|
+
<li>
|
|
243
|
+
<Link
|
|
244
|
+
href={ROUTES.ACCOUNT_CONTACT}
|
|
245
|
+
className="underline cursor-pointer transition-all hover:text-secondary"
|
|
246
|
+
>
|
|
247
|
+
{t('checkout.completed.side.help_contact')}
|
|
248
|
+
</Link>
|
|
249
|
+
</li>
|
|
250
|
+
<li>
|
|
251
|
+
<Link
|
|
252
|
+
href={ROUTES.ACCOUNT}
|
|
253
|
+
className="underline cursor-pointer transition-all hover:text-secondary"
|
|
254
|
+
data-testid="order-my-account"
|
|
255
|
+
>
|
|
256
|
+
{t('checkout.completed.side.my_account')}
|
|
257
|
+
</Link>
|
|
258
|
+
</li>
|
|
259
|
+
<li>
|
|
260
|
+
<Link
|
|
261
|
+
href={ROUTES.ACCOUNT_FAQ}
|
|
262
|
+
className="underline cursor-pointer transition-all hover:text-secondary"
|
|
263
|
+
>
|
|
264
|
+
{t('checkout.completed.side.faq')}
|
|
265
|
+
</Link>
|
|
266
|
+
</li>
|
|
267
|
+
</ul>
|
|
268
|
+
<Button
|
|
269
|
+
appearance="outlined"
|
|
270
|
+
type="submit"
|
|
271
|
+
className="w-full mt-8 font-bold"
|
|
272
|
+
data-testid="order-new-items"
|
|
273
|
+
>
|
|
274
|
+
{t('checkout.completed.side.discover_new_items')}
|
|
275
|
+
</Button>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
);
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
export default CheckoutCompleted;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
|
|
3
|
+
import { HOME_WIDGETS } from '@theme/widgets';
|
|
4
|
+
import { getWidgetData } from '@akinon/next/data/server';
|
|
5
|
+
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
6
|
+
import LazyComponent from '@akinon/next/components/lazy-component';
|
|
7
|
+
|
|
8
|
+
type HomeWidgetOrderType = {
|
|
9
|
+
widget_order: Array<{
|
|
10
|
+
value: { item_slug: string };
|
|
11
|
+
kwargs: { value: object; data_type: string };
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const dynamic = 'force-static';
|
|
16
|
+
export const revalidate = 600;
|
|
17
|
+
|
|
18
|
+
async function Page() {
|
|
19
|
+
const data = await getWidgetData<HomeWidgetOrderType>({
|
|
20
|
+
slug: 'home-widget-order'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
if (!data?.attributes?.widget_order) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return data.attributes.widget_order.map((widget, index) => {
|
|
28
|
+
const Widget = HOME_WIDGETS[widget.value.item_slug];
|
|
29
|
+
|
|
30
|
+
if (Widget) {
|
|
31
|
+
if (index > 2) {
|
|
32
|
+
return (
|
|
33
|
+
<LazyComponent key={widget.value.item_slug} className="min-h-[150px]">
|
|
34
|
+
<Widget />
|
|
35
|
+
</LazyComponent>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return <Widget key={widget.value.item_slug} />;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return null;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function generateStaticParams() {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Skeleton, SkeletonWrapper } from 'components';
|
|
2
|
+
|
|
3
|
+
export default function Loading() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="container mx-auto">
|
|
6
|
+
<div className="max-w-5xl mx-auto my-5 px-7">
|
|
7
|
+
<SkeletonWrapper className="md:mb-7">
|
|
8
|
+
<Skeleton className="w-[17.25rem] h-4 lg:w-64" />
|
|
9
|
+
</SkeletonWrapper>
|
|
10
|
+
</div>
|
|
11
|
+
<div className="grid max-w-5xl grid-cols-2 lg:gap-8 mx-auto px-7">
|
|
12
|
+
<div className="col-span-2 mb-7 md:mb-0 lg:col-span-1">
|
|
13
|
+
<div className="flex gap-1">
|
|
14
|
+
<SkeletonWrapper className="hidden md:block md:mb-7">
|
|
15
|
+
{Array(5)
|
|
16
|
+
.fill(null)
|
|
17
|
+
.map((_, index) => (
|
|
18
|
+
<Skeleton key={index} className="w-20 h-24 mb-2" />
|
|
19
|
+
))}
|
|
20
|
+
</SkeletonWrapper>
|
|
21
|
+
|
|
22
|
+
<div className="flex-1">
|
|
23
|
+
<SkeletonWrapper className="md:mb-7">
|
|
24
|
+
<Skeleton className="w-full h-[30.375rem] md:h-[36.375rem]" />
|
|
25
|
+
</SkeletonWrapper>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div className="flex flex-col items-center col-span-2 lg:col-span-1">
|
|
30
|
+
<div className="w-full">
|
|
31
|
+
<SkeletonWrapper className="w-full md:mb-7 flex justify-center items-center">
|
|
32
|
+
<Skeleton className="w-96 h-16 mb-9" />
|
|
33
|
+
<Skeleton className="hidden w-36 h-14 mb-9 md:block" />
|
|
34
|
+
|
|
35
|
+
<div className="flex flex-col justify-center items-center mb-9">
|
|
36
|
+
<Skeleton className="w-36 h-4 mb-2" />
|
|
37
|
+
<div className="flex items-center gap-2">
|
|
38
|
+
{Array(3)
|
|
39
|
+
.fill(null)
|
|
40
|
+
.map((_, index) => (
|
|
41
|
+
<Skeleton key={index} className="w-24 h-10" />
|
|
42
|
+
))}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div className="flex flex-col justify-center items-center mb-4">
|
|
47
|
+
<Skeleton className="w-36 h-4 mb-2" />
|
|
48
|
+
<div className="flex items-center gap-2">
|
|
49
|
+
{Array(5)
|
|
50
|
+
.fill(null)
|
|
51
|
+
.map((_, index) => (
|
|
52
|
+
<Skeleton key={index} className="w-11 h-11" />
|
|
53
|
+
))}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<Skeleton className="hidden w-full h-14 mb-6 md:block" />
|
|
58
|
+
<Skeleton className="w-40 h-10 mb-9 md:w-72" />
|
|
59
|
+
<Skeleton className="w-24 h-10 mb-7" />
|
|
60
|
+
<Skeleton className="w-full h-36" />
|
|
61
|
+
</SkeletonWrapper>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { getProductData, getWidgetData } from '@akinon/next/data/server';
|
|
2
|
+
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
|
+
import { PageProps, Metadata } from '@akinon/next/types';
|
|
4
|
+
import { generateJsonLd } from '@theme/utils/generate-jsonld';
|
|
5
|
+
import { AccordionWrapper, ProductInfo } from '@theme/views/product';
|
|
6
|
+
import ProductLayout from '@theme/views/product/layout';
|
|
7
|
+
|
|
8
|
+
export async function generateMetadata({
|
|
9
|
+
params,
|
|
10
|
+
searchParams
|
|
11
|
+
}: PageProps<{ pk: number }>) {
|
|
12
|
+
let result: Metadata = {};
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const {
|
|
16
|
+
data: { product }
|
|
17
|
+
} = await getProductData({
|
|
18
|
+
pk: params.pk,
|
|
19
|
+
searchParams
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
result = {
|
|
23
|
+
title: product.name,
|
|
24
|
+
description: String(product.attributes.description),
|
|
25
|
+
twitter: {
|
|
26
|
+
title: product.name,
|
|
27
|
+
description: String(product.attributes.description)
|
|
28
|
+
},
|
|
29
|
+
openGraph: {
|
|
30
|
+
title: product.name,
|
|
31
|
+
description: String(product.attributes.description),
|
|
32
|
+
images: product.productimage_set?.map((item) => ({
|
|
33
|
+
url: item.image
|
|
34
|
+
}))
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// eslint-disable-next-line no-empty
|
|
38
|
+
} catch (error) {}
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
|
|
44
|
+
const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
|
|
45
|
+
getProductData({
|
|
46
|
+
pk: params.pk,
|
|
47
|
+
searchParams
|
|
48
|
+
}),
|
|
49
|
+
getWidgetData({ slug: 'product-delivery-returns' })
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
const jsonLd = generateJsonLd(data.product);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<ProductLayout data={data} breadcrumbData={breadcrumbData}>
|
|
57
|
+
<div className="flex flex-col items-center">
|
|
58
|
+
<h1
|
|
59
|
+
className="mt-4 text-2xl text-center md:mt-0"
|
|
60
|
+
data-testid="product-name"
|
|
61
|
+
>
|
|
62
|
+
{data.product.name}
|
|
63
|
+
</h1>
|
|
64
|
+
|
|
65
|
+
<ProductInfo data={data} />
|
|
66
|
+
|
|
67
|
+
<AccordionWrapper
|
|
68
|
+
data={data}
|
|
69
|
+
deliveryReturn={deliveryReturn?.attributes}
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</ProductLayout>
|
|
73
|
+
<script
|
|
74
|
+
type="application/ld+json"
|
|
75
|
+
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
|
76
|
+
/>
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default withSegmentDefaults(Page, { segmentType: 'page' });
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Skeleton, SkeletonWrapper } from 'components';
|
|
2
|
+
|
|
3
|
+
export default function Loading() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="container p-4 mx-auto lg:px-0 lg:my-4">
|
|
6
|
+
<SkeletonWrapper className="md:mb-7">
|
|
7
|
+
<Skeleton className="w-[17.25rem] h-4 lg:w-64" />
|
|
8
|
+
</SkeletonWrapper>
|
|
9
|
+
|
|
10
|
+
<div className="w-full flex gap-8">
|
|
11
|
+
<div className="hidden lg:block">
|
|
12
|
+
<SkeletonWrapper className="w-[17.25rem] h-[650px] shrink-0">
|
|
13
|
+
<Skeleton className="w-full h-full" />
|
|
14
|
+
</SkeletonWrapper>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div className="flex-1">
|
|
18
|
+
<div className="lg:hidden">
|
|
19
|
+
<SkeletonWrapper className="w-full flex-row items-center py-4 justify-center">
|
|
20
|
+
<div className="w-full flex gap-4 justify-center">
|
|
21
|
+
<Skeleton className="w-full h-9 md:w-40" />
|
|
22
|
+
<Skeleton className="w-full h-9 md:w-40" />
|
|
23
|
+
</div>
|
|
24
|
+
</SkeletonWrapper>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div className="hidden lg:block">
|
|
28
|
+
<SkeletonWrapper className="w-full flex-row items-center justify-between mb-4">
|
|
29
|
+
<div className="flex flex-row gap-5">
|
|
30
|
+
<Skeleton className="w-20 h-5" />
|
|
31
|
+
</div>
|
|
32
|
+
<div className="flex items-center gap-7">
|
|
33
|
+
<Skeleton className="w-[21.25rem] h-[38px]" />
|
|
34
|
+
<Skeleton className="w-40 h-[38px]" />
|
|
35
|
+
</div>
|
|
36
|
+
</SkeletonWrapper>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div className="grid gap-x-4 gap-y-7 grid-cols-2 md:grid-cols-3 lg:grid-cols-3">
|
|
40
|
+
{Array(6)
|
|
41
|
+
.fill(null)
|
|
42
|
+
.map((_, index) => (
|
|
43
|
+
<Skeleton
|
|
44
|
+
key={index}
|
|
45
|
+
className="w-full h-80 md:h-[26.813rem] lg::h-[35.875rem]"
|
|
46
|
+
/>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|