@pradip1995/create-storefront 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-storefront.js +239 -0
- package/lib/kit-next-config.js +84 -0
- package/package.json +32 -0
- package/templates/storefront/.eslintrc.json +3 -0
- package/templates/storefront/README.md +35 -0
- package/templates/storefront/check-env-variables.js +51 -0
- package/templates/storefront/kit-next-config.js +71 -0
- package/templates/storefront/next-env.d.ts +5 -0
- package/templates/storefront/next.config.js +25 -0
- package/templates/storefront/package.json +56 -0
- package/templates/storefront/postcss.config.js +6 -0
- package/templates/storefront/public/favicon.png +0 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/checkout/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/checkout/payment/page.tsx +47 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/layout.tsx +31 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/not-found.tsx +19 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/addresses/page.tsx +31 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/loading.tsx +9 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx +35 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/exchange/[id]/page.tsx +47 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx +28 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/return/[id]/page.tsx +66 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/page.tsx +22 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/payment-methods/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx +43 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@login/default.tsx +11 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@login/page.tsx +18 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/guest-orders/page.tsx +13 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/layout.tsx +22 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/loading.tsx +9 -0
- package/templates/storefront/src/app/[countryCode]/(main)/cart/loading.tsx +5 -0
- package/templates/storefront/src/app/[countryCode]/(main)/cart/not-found.tsx +21 -0
- package/templates/storefront/src/app/[countryCode]/(main)/cart/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(main)/categories/[...category]/page.tsx +11 -0
- package/templates/storefront/src/app/[countryCode]/(main)/collections/[handle]/page.tsx +11 -0
- package/templates/storefront/src/app/[countryCode]/(main)/contact/page.tsx +21 -0
- package/templates/storefront/src/app/[countryCode]/(main)/guest-orders/page.tsx +12 -0
- package/templates/storefront/src/app/[countryCode]/(main)/help/page.tsx +28 -0
- package/templates/storefront/src/app/[countryCode]/(main)/layout.tsx +21 -0
- package/templates/storefront/src/app/[countryCode]/(main)/not-found.tsx +20 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/confirmed/loading.tsx +5 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/confirmed/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/accept/page.tsx +41 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/decline/page.tsx +41 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/page.tsx +38 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/exchange/[id]/page.tsx +47 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/return/[id]/page.tsx +61 -0
- package/templates/storefront/src/app/[countryCode]/(main)/orders/[id]/page.tsx +33 -0
- package/templates/storefront/src/app/[countryCode]/(main)/page.tsx +24 -0
- package/templates/storefront/src/app/[countryCode]/(main)/privacy-policy/page.tsx +173 -0
- package/templates/storefront/src/app/[countryCode]/(main)/products/[handle]/page.tsx +193 -0
- package/templates/storefront/src/app/[countryCode]/(main)/reset-password/page.tsx +192 -0
- package/templates/storefront/src/app/[countryCode]/(main)/store/page.tsx +72 -0
- package/templates/storefront/src/app/[countryCode]/(main)/terms-of-use/page.tsx +179 -0
- package/templates/storefront/src/app/[countryCode]/(main)/wishlist/page.tsx +19 -0
- package/templates/storefront/src/app/api/meta/event/route.ts +63 -0
- package/templates/storefront/src/app/auth/customer/google/callback/page.tsx +126 -0
- package/templates/storefront/src/app/layout.tsx +104 -0
- package/templates/storefront/src/app/not-found.tsx +30 -0
- package/templates/storefront/src/app/opengraph-image.jpg +0 -0
- package/templates/storefront/src/app/robots.ts +15 -0
- package/templates/storefront/src/app/sitemap.ts +65 -0
- package/templates/storefront/src/app/twitter-image.jpg +0 -0
- package/templates/storefront/src/modules/account/components/account-deletion/index.tsx +160 -0
- package/templates/storefront/src/modules/account/components/account-info/index.tsx +145 -0
- package/templates/storefront/src/modules/account/components/account-nav/icons.tsx +43 -0
- package/templates/storefront/src/modules/account/components/account-nav/index.tsx +318 -0
- package/templates/storefront/src/modules/account/components/account-nav/logout-modal.tsx +92 -0
- package/templates/storefront/src/modules/account/components/account-nav/payment-methods-icon.tsx +9 -0
- package/templates/storefront/src/modules/account/components/address-book/index.tsx +47 -0
- package/templates/storefront/src/modules/account/components/address-card/add-address.tsx +377 -0
- package/templates/storefront/src/modules/account/components/address-card/edit-address-modal.tsx +468 -0
- package/templates/storefront/src/modules/account/components/deletion-pending-modal/index.tsx +213 -0
- package/templates/storefront/src/modules/account/components/forgot-password/index.tsx +1 -0
- package/templates/storefront/src/modules/account/components/login/index.tsx +1 -0
- package/templates/storefront/src/modules/account/components/order-card/index.tsx +221 -0
- package/templates/storefront/src/modules/account/components/order-overview/index.tsx +159 -0
- package/templates/storefront/src/modules/account/components/overview/index.tsx +189 -0
- package/templates/storefront/src/modules/account/components/profile-billing-address/index.tsx +447 -0
- package/templates/storefront/src/modules/account/components/profile-email/index.tsx +75 -0
- package/templates/storefront/src/modules/account/components/profile-form/index.tsx +416 -0
- package/templates/storefront/src/modules/account/components/profile-name/index.tsx +76 -0
- package/templates/storefront/src/modules/account/components/profile-password/index.tsx +70 -0
- package/templates/storefront/src/modules/account/components/profile-phone/index.tsx +185 -0
- package/templates/storefront/src/modules/account/components/register/index.tsx +1 -0
- package/templates/storefront/src/modules/account/components/return-item-selector/index.tsx +187 -0
- package/templates/storefront/src/modules/account/components/return-shipping-selector/index.tsx +118 -0
- package/templates/storefront/src/modules/account/components/transfer-request-form/index.tsx +81 -0
- package/templates/storefront/src/modules/account/templates/account-layout.tsx +38 -0
- package/templates/storefront/src/modules/account/templates/exchange-request-template.tsx +389 -0
- package/templates/storefront/src/modules/account/templates/guest-orders-template.tsx +123 -0
- package/templates/storefront/src/modules/account/templates/login-template.tsx +44 -0
- package/templates/storefront/src/modules/account/templates/payment-methods-template.tsx +478 -0
- package/templates/storefront/src/modules/account/templates/return-request-template.tsx +300 -0
- package/templates/storefront/src/modules/cart/components/abandoned-carts/ScrollToPendingOrdersButton.tsx +21 -0
- package/templates/storefront/src/modules/cart/components/abandoned-carts/index.tsx +335 -0
- package/templates/storefront/src/modules/cart/components/applied-promotions/index.tsx +121 -0
- package/templates/storefront/src/modules/cart/components/cart-delivery-selection/index.tsx +203 -0
- package/templates/storefront/src/modules/cart/components/cart-item-card/index.tsx +476 -0
- package/templates/storefront/src/modules/cart/components/cart-item-select/index.tsx +73 -0
- package/templates/storefront/src/modules/cart/components/cart-view-tracker/index.tsx +44 -0
- package/templates/storefront/src/modules/cart/components/delivery-information/index.tsx +89 -0
- package/templates/storefront/src/modules/cart/components/empty-cart-message/index.tsx +38 -0
- package/templates/storefront/src/modules/cart/components/item/index.tsx +150 -0
- package/templates/storefront/src/modules/cart/components/pincode-checker/index.tsx +174 -0
- package/templates/storefront/src/modules/cart/components/sign-in-prompt/index.tsx +26 -0
- package/templates/storefront/src/modules/cart/components/you-may-also-like/index.tsx +137 -0
- package/templates/storefront/src/modules/cart/templates/index.tsx +88 -0
- package/templates/storefront/src/modules/cart/templates/items.tsx +49 -0
- package/templates/storefront/src/modules/cart/templates/preview.tsx +51 -0
- package/templates/storefront/src/modules/cart/templates/summary.tsx +29 -0
- package/templates/storefront/src/modules/checkout/components/add-address-modal/index.tsx +390 -0
- package/templates/storefront/src/modules/checkout/components/address-card/index.tsx +135 -0
- package/templates/storefront/src/modules/checkout/components/address-select/index.tsx +116 -0
- package/templates/storefront/src/modules/checkout/components/addresses/index.tsx +605 -0
- package/templates/storefront/src/modules/checkout/components/back-link/index.tsx +32 -0
- package/templates/storefront/src/modules/checkout/components/billing_address/index.tsx +301 -0
- package/templates/storefront/src/modules/checkout/components/checkout-begin-tracker/index.tsx +45 -0
- package/templates/storefront/src/modules/checkout/components/checkout-leave-guard/index.tsx +109 -0
- package/templates/storefront/src/modules/checkout/components/checkout-shipping-tracker/index.tsx +45 -0
- package/templates/storefront/src/modules/checkout/components/country-select/index.tsx +50 -0
- package/templates/storefront/src/modules/checkout/components/discount-code/index.tsx +220 -0
- package/templates/storefront/src/modules/checkout/components/error-message/index.tsx +13 -0
- package/templates/storefront/src/modules/checkout/components/payment/index.tsx +572 -0
- package/templates/storefront/src/modules/checkout/components/payment-button/index.tsx +257 -0
- package/templates/storefront/src/modules/checkout/components/payment-button/razorpay-payment-button.tsx +136 -0
- package/templates/storefront/src/modules/checkout/components/payment-container/index.tsx +129 -0
- package/templates/storefront/src/modules/checkout/components/payment-test/index.tsx +12 -0
- package/templates/storefront/src/modules/checkout/components/payment-wrapper/index.tsx +50 -0
- package/templates/storefront/src/modules/checkout/components/payment-wrapper/stripe-wrapper.tsx +54 -0
- package/templates/storefront/src/modules/checkout/components/processing-overlay/index.tsx +83 -0
- package/templates/storefront/src/modules/checkout/components/review/index.tsx +60 -0
- package/templates/storefront/src/modules/checkout/components/select-address-modal/index.tsx +103 -0
- package/templates/storefront/src/modules/checkout/components/shipping/index.tsx +533 -0
- package/templates/storefront/src/modules/checkout/components/shipping-address/index.tsx +521 -0
- package/templates/storefront/src/modules/checkout/components/submit-button/index.tsx +32 -0
- package/templates/storefront/src/modules/checkout/templates/checkout-form/index.tsx +38 -0
- package/templates/storefront/src/modules/checkout/templates/checkout-summary/index.tsx +274 -0
- package/templates/storefront/src/modules/common/components/breadcrumb/index.tsx +43 -0
- package/templates/storefront/src/modules/common/components/cart-totals/index.tsx +473 -0
- package/templates/storefront/src/modules/common/components/checkbox/index.tsx +98 -0
- package/templates/storefront/src/modules/common/components/delete-button/index.tsx +156 -0
- package/templates/storefront/src/modules/common/components/divider/index.tsx +9 -0
- package/templates/storefront/src/modules/common/components/filter-checkbox-group/index.tsx +134 -0
- package/templates/storefront/src/modules/common/components/filter-radio-group/index.tsx +62 -0
- package/templates/storefront/src/modules/common/components/input/index.tsx +79 -0
- package/templates/storefront/src/modules/common/components/interactive-link/index.tsx +33 -0
- package/templates/storefront/src/modules/common/components/line-item-options/index.tsx +26 -0
- package/templates/storefront/src/modules/common/components/line-item-price/index.tsx +64 -0
- package/templates/storefront/src/modules/common/components/line-item-unit-price/index.tsx +61 -0
- package/templates/storefront/src/modules/common/components/localized-client-link/index.tsx +32 -0
- package/templates/storefront/src/modules/common/components/login-popup/index.tsx +78 -0
- package/templates/storefront/src/modules/common/components/modal/index.tsx +123 -0
- package/templates/storefront/src/modules/common/components/native-select/index.tsx +75 -0
- package/templates/storefront/src/modules/common/components/obfuscated-email/index.tsx +30 -0
- package/templates/storefront/src/modules/common/components/product/product-rating/index.tsx +172 -0
- package/templates/storefront/src/modules/common/components/product/review-modal/index.tsx +333 -0
- package/templates/storefront/src/modules/common/components/product/share-button/index.tsx +227 -0
- package/templates/storefront/src/modules/common/components/product/wishlist-icon/index.tsx +46 -0
- package/templates/storefront/src/modules/common/components/radio/index.tsx +27 -0
- package/templates/storefront/src/modules/common/components/select/index.tsx +164 -0
- package/templates/storefront/src/modules/common/components/side-panel/index.tsx +65 -0
- package/templates/storefront/src/modules/common/icons/arrow-left.tsx +36 -0
- package/templates/storefront/src/modules/common/icons/back.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/bancontact.tsx +26 -0
- package/templates/storefront/src/modules/common/icons/chevron-down.tsx +30 -0
- package/templates/storefront/src/modules/common/icons/delivered.tsx +29 -0
- package/templates/storefront/src/modules/common/icons/envelope.tsx +27 -0
- package/templates/storefront/src/modules/common/icons/eye-off.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/eye.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/fast-delivery.tsx +65 -0
- package/templates/storefront/src/modules/common/icons/ideal.tsx +26 -0
- package/templates/storefront/src/modules/common/icons/lock.tsx +31 -0
- package/templates/storefront/src/modules/common/icons/map-pin.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/medusa.tsx +27 -0
- package/templates/storefront/src/modules/common/icons/menu.tsx +45 -0
- package/templates/storefront/src/modules/common/icons/nextjs.tsx +27 -0
- package/templates/storefront/src/modules/common/icons/package.tsx +44 -0
- package/templates/storefront/src/modules/common/icons/paypal.tsx +30 -0
- package/templates/storefront/src/modules/common/icons/phone.tsx +30 -0
- package/templates/storefront/src/modules/common/icons/placeholder-image.tsx +44 -0
- package/templates/storefront/src/modules/common/icons/refresh.tsx +51 -0
- package/templates/storefront/src/modules/common/icons/spinner.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/trash.tsx +51 -0
- package/templates/storefront/src/modules/common/icons/user.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/x.tsx +37 -0
- package/templates/storefront/src/modules/contact/templates/index.tsx +272 -0
- package/templates/storefront/src/modules/help/templates/index.tsx +629 -0
- package/templates/storefront/src/modules/home/components/dynamic-banner/index.tsx +190 -0
- package/templates/storefront/src/modules/home/components/featured-products/index.tsx +16 -0
- package/templates/storefront/src/modules/home/components/featured-products/product-rail/index.tsx +51 -0
- package/templates/storefront/src/modules/home/components/features/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/hero/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/loved-by-moms/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/new-arrivals/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/shop-by-age/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/shop-by-category/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/testimonials/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/why-choose-us/dynamic-features.tsx +93 -0
- package/templates/storefront/src/modules/home/components/why-choose-us/index.tsx +1 -0
- package/templates/storefront/src/modules/layout/components/account-dropdown/index.tsx +56 -0
- package/templates/storefront/src/modules/layout/components/cart-button/index.tsx +8 -0
- package/templates/storefront/src/modules/layout/components/cart-dropdown/index.tsx +424 -0
- package/templates/storefront/src/modules/layout/components/cart-mismatch-banner/index.tsx +57 -0
- package/templates/storefront/src/modules/layout/components/cookie-consent/index.tsx +116 -0
- package/templates/storefront/src/modules/layout/components/country-select/index.tsx +135 -0
- package/templates/storefront/src/modules/layout/components/desktop-search/index.tsx +148 -0
- package/templates/storefront/src/modules/layout/components/dynamic-logo/index.tsx +27 -0
- package/templates/storefront/src/modules/layout/components/footer-categories/index.tsx +34 -0
- package/templates/storefront/src/modules/layout/components/footer-contact/index.tsx +87 -0
- package/templates/storefront/src/modules/layout/components/footer-description/index.tsx +12 -0
- package/templates/storefront/src/modules/layout/components/footer-logo/index.tsx +22 -0
- package/templates/storefront/src/modules/layout/components/footer-newsletter/index.tsx +100 -0
- package/templates/storefront/src/modules/layout/components/language-select/index.tsx +192 -0
- package/templates/storefront/src/modules/layout/components/medusa-cta/index.tsx +21 -0
- package/templates/storefront/src/modules/layout/components/mobile-menu/index.tsx +296 -0
- package/templates/storefront/src/modules/layout/components/nav-links/index.tsx +66 -0
- package/templates/storefront/src/modules/layout/components/nav-wrapper/index.tsx +14 -0
- package/templates/storefront/src/modules/layout/components/promo-bar/index.tsx +7 -0
- package/templates/storefront/src/modules/layout/components/promo-bar/promo-bar-content.tsx +174 -0
- package/templates/storefront/src/modules/layout/components/push-notification-manager/index.tsx +191 -0
- package/templates/storefront/src/modules/layout/components/search-panel/index.tsx +136 -0
- package/templates/storefront/src/modules/layout/components/side-menu/index.tsx +144 -0
- package/templates/storefront/src/modules/layout/components/verification-banner/index.tsx +217 -0
- package/templates/storefront/src/modules/layout/components/wishlist-counter/index.tsx +17 -0
- package/templates/storefront/src/modules/layout/templates/footer/index.tsx +7 -0
- package/templates/storefront/src/modules/layout/templates/nav/index.tsx +14 -0
- package/templates/storefront/src/modules/order/components/cancel-order-modal/index.tsx +168 -0
- package/templates/storefront/src/modules/order/components/help/index.tsx +25 -0
- package/templates/storefront/src/modules/order/components/item/index.tsx +62 -0
- package/templates/storefront/src/modules/order/components/items/index.tsx +44 -0
- package/templates/storefront/src/modules/order/components/onboarding-cta/index.tsx +28 -0
- package/templates/storefront/src/modules/order/components/order-confirmation-back-handler/index.tsx +28 -0
- package/templates/storefront/src/modules/order/components/order-details/index.tsx +63 -0
- package/templates/storefront/src/modules/order/components/order-purchase-tracker/index.tsx +48 -0
- package/templates/storefront/src/modules/order/components/order-redesign/index.tsx +887 -0
- package/templates/storefront/src/modules/order/components/order-summary/index.tsx +60 -0
- package/templates/storefront/src/modules/order/components/payment-details/index.tsx +63 -0
- package/templates/storefront/src/modules/order/components/shipping-details/index.tsx +73 -0
- package/templates/storefront/src/modules/order/components/transfer-actions/index.tsx +81 -0
- package/templates/storefront/src/modules/order/components/transfer-image/index.tsx +275 -0
- package/templates/storefront/src/modules/order/templates/order-completed-template.tsx +233 -0
- package/templates/storefront/src/modules/order/templates/order-details-template.tsx +128 -0
- package/templates/storefront/src/modules/products/components/image-gallery/index.tsx +297 -0
- package/templates/storefront/src/modules/products/components/product-actions/index.tsx +1400 -0
- package/templates/storefront/src/modules/products/components/product-actions/mobile-actions.tsx +217 -0
- package/templates/storefront/src/modules/products/components/product-actions/option-select.tsx +62 -0
- package/templates/storefront/src/modules/products/components/product-onboarding-cta/index.tsx +30 -0
- package/templates/storefront/src/modules/products/components/product-preview/index.tsx +5 -0
- package/templates/storefront/src/modules/products/components/product-preview/price.tsx +29 -0
- package/templates/storefront/src/modules/products/components/product-price/index.tsx +58 -0
- package/templates/storefront/src/modules/products/components/product-rating/index.tsx +1 -0
- package/templates/storefront/src/modules/products/components/product-tabs/accordion.tsx +100 -0
- package/templates/storefront/src/modules/products/components/product-tabs/index.tsx +127 -0
- package/templates/storefront/src/modules/products/components/product-tabs/ratings-tab.tsx +598 -0
- package/templates/storefront/src/modules/products/components/product-view-tracker/index.tsx +53 -0
- package/templates/storefront/src/modules/products/components/related-products/index.tsx +152 -0
- package/templates/storefront/src/modules/products/components/review-modal/index.tsx +1 -0
- package/templates/storefront/src/modules/products/components/share-button/index.tsx +1 -0
- package/templates/storefront/src/modules/products/components/thumbnail/index.tsx +91 -0
- package/templates/storefront/src/modules/products/components/wishlist-icon/index.tsx +1 -0
- package/templates/storefront/src/modules/products/context/product-context.tsx +52 -0
- package/templates/storefront/src/modules/products/templates/index.tsx +26 -0
- package/templates/storefront/src/modules/products/templates/product-actions-wrapper/index.tsx +1 -0
- package/templates/storefront/src/modules/products/templates/product-info/index.tsx +2 -0
- package/templates/storefront/src/modules/shipping/components/free-shipping-price-nudge/index.tsx +283 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-button/index.tsx +5 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-card-details/index.tsx +10 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-cart-item/index.tsx +35 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-cart-totals/index.tsx +30 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-code-form/index.tsx +13 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-line-item/index.tsx +35 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-confirmed-header/index.tsx +14 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-information/index.tsx +36 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-items/index.tsx +43 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-summary/index.tsx +15 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-product-preview/index.tsx +15 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-cart-page/index.tsx +65 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-order-confirmed/index.tsx +21 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-product-grid/index.tsx +23 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-related-products/index.tsx +25 -0
- package/templates/storefront/src/modules/store/components/client-paginated-products.tsx +108 -0
- package/templates/storefront/src/modules/store/components/mobile-filters/index.tsx +135 -0
- package/templates/storefront/src/modules/store/components/pagination/index.tsx +118 -0
- package/templates/storefront/src/modules/store/components/product-list-view-tracker/index.tsx +43 -0
- package/templates/storefront/src/modules/store/components/refinement-list/index.tsx +299 -0
- package/templates/storefront/src/modules/store/components/refinement-list/sort-products/index.tsx +120 -0
- package/templates/storefront/src/modules/store/components/store-header/index.tsx +67 -0
- package/templates/storefront/src/modules/store/templates/index.tsx +1 -0
- package/templates/storefront/src/modules/store/templates/paginated-products.tsx +175 -0
- package/templates/storefront/src/modules/wishlist/components/wishlist-item/index.tsx +797 -0
- package/templates/storefront/src/modules/wishlist/templates/index.tsx +176 -0
- package/templates/storefront/src/storefront.config.ts +12 -0
- package/templates/storefront/src/styles/globals.css +326 -0
- package/templates/storefront/src/theme/valero/blocks/home/Features/index.tsx +61 -0
- package/templates/storefront/src/theme/valero/blocks/home/Hero/index.tsx +102 -0
- package/templates/storefront/src/theme/valero/blocks/home/LovedByMoms/index.tsx +407 -0
- package/templates/storefront/src/theme/valero/blocks/home/NewArrivals/index.tsx +48 -0
- package/templates/storefront/src/theme/valero/blocks/home/ShopByAge/index.tsx +128 -0
- package/templates/storefront/src/theme/valero/blocks/home/ShopByCategory/index.tsx +409 -0
- package/templates/storefront/src/theme/valero/blocks/home/Testimonials/index.tsx +697 -0
- package/templates/storefront/src/theme/valero/blocks/home/WhyChooseUs/index.tsx +62 -0
- package/templates/storefront/src/theme/valero/layouts/MainLayoutShell.tsx +14 -0
- package/templates/storefront/src/theme/valero/primitives/Button.tsx +28 -0
- package/templates/storefront/src/theme/valero/primitives/Card.tsx +32 -0
- package/templates/storefront/src/theme/valero/primitives/index.ts +2 -0
- package/templates/storefront/src/theme/valero/slots/account/ForgotPassword/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/account/Login/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/account/LoginTemplate/index.tsx +44 -0
- package/templates/storefront/src/theme/valero/slots/account/Register/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/cart/CartItem/index.tsx +11 -0
- package/templates/storefront/src/theme/valero/slots/cart/CartSummary/index.tsx +13 -0
- package/templates/storefront/src/theme/valero/slots/checkout/CheckoutForm/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/checkout/CheckoutSummary/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/layout/Footer/index.tsx +104 -0
- package/templates/storefront/src/theme/valero/slots/layout/Nav/index.tsx +97 -0
- package/templates/storefront/src/theme/valero/slots/layout/PromoBar/index.tsx +19 -0
- package/templates/storefront/src/theme/valero/slots/layout/PromoBar/promo-bar-content.tsx +174 -0
- package/templates/storefront/src/theme/valero/slots/order/OrderDetails/index.tsx +12 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductCTASection.tsx +191 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductDetailsSection.tsx +137 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductFeaturePanel.tsx +245 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductHighlightsSection.tsx +98 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductOptionsSection.tsx +233 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductPriceSection.tsx +53 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductTrustSection.tsx +84 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/index.tsx +161 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductCard/index.tsx +132 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductInfo/index.tsx +40 -0
- package/templates/storefront/src/theme/valero/templates/StorePage/index.tsx +154 -0
- package/templates/storefront/src/theme/valero/tokens/colors.js +16 -0
- package/templates/storefront/src/theme/valero/tokens/colors.ts +21 -0
- package/templates/storefront/src/theme/valero/tokens/fonts.ts +13 -0
- package/templates/storefront/src/theme/valero/tokens/index.ts +3 -0
- package/templates/storefront/src/theme/valero/tokens/spacing.ts +9 -0
- package/templates/storefront/src/theme/valero/tokens/theme.css +91 -0
- package/templates/storefront/tailwind.config.js +221 -0
- package/templates/storefront/tsconfig.json +30 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { retrieveCart } from "@core/data/cart"
|
|
2
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
3
|
+
import { listCartPaymentMethods } from "@core/data/payment"
|
|
4
|
+
import PaymentWrapper from "@modules/checkout/components/payment-wrapper"
|
|
5
|
+
import CheckoutShippingTracker from "@modules/checkout/components/checkout-shipping-tracker"
|
|
6
|
+
import Payment from "@modules/checkout/components/payment"
|
|
7
|
+
import Review from "@modules/checkout/components/review"
|
|
8
|
+
import CheckoutSummary from "@modules/checkout/templates/checkout-summary"
|
|
9
|
+
import BackLink from "@modules/checkout/components/back-link"
|
|
10
|
+
import { Metadata } from "next"
|
|
11
|
+
import { notFound } from "next/navigation"
|
|
12
|
+
|
|
13
|
+
export const metadata: Metadata = {
|
|
14
|
+
title: "Payment - Checkout",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default async function PaymentPage() {
|
|
18
|
+
const cart = await retrieveCart()
|
|
19
|
+
|
|
20
|
+
if (!cart) {
|
|
21
|
+
return notFound()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const customer = await retrieveCustomer()
|
|
25
|
+
const paymentMethods = await listCartPaymentMethods(cart.region?.id ?? "")
|
|
26
|
+
|
|
27
|
+
if (!paymentMethods) {
|
|
28
|
+
return notFound()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="w-full max-w-[1360px] mx-auto px-3 min-[550px]:px-4 sm:px-6 md:px-8 min-[1023px]:px-4 min-[1150px]:px-6 min-[1360px]:px-8 py-4 min-[550px]:py-6 sm:py-8 md:py-12 min-[1023px]:py-10 min-[1150px]:py-12 min-[1360px]:py-12">
|
|
33
|
+
{/* Back Button */}
|
|
34
|
+
<div className="mb-4 min-[550px]:mb-6">
|
|
35
|
+
<BackLink />
|
|
36
|
+
</div>
|
|
37
|
+
<div className="grid grid-cols-1 min-[1024px]:grid-cols-[1fr_416px] gap-4 min-[550px]:gap-5 sm:gap-6 md:gap-8 min-[768px]:gap-6 min-[1023px]:gap-4 min-[1150px]:gap-6 min-[1200px]:gap-10 min-[1360px]:gap-12 w-full">
|
|
38
|
+
<PaymentWrapper cart={cart}>
|
|
39
|
+
<div className="w-full grid grid-cols-1 gap-y-6 min-[550px]:gap-y-8">
|
|
40
|
+
<Payment cart={cart} availablePaymentMethods={paymentMethods} />
|
|
41
|
+
</div>
|
|
42
|
+
</PaymentWrapper>
|
|
43
|
+
<CheckoutSummary cart={cart} customer={customer} />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Nav from "@modules/layout/templates/nav"
|
|
2
|
+
import Footer from "@modules/layout/templates/footer"
|
|
3
|
+
import { ModalProvider } from "@core/context/modal-context"
|
|
4
|
+
import NavWrapper from "@modules/layout/components/nav-wrapper"
|
|
5
|
+
import { WishlistProvider } from "@core/context/wishlist-context"
|
|
6
|
+
import CheckoutLeaveGuard from "@modules/checkout/components/checkout-leave-guard"
|
|
7
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
8
|
+
import VerificationBanner from "@modules/layout/components/verification-banner"
|
|
9
|
+
|
|
10
|
+
export default async function CheckoutLayout({
|
|
11
|
+
children,
|
|
12
|
+
}: {
|
|
13
|
+
children: React.ReactNode
|
|
14
|
+
}) {
|
|
15
|
+
const customer = await retrieveCustomer()
|
|
16
|
+
return (
|
|
17
|
+
<WishlistProvider>
|
|
18
|
+
<ModalProvider>
|
|
19
|
+
<CheckoutLeaveGuard />
|
|
20
|
+
<NavWrapper>
|
|
21
|
+
<Nav />
|
|
22
|
+
</NavWrapper>
|
|
23
|
+
{customer && <VerificationBanner customer={customer} />}
|
|
24
|
+
<div className="w-full bg-page-bg relative min-h-screen">
|
|
25
|
+
<div className="relative" data-testid="checkout-container">{children}</div>
|
|
26
|
+
</div>
|
|
27
|
+
<Footer />
|
|
28
|
+
</ModalProvider>
|
|
29
|
+
</WishlistProvider>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import InteractiveLink from "@modules/common/components/interactive-link"
|
|
2
|
+
import { Metadata } from "next"
|
|
3
|
+
|
|
4
|
+
export const metadata: Metadata = {
|
|
5
|
+
title: "404",
|
|
6
|
+
description: "Something went wrong",
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default async function NotFound() {
|
|
10
|
+
return (
|
|
11
|
+
<div className="flex flex-col gap-4 items-center justify-center min-h-[calc(100vh-64px)]">
|
|
12
|
+
<h1 className="text-2xl-semi text-ui-fg-base">Page not found</h1>
|
|
13
|
+
<p className="text-small-regular text-ui-fg-base">
|
|
14
|
+
The page you tried to access does not exist.
|
|
15
|
+
</p>
|
|
16
|
+
<InteractiveLink href="/">Go to frontpage</InteractiveLink>
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/addresses/page.tsx
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
import { notFound } from "next/navigation"
|
|
3
|
+
|
|
4
|
+
import AddressBook from "@modules/account/components/address-book"
|
|
5
|
+
|
|
6
|
+
import { getRegion } from "@core/data/regions"
|
|
7
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
title: "Addresses",
|
|
11
|
+
description: "View your addresses",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default async function Addresses(props: {
|
|
15
|
+
params: Promise<{ countryCode: string }>
|
|
16
|
+
}) {
|
|
17
|
+
const params = await props.params
|
|
18
|
+
const { countryCode } = params
|
|
19
|
+
const customer = await retrieveCustomer()
|
|
20
|
+
const region = await getRegion(countryCode)
|
|
21
|
+
|
|
22
|
+
if (!customer || !region) {
|
|
23
|
+
notFound()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="w-full" data-testid="addresses-page-wrapper">
|
|
28
|
+
<AddressBook customer={customer} region={region} />
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { loadOrderData } from "@controllers/order/load-order-data"
|
|
2
|
+
import { OrderDetailsController } from "@controllers/order/order-details-controller"
|
|
3
|
+
import { Metadata } from "next"
|
|
4
|
+
import { notFound } from "next/navigation"
|
|
5
|
+
|
|
6
|
+
export const dynamic = "force-dynamic"
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
params: Promise<{ id: string }>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function generateMetadata(props: Props): Promise<Metadata> {
|
|
13
|
+
const params = await props.params
|
|
14
|
+
const order = await loadOrderData(params.id)
|
|
15
|
+
|
|
16
|
+
if (!order) {
|
|
17
|
+
notFound()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
title: `Order #${order.display_id}`,
|
|
22
|
+
description: `View your order`,
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default async function OrderDetailPage(props: Props) {
|
|
27
|
+
const params = await props.params
|
|
28
|
+
const order = await loadOrderData(params.id)
|
|
29
|
+
|
|
30
|
+
if (!order) {
|
|
31
|
+
notFound()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return <OrderDetailsController order={order} />
|
|
35
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import { Metadata } from "next"
|
|
3
|
+
import { notFound } from "next/navigation"
|
|
4
|
+
import { retrieveOrder } from "@core/data/orders"
|
|
5
|
+
import { sdk } from "@core/config"
|
|
6
|
+
import ExchangeRequestTemplate from "@modules/account/templates/exchange-request-template"
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
params: Promise<{ id: string; countryCode: string }>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function generateMetadata(props: Props): Promise<Metadata> {
|
|
13
|
+
const params = await props.params
|
|
14
|
+
return {
|
|
15
|
+
title: `Exchange Order #${params.id}`,
|
|
16
|
+
description: "Request an exchange for your order.",
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default async function ExchangePage(props: Props) {
|
|
21
|
+
const params = await props.params
|
|
22
|
+
|
|
23
|
+
const order = await retrieveOrder(params.id).catch(() => null)
|
|
24
|
+
|
|
25
|
+
if (!order) {
|
|
26
|
+
return notFound()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Fetch return reasons
|
|
30
|
+
const { return_reasons } = await sdk.client.fetch<any>(
|
|
31
|
+
"/store/return-reasons",
|
|
32
|
+
{
|
|
33
|
+
method: "GET",
|
|
34
|
+
query: { fields: "id,value,label" },
|
|
35
|
+
next: { tags: ["return_reasons"] },
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className="bg-gray-50 min-h-screen">
|
|
41
|
+
<ExchangeRequestTemplate
|
|
42
|
+
order={order as any}
|
|
43
|
+
returnReasons={return_reasons || []}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
import OrderOverview from "@modules/account/components/order-overview"
|
|
4
|
+
import { notFound } from "next/navigation"
|
|
5
|
+
import { listOrders } from "@core/data/orders"
|
|
6
|
+
import Divider from "@modules/common/components/divider"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
title: "Orders",
|
|
11
|
+
description: "Overview of your previous orders.",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default async function Orders() {
|
|
15
|
+
const orders = await listOrders()
|
|
16
|
+
|
|
17
|
+
if (!orders) {
|
|
18
|
+
notFound()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="w-full" data-testid="orders-page-wrapper">
|
|
23
|
+
<div>
|
|
24
|
+
<OrderOverview orders={orders} />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
import { Metadata } from "next"
|
|
3
|
+
import { notFound } from "next/navigation"
|
|
4
|
+
|
|
5
|
+
import { retrieveOrder } from "@core/data/orders"
|
|
6
|
+
import { listReturnReasons, listReturnShippingOptions } from "@core/data/returns"
|
|
7
|
+
import ReturnRequestTemplate from "@modules/account/templates/return-request-template"
|
|
8
|
+
import { hasReturnableItems } from "@core/util/returns"
|
|
9
|
+
|
|
10
|
+
export const metadata: Metadata = {
|
|
11
|
+
title: "Request Return",
|
|
12
|
+
description: "Request a return for your order",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type Props = {
|
|
16
|
+
params: Promise<{ id: string }>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default async function ReturnRequestPage(props: Props) {
|
|
20
|
+
const params = await props.params;
|
|
21
|
+
|
|
22
|
+
const order = await retrieveOrder(params.id).catch(() => null)
|
|
23
|
+
|
|
24
|
+
if (!order) {
|
|
25
|
+
notFound()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check eligibility logic mentioned in doc
|
|
29
|
+
if (!hasReturnableItems(order)) {
|
|
30
|
+
// Or render a "Not eligible" message component
|
|
31
|
+
return (
|
|
32
|
+
<div className="max-w-4xl mx-auto py-16 px-4 text-center">
|
|
33
|
+
<h1 className="text-2xl font-bold mb-4">Return Not Available</h1>
|
|
34
|
+
<p className="text-gray-600 mb-8">This order matches no returnable items. Items might be past the return window or already returned.</p>
|
|
35
|
+
<a href="/account/orders" className="text-blue-600 hover:underline">Back to Orders</a>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Get cart ID for shipping options
|
|
41
|
+
const cartId = (order as any).cart_id
|
|
42
|
+
|
|
43
|
+
if (!cartId) {
|
|
44
|
+
// Doc says: "No Cart ID: Returns 404 page"
|
|
45
|
+
// But strictly following safe implementation is better, but obeying doc:
|
|
46
|
+
// "Returns 404 page (cart required for shipping options)"
|
|
47
|
+
// I'll stick to a softer error or fallback if possible, but let's conform.
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Extract product IDs for context
|
|
51
|
+
const productIds = order.items?.map((item: any) => item.product_id).filter(Boolean) as string[]
|
|
52
|
+
|
|
53
|
+
// Fetch return shipping options and return reasons
|
|
54
|
+
const [shippingOptions, returnReasons] = await Promise.all([
|
|
55
|
+
listReturnShippingOptions(cartId || "", (order as any).region_id, productIds),
|
|
56
|
+
listReturnReasons(),
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<ReturnRequestTemplate
|
|
61
|
+
order={order}
|
|
62
|
+
shippingOptions={shippingOptions}
|
|
63
|
+
returnReasons={returnReasons}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
import Overview from "@modules/account/components/overview"
|
|
4
|
+
import { notFound } from "next/navigation"
|
|
5
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
6
|
+
import { listOrders } from "@core/data/orders"
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "Account",
|
|
10
|
+
description: "Overview of your account activity.",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default async function OverviewTemplate() {
|
|
14
|
+
const customer = await retrieveCustomer().catch(() => null)
|
|
15
|
+
const orders = (await listOrders().catch(() => null)) || null
|
|
16
|
+
|
|
17
|
+
if (!customer) {
|
|
18
|
+
notFound()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <Overview customer={customer} orders={orders} />
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
import { notFound } from "next/navigation"
|
|
3
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
4
|
+
import PaymentMethodsTemplate from "@modules/account/templates/payment-methods-template"
|
|
5
|
+
|
|
6
|
+
export const metadata: Metadata = {
|
|
7
|
+
title: "Payment Methods",
|
|
8
|
+
description: "Manage your saved payment methods for refunds",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default async function PaymentMethods() {
|
|
12
|
+
const customer = await retrieveCustomer()
|
|
13
|
+
|
|
14
|
+
if (!customer) {
|
|
15
|
+
notFound()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="w-full" data-testid="payment-methods-page-wrapper">
|
|
20
|
+
<PaymentMethodsTemplate customer={customer} />
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
import ProfileForm from "@modules/account/components/profile-form"
|
|
4
|
+
import ProfilePhone from "@modules/account//components/profile-phone"
|
|
5
|
+
import ProfileBillingAddress from "@modules/account/components/profile-billing-address"
|
|
6
|
+
import ProfileEmail from "@modules/account/components/profile-email"
|
|
7
|
+
import ProfileName from "@modules/account/components/profile-name"
|
|
8
|
+
import ProfilePassword from "@modules/account/components/profile-password"
|
|
9
|
+
|
|
10
|
+
import { notFound } from "next/navigation"
|
|
11
|
+
import { listRegions } from "@core/data/regions"
|
|
12
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
13
|
+
|
|
14
|
+
export const metadata: Metadata = {
|
|
15
|
+
title: "Profile",
|
|
16
|
+
description: "View and edit your Chocomelon profile.",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default async function Profile() {
|
|
21
|
+
const customer = await retrieveCustomer()
|
|
22
|
+
const regions = await listRegions()
|
|
23
|
+
|
|
24
|
+
if (!customer || !regions) {
|
|
25
|
+
notFound()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="w-full" data-testid="profile-page-wrapper">
|
|
30
|
+
<div className="mb-8 flex flex-col gap-y-4">
|
|
31
|
+
<h1 className="text-xl font-bold text-gray-900">Account Details</h1>
|
|
32
|
+
</div>
|
|
33
|
+
<div className="flex flex-col gap-y-8 w-full">
|
|
34
|
+
<ProfileForm customer={customer} />
|
|
35
|
+
|
|
36
|
+
{/* Preserving Billing Address as it's a required field in the system, though visually separated */}
|
|
37
|
+
<div className="border-t border-gray-100 pt-4 mt-2">
|
|
38
|
+
<ProfileBillingAddress customer={customer} regions={regions} />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { loadAccountData } from "@controllers/account/load-account-data"
|
|
2
|
+
import { LoginPage } from "@controllers/account/login-page"
|
|
3
|
+
|
|
4
|
+
export default async function DefaultLogin(props: {
|
|
5
|
+
params: Promise<{ countryCode: string }>
|
|
6
|
+
}) {
|
|
7
|
+
const { countryCode } = await props.params
|
|
8
|
+
const data = await loadAccountData(countryCode)
|
|
9
|
+
|
|
10
|
+
return <LoginPage data={data} />
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
import { loadAccountData } from "@controllers/account/load-account-data"
|
|
4
|
+
import { LoginPage } from "@controllers/account/login-page"
|
|
5
|
+
|
|
6
|
+
export const metadata: Metadata = {
|
|
7
|
+
title: "Sign in",
|
|
8
|
+
description: "Sign in to your Chocomelon account.",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default async function Login(props: {
|
|
12
|
+
params: Promise<{ countryCode: string }>
|
|
13
|
+
}) {
|
|
14
|
+
const { countryCode } = await props.params
|
|
15
|
+
const data = await loadAccountData(countryCode)
|
|
16
|
+
|
|
17
|
+
return <LoginPage data={data} />
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
export const metadata: Metadata = {
|
|
4
|
+
title: "Guest Orders",
|
|
5
|
+
description: "View your guest orders.",
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
import { listGuestOrders } from "@core/data/guest"
|
|
9
|
+
import GuestOrdersTemplate from "@modules/account/templates/guest-orders-template"
|
|
10
|
+
|
|
11
|
+
export default function GuestOrdersPage() {
|
|
12
|
+
return <GuestOrdersTemplate />
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { retrieveCustomer } from "@core/data/customer"
|
|
2
|
+
import { Toaster } from "@medusajs/ui"
|
|
3
|
+
import AccountLayout from "@modules/account/templates/account-layout"
|
|
4
|
+
|
|
5
|
+
export default async function AccountPageLayout({
|
|
6
|
+
dashboard,
|
|
7
|
+
login,
|
|
8
|
+
}: {
|
|
9
|
+
dashboard?: React.ReactNode
|
|
10
|
+
login?: React.ReactNode
|
|
11
|
+
}) {
|
|
12
|
+
const customer = await retrieveCustomer().catch(() => null)
|
|
13
|
+
|
|
14
|
+
const isPendingDeletion = customer?.id === "pending_deletion"
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<AccountLayout customer={isPendingDeletion ? null : customer}>
|
|
18
|
+
{customer && !isPendingDeletion ? dashboard : login}
|
|
19
|
+
<Toaster />
|
|
20
|
+
</AccountLayout>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
import InteractiveLink from "@modules/common/components/interactive-link"
|
|
4
|
+
|
|
5
|
+
export const metadata: Metadata = {
|
|
6
|
+
title: "404",
|
|
7
|
+
description: "Something went wrong",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function NotFound() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex flex-col items-center justify-center min-h-[calc(100vh-64px)]">
|
|
13
|
+
<h1 className="text-2xl-semi text-ui-fg-base">Page not found</h1>
|
|
14
|
+
<p className="text-small-regular text-ui-fg-base">
|
|
15
|
+
The cart you tried to access does not exist. Clear your cookies and try
|
|
16
|
+
again.
|
|
17
|
+
</p>
|
|
18
|
+
<InteractiveLink href="/">Go to frontpage</InteractiveLink>
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
import { notFound } from "next/navigation"
|
|
3
|
+
|
|
4
|
+
import { loadCartData } from "@controllers/cart/load-cart-data"
|
|
5
|
+
import { CartPage } from "@controllers/cart/cart-page"
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
params: Promise<{ countryCode: string }>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const metadata: Metadata = {
|
|
12
|
+
title: "Bag",
|
|
13
|
+
description: "View your bag",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default async function Cart(props: Props) {
|
|
17
|
+
const params = await props.params
|
|
18
|
+
const { countryCode } = params
|
|
19
|
+
|
|
20
|
+
const data = await loadCartData(countryCode).catch(() => notFound())
|
|
21
|
+
|
|
22
|
+
return <CartPage data={data} />
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getCategoryByHandle } from "@core/data/categories"
|
|
2
|
+
import { redirect } from "next/navigation"
|
|
3
|
+
|
|
4
|
+
export default async function CategoryPage(props: any) {
|
|
5
|
+
const params = await props.params
|
|
6
|
+
const category = await getCategoryByHandle(params.category)
|
|
7
|
+
if (category) {
|
|
8
|
+
redirect(`/${params.countryCode}/store?category=${category.id}`)
|
|
9
|
+
}
|
|
10
|
+
redirect(`/${params.countryCode}/store`)
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getCollectionByHandle } from "@core/data/collections"
|
|
2
|
+
import { redirect } from "next/navigation"
|
|
3
|
+
|
|
4
|
+
export default async function CollectionPage(props: any) {
|
|
5
|
+
const params = await props.params
|
|
6
|
+
const collection = await getCollectionByHandle(params.handle)
|
|
7
|
+
if (collection) {
|
|
8
|
+
redirect(`/${params.countryCode}/store?collection=${collection.id}`)
|
|
9
|
+
}
|
|
10
|
+
redirect(`/${params.countryCode}/store`)
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
import ContactTemplate from "@modules/contact/templates"
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
params: Promise<{ countryCode: string }>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "Contact Us",
|
|
10
|
+
description: "Get in touch with us",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default async function ContactPage(props: Props) {
|
|
14
|
+
const params = await props.params
|
|
15
|
+
const countryCode = params.countryCode
|
|
16
|
+
|
|
17
|
+
const { getContactInfoFromConfig } = await import("@core/data/dynamic-config")
|
|
18
|
+
const contactInfo = await getContactInfoFromConfig()
|
|
19
|
+
|
|
20
|
+
return <ContactTemplate countryCode={countryCode} contactInfo={contactInfo as any} />
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
export const metadata: Metadata = {
|
|
4
|
+
title: "Guest Orders",
|
|
5
|
+
description: "View your guest orders.",
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
import GuestOrdersTemplate from "@modules/account/templates/guest-orders-template"
|
|
9
|
+
|
|
10
|
+
export default function GuestOrdersPage() {
|
|
11
|
+
return <GuestOrdersTemplate />
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
import HelpTemplate from "@modules/help/templates"
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
params: Promise<{ countryCode: string }>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "Help & FAQs",
|
|
10
|
+
description: "Get answers to your questions and contact our support team",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default async function HelpPage(props: Props) {
|
|
14
|
+
const params = await props.params
|
|
15
|
+
const countryCode = params.countryCode
|
|
16
|
+
|
|
17
|
+
const { getContactInfoFromConfig, getFaqsFromConfig } = await import("@core/data/dynamic-config")
|
|
18
|
+
let contactInfo = null
|
|
19
|
+
let dynamicFaqs = null
|
|
20
|
+
try {
|
|
21
|
+
contactInfo = await getContactInfoFromConfig()
|
|
22
|
+
dynamicFaqs = await getFaqsFromConfig()
|
|
23
|
+
} catch (e) {
|
|
24
|
+
// fallback
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return <HelpTemplate countryCode={countryCode} contactInfo={contactInfo as any} dynamicFaqs={dynamicFaqs} />
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Metadata } from "next"
|
|
2
|
+
|
|
3
|
+
import { getBaseURL } from "@core/util/env"
|
|
4
|
+
import { loadLayoutData } from "@controllers/layout/load-layout-data"
|
|
5
|
+
import { MainLayout } from "@controllers/layout/main-layout"
|
|
6
|
+
|
|
7
|
+
export const metadata: Metadata = {
|
|
8
|
+
metadataBase: new URL(getBaseURL()),
|
|
9
|
+
icons: {
|
|
10
|
+
icon: "/favicon.png",
|
|
11
|
+
apple: "/favicon.png",
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default async function PageLayout(props: {
|
|
16
|
+
children: React.ReactNode
|
|
17
|
+
}) {
|
|
18
|
+
const layoutData = await loadLayoutData()
|
|
19
|
+
|
|
20
|
+
return <MainLayout data={layoutData}>{props.children}</MainLayout>
|
|
21
|
+
}
|