@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,217 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { useState } from "react"
|
|
4
|
+
import { usePathname } from "next/navigation"
|
|
5
|
+
import { HttpTypes } from "@medusajs/types"
|
|
6
|
+
import { sendCustomerOTP, verifyCustomerOTP } from "@core/data/customer-registration"
|
|
7
|
+
import { updateCustomer } from "@core/data/customer"
|
|
8
|
+
import { XMark } from "@medusajs/icons"
|
|
9
|
+
|
|
10
|
+
interface VerificationBannerProps {
|
|
11
|
+
customer: HttpTypes.StoreCustomer
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const VerificationBanner: React.FC<VerificationBannerProps> = ({ customer }) => {
|
|
15
|
+
const pathname = usePathname()
|
|
16
|
+
const [isVisible, setIsVisible] = useState(true)
|
|
17
|
+
const [isVerifying, setIsVerifying] = useState(false)
|
|
18
|
+
const [otpToken, setOtpToken] = useState<string | null>(null)
|
|
19
|
+
const [otpCode, setOtpCode] = useState("")
|
|
20
|
+
const [otpError, setOtpError] = useState<string | null>(null)
|
|
21
|
+
const [isSendingOtp, setIsSendingOtp] = useState(false)
|
|
22
|
+
const [isSubmittingOtp, setIsSubmittingOtp] = useState(false)
|
|
23
|
+
const [isSuccess, setIsSuccess] = useState(false)
|
|
24
|
+
|
|
25
|
+
// Logic to hide on specific pages
|
|
26
|
+
const countryCode = pathname.split('/')[1]
|
|
27
|
+
const isHomePage = pathname === `/${countryCode}` || pathname === `/${countryCode}/` || pathname === "/"
|
|
28
|
+
const isProductListing = pathname.includes(`/${countryCode}/store`) || pathname.includes(`/${countryCode}/collections`) || pathname.includes(`/${countryCode}/categories`)
|
|
29
|
+
const isProductDetails = pathname.includes(`/${countryCode}/products`)
|
|
30
|
+
|
|
31
|
+
// Check if verified
|
|
32
|
+
const isVerified =
|
|
33
|
+
(customer as any).email_verified === true ||
|
|
34
|
+
(customer as any).email_verified === "true" ||
|
|
35
|
+
customer.metadata?.email_verified === true ||
|
|
36
|
+
customer.metadata?.email_verified === "true"
|
|
37
|
+
|
|
38
|
+
if (!isVisible || (isVerified && !isSuccess) || isHomePage || isProductListing || isProductDetails) return null
|
|
39
|
+
|
|
40
|
+
const handleSendOtp = async () => {
|
|
41
|
+
setIsSendingOtp(true)
|
|
42
|
+
setOtpError(null)
|
|
43
|
+
try {
|
|
44
|
+
const res = await sendCustomerOTP(customer.id, "email_verification")
|
|
45
|
+
if (res.success) {
|
|
46
|
+
setOtpToken(res.token)
|
|
47
|
+
setIsVerifying(true)
|
|
48
|
+
} else {
|
|
49
|
+
setOtpError(res.error || "Failed to send OTP")
|
|
50
|
+
}
|
|
51
|
+
} catch (err: any) {
|
|
52
|
+
setOtpError(err.message || "An error occurred")
|
|
53
|
+
} finally {
|
|
54
|
+
setIsSendingOtp(false)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const handleVerifyOtp = async () => {
|
|
59
|
+
if (!otpToken || !otpCode) return
|
|
60
|
+
|
|
61
|
+
setIsSubmittingOtp(true)
|
|
62
|
+
setOtpError(null)
|
|
63
|
+
try {
|
|
64
|
+
const res = await verifyCustomerOTP(otpToken, otpCode)
|
|
65
|
+
if (res.success) {
|
|
66
|
+
setIsSuccess(true)
|
|
67
|
+
setIsVerifying(false)
|
|
68
|
+
|
|
69
|
+
// Persist verification status in metadata
|
|
70
|
+
const newMetadata = {
|
|
71
|
+
...(customer.metadata as Record<string, any> || {}),
|
|
72
|
+
email_verified: true
|
|
73
|
+
}
|
|
74
|
+
await updateCustomer({ metadata: newMetadata })
|
|
75
|
+
|
|
76
|
+
// Hide banner after success
|
|
77
|
+
setTimeout(() => setIsVisible(false), 3000)
|
|
78
|
+
} else {
|
|
79
|
+
setOtpError(res.error || "Invalid OTP")
|
|
80
|
+
}
|
|
81
|
+
} catch (err: any) {
|
|
82
|
+
setOtpError(err.message || "An error occurred")
|
|
83
|
+
} finally {
|
|
84
|
+
setIsSubmittingOtp(false)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<>
|
|
90
|
+
{/* Banner */}
|
|
91
|
+
<div className="bg-[#FFF9F2] border-b border-amber-100/50 py-2 px-4 sticky top-0 z-[40]">
|
|
92
|
+
<div className="max-w-[1440px] mx-auto flex items-center justify-center gap-4 relative">
|
|
93
|
+
<div className="flex items-center gap-3">
|
|
94
|
+
<div className="flex w-6 h-6 bg-amber-100 rounded-full items-center justify-center text-amber-600 flex-shrink-0">
|
|
95
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></svg>
|
|
96
|
+
</div>
|
|
97
|
+
<p className="text-[13px] sm:text-[14px] font-medium text-amber-900/80 tracking-tight text-center">
|
|
98
|
+
Verify your email to enjoy shopping at Chocomelon. <span className="font-bold text-amber-900">{customer.email}</span>
|
|
99
|
+
<button
|
|
100
|
+
onClick={handleSendOtp}
|
|
101
|
+
disabled={isSendingOtp}
|
|
102
|
+
className="ml-4 text-amber-700 hover:text-amber-900 font-bold disabled:opacity-50 inline-flex items-center gap-1 border-b border-amber-200 hover:border-amber-900"
|
|
103
|
+
>
|
|
104
|
+
{isSendingOtp ? "..." : "Verify Now"}
|
|
105
|
+
</button>
|
|
106
|
+
</p>
|
|
107
|
+
</div>
|
|
108
|
+
<button
|
|
109
|
+
onClick={() => setIsVisible(false)}
|
|
110
|
+
className="absolute right-0 text-amber-300 hover:text-amber-600 p-1"
|
|
111
|
+
>
|
|
112
|
+
<XMark size={18} />
|
|
113
|
+
</button>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
{/* OTP Modal */}
|
|
118
|
+
{isVerifying && (
|
|
119
|
+
<div className="fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-[2px] p-4">
|
|
120
|
+
<div className="bg-white rounded-2xl shadow-2xl w-full max-w-sm overflow-hidden border border-gray-100">
|
|
121
|
+
<div className="bg-white p-6 text-center relative border-b border-gray-50">
|
|
122
|
+
<button
|
|
123
|
+
onClick={() => setIsVerifying(false)}
|
|
124
|
+
className="absolute right-3 top-3 p-1.5 bg-gray-50 rounded-full hover:bg-gray-100 text-gray-400"
|
|
125
|
+
>
|
|
126
|
+
<XMark size={16} />
|
|
127
|
+
</button>
|
|
128
|
+
<div className="w-14 h-14 rounded-full flex items-center justify-center mx-auto mb-3 border" style={{ backgroundColor: 'rgba(139, 90, 177, 0.1)', borderColor: 'rgba(139, 90, 177, 0.2)' }}>
|
|
129
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#8B5AB1" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></svg>
|
|
130
|
+
</div>
|
|
131
|
+
<h3 className="text-lg font-bold tracking-tight text-gray-900">Verify Email</h3>
|
|
132
|
+
<p className="text-gray-500 text-[11px] mt-1.5 leading-relaxed px-4">
|
|
133
|
+
We've sent a 6-digit code to <br/>
|
|
134
|
+
<span className="font-bold" style={{ color: '#8B5AB1' }}>{customer.email}</span>
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div className="p-6">
|
|
139
|
+
<div className="space-y-6 text-center">
|
|
140
|
+
<div>
|
|
141
|
+
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-[0.2em] mb-3">Verification Code</label>
|
|
142
|
+
<input
|
|
143
|
+
type="text"
|
|
144
|
+
maxLength={6}
|
|
145
|
+
value={otpCode}
|
|
146
|
+
onChange={(e) => setOtpCode(e.target.value.replace(/\D/g, ""))}
|
|
147
|
+
className="w-full text-center text-3xl font-black tracking-[0.3em] py-3 border-b-2 border-gray-100 focus:border-purple-500 focus:outline-none placeholder:text-gray-100 bg-transparent"
|
|
148
|
+
placeholder="000000"
|
|
149
|
+
autoFocus
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
{otpError && (
|
|
154
|
+
<div className="text-red-500 text-[11px] font-bold flex items-center justify-center gap-1.5">
|
|
155
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>
|
|
156
|
+
{otpError}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
<div className="flex flex-col gap-3">
|
|
161
|
+
<button
|
|
162
|
+
type="button"
|
|
163
|
+
onClick={handleVerifyOtp}
|
|
164
|
+
disabled={isSubmittingOtp || otpCode.length < 6}
|
|
165
|
+
className="w-full py-3 text-white rounded-xl font-bold text-sm flex items-center justify-center"
|
|
166
|
+
style={{ backgroundColor: '#8B5AB1' }}
|
|
167
|
+
>
|
|
168
|
+
{isSubmittingOtp ? "Verifying..." : "Verify & Continue"}
|
|
169
|
+
</button>
|
|
170
|
+
<button
|
|
171
|
+
type="button"
|
|
172
|
+
onClick={handleSendOtp}
|
|
173
|
+
className="text-[11px] font-bold uppercase tracking-wider"
|
|
174
|
+
style={{ color: '#8B5AB1' }}
|
|
175
|
+
>
|
|
176
|
+
Resend Code
|
|
177
|
+
</button>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
)}
|
|
184
|
+
|
|
185
|
+
{/* Success Notification - Premium Static Modal */}
|
|
186
|
+
{isSuccess && (
|
|
187
|
+
<div className="fixed inset-0 z-[10001] flex items-center justify-center p-4">
|
|
188
|
+
{/* Plain Overlay */}
|
|
189
|
+
<div className="absolute inset-0 bg-gray-900/40" />
|
|
190
|
+
|
|
191
|
+
{/* High-End Card */}
|
|
192
|
+
<div className="relative bg-white p-10 rounded-[40px] flex flex-col items-center text-center max-w-sm w-full border-4 border-gray-50 shadow-sm">
|
|
193
|
+
<div className="w-40 h-40 flex items-center justify-center mb-4">
|
|
194
|
+
<img
|
|
195
|
+
src="/uploads/profile-images/t-shirt.gif"
|
|
196
|
+
alt="Success"
|
|
197
|
+
className="w-36 h-36 object-contain"
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div className="space-y-1">
|
|
202
|
+
<h3 className="text-2xl font-black text-gray-900 tracking-tighter uppercase leading-none mb-2">Email Verified</h3>
|
|
203
|
+
<div className="h-1 w-10 bg-[#8B5AB1] mx-auto rounded-full mb-4" />
|
|
204
|
+
<p className="text-gray-400 text-[10px] font-bold uppercase tracking-widest mb-3">Welcome to the family</p>
|
|
205
|
+
<p className="text-gray-600 text-[13px] font-medium leading-relaxed px-2">
|
|
206
|
+
Your email is successfully verified.<br/>
|
|
207
|
+
Now you can enjoy shopping at <span className="text-gray-900 font-bold">Chocomelon</span>.
|
|
208
|
+
</p>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
)}
|
|
213
|
+
</>
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export default VerificationBanner
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useWishlist } from "@core/context/wishlist-context"
|
|
4
|
+
|
|
5
|
+
const WishlistCounter = () => {
|
|
6
|
+
const { count } = useWishlist()
|
|
7
|
+
|
|
8
|
+
if (count === 0) return null
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div className="absolute -top-1.5 -right-1.5 h-3.5 w-3.5 sm:h-4 sm:w-4 flex items-center justify-center bg-[#8B5AB1] text-white text-[8px] sm:text-[10px] rounded-full font-bold shadow-sm">
|
|
12
|
+
{count}
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default WishlistCounter
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { loadLayoutData } from "@controllers/layout/load-layout-data"
|
|
2
|
+
import Nav from "@theme/slots/layout/Nav"
|
|
3
|
+
|
|
4
|
+
export default async function NavWithData() {
|
|
5
|
+
const { nav, promoBar } = await loadLayoutData()
|
|
6
|
+
const PromoBar = (await import("@theme/slots/layout/PromoBar")).default
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<PromoBar {...promoBar} />
|
|
11
|
+
<Nav {...nav} />
|
|
12
|
+
</>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { XMark } from "@medusajs/icons"
|
|
4
|
+
import { HttpTypes } from "@medusajs/types"
|
|
5
|
+
import { Button, Heading, Select, Text, clx } from "@medusajs/ui"
|
|
6
|
+
import { listReturnReasons } from "@core/data/returns"
|
|
7
|
+
import React from "react"
|
|
8
|
+
|
|
9
|
+
type CancelOrderModalProps = {
|
|
10
|
+
isOpen: boolean
|
|
11
|
+
isSubmitting: boolean
|
|
12
|
+
onClose: () => void
|
|
13
|
+
onConfirm: (reasonId: string) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CancelOrderModal = ({
|
|
17
|
+
isOpen,
|
|
18
|
+
isSubmitting,
|
|
19
|
+
onClose,
|
|
20
|
+
onConfirm,
|
|
21
|
+
}: CancelOrderModalProps) => {
|
|
22
|
+
const [reasons, setReasons] = React.useState<HttpTypes.StoreReturnReason[]>([])
|
|
23
|
+
const [selectedReasonId, setSelectedReasonId] = React.useState("")
|
|
24
|
+
const [isFetchingReasons, setIsFetchingReasons] = React.useState(false)
|
|
25
|
+
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
if (!isOpen) {
|
|
28
|
+
setSelectedReasonId("")
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let isMounted = true
|
|
33
|
+
|
|
34
|
+
const fetchReasons = async () => {
|
|
35
|
+
setIsFetchingReasons(true)
|
|
36
|
+
const res = await listReturnReasons()
|
|
37
|
+
if (isMounted) {
|
|
38
|
+
setReasons(res)
|
|
39
|
+
setIsFetchingReasons(false)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fetchReasons()
|
|
44
|
+
|
|
45
|
+
return () => {
|
|
46
|
+
isMounted = false
|
|
47
|
+
}
|
|
48
|
+
}, [isOpen])
|
|
49
|
+
|
|
50
|
+
const handleClose = () => {
|
|
51
|
+
setSelectedReasonId("")
|
|
52
|
+
onClose()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const handleConfirm = () => {
|
|
56
|
+
if (!selectedReasonId) {
|
|
57
|
+
alert("Please select a reason for cancellation")
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
onConfirm(selectedReasonId)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!isOpen) {
|
|
65
|
+
return null
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div className="fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm">
|
|
70
|
+
<div
|
|
71
|
+
className="w-full max-w-md p-6 sm:p-8 bg-white rounded-3xl shadow-2xl"
|
|
72
|
+
role="dialog"
|
|
73
|
+
aria-modal="true"
|
|
74
|
+
aria-labelledby="cancel-order-title"
|
|
75
|
+
>
|
|
76
|
+
<div className="flex flex-col gap-y-6">
|
|
77
|
+
<div className="flex items-center justify-between">
|
|
78
|
+
<Heading id="cancel-order-title" level="h2" className="text-xl font-bold text-gray-900">
|
|
79
|
+
Cancel Order
|
|
80
|
+
</Heading>
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
onClick={handleClose}
|
|
84
|
+
className="p-2 hover:bg-gray-100 rounded-full transition-colors"
|
|
85
|
+
aria-label="Close cancel order dialog"
|
|
86
|
+
>
|
|
87
|
+
<XMark className="w-5 h-5 text-gray-400" />
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div className="space-y-4">
|
|
92
|
+
<Text className="text-sm text-gray-500 leading-relaxed">
|
|
93
|
+
We're sorry to see you go! Please let us know why you're cancelling this order so we can improve our service.
|
|
94
|
+
</Text>
|
|
95
|
+
|
|
96
|
+
<div className="space-y-2">
|
|
97
|
+
<label
|
|
98
|
+
htmlFor="cancel-reason-select"
|
|
99
|
+
className="text-[10px] font-bold text-gray-400 uppercase tracking-widest ml-1"
|
|
100
|
+
>
|
|
101
|
+
Reason for Cancellation
|
|
102
|
+
</label>
|
|
103
|
+
<Select
|
|
104
|
+
value={selectedReasonId || undefined}
|
|
105
|
+
onValueChange={setSelectedReasonId}
|
|
106
|
+
>
|
|
107
|
+
<Select.Trigger
|
|
108
|
+
id="cancel-reason-select"
|
|
109
|
+
className={clx(
|
|
110
|
+
"w-full rounded-2xl h-12 border transition-colors text-sm font-medium",
|
|
111
|
+
selectedReasonId
|
|
112
|
+
? "bg-purple-50/50 text-[#8B5AB1] border-[#8B5AB1]/20"
|
|
113
|
+
: "bg-gray-50/50 text-gray-500 border-gray-200"
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
<Select.Value placeholder="Select a reason" />
|
|
117
|
+
</Select.Trigger>
|
|
118
|
+
<Select.Content
|
|
119
|
+
position="popper"
|
|
120
|
+
sideOffset={8}
|
|
121
|
+
collisionPadding={16}
|
|
122
|
+
className="z-[10001] rounded-2xl border border-gray-100 bg-white shadow-xl p-1.5 min-w-[var(--radix-select-trigger-width)]"
|
|
123
|
+
>
|
|
124
|
+
{reasons.map((reason) => (
|
|
125
|
+
<Select.Item
|
|
126
|
+
key={reason.id}
|
|
127
|
+
value={reason.id}
|
|
128
|
+
className="text-sm font-medium rounded-xl px-3 py-2.5 cursor-pointer"
|
|
129
|
+
>
|
|
130
|
+
{reason.label}
|
|
131
|
+
</Select.Item>
|
|
132
|
+
))}
|
|
133
|
+
{reasons.length === 0 && !isFetchingReasons && (
|
|
134
|
+
<Select.Item value="other" className="text-sm font-medium rounded-xl px-3 py-2.5">
|
|
135
|
+
Other / Not Specified
|
|
136
|
+
</Select.Item>
|
|
137
|
+
)}
|
|
138
|
+
</Select.Content>
|
|
139
|
+
</Select>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div className="flex flex-col sm:flex-row gap-3 pt-2">
|
|
144
|
+
<Button
|
|
145
|
+
type="button"
|
|
146
|
+
variant="secondary"
|
|
147
|
+
onClick={handleClose}
|
|
148
|
+
className="flex-1 rounded-2xl h-12 font-bold border-gray-100"
|
|
149
|
+
>
|
|
150
|
+
Keep Order
|
|
151
|
+
</Button>
|
|
152
|
+
<Button
|
|
153
|
+
type="button"
|
|
154
|
+
onClick={handleConfirm}
|
|
155
|
+
isLoading={isSubmitting}
|
|
156
|
+
disabled={!selectedReasonId || isSubmitting}
|
|
157
|
+
className="flex-1 rounded-2xl h-12 font-bold bg-red-500 hover:bg-red-600 text-white border-none shadow-lg shadow-red-100 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
158
|
+
>
|
|
159
|
+
Cancel Order
|
|
160
|
+
</Button>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export default CancelOrderModal
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Heading } from "@medusajs/ui"
|
|
2
|
+
import LocalizedClientLink from "@modules/common/components/localized-client-link"
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
const Help = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="mt-6">
|
|
8
|
+
<Heading className="text-base-semi">Need help?</Heading>
|
|
9
|
+
<div className="text-base-regular my-2">
|
|
10
|
+
<ul className="gap-y-2 flex flex-col">
|
|
11
|
+
<li>
|
|
12
|
+
<LocalizedClientLink href="/contact">Contact</LocalizedClientLink>
|
|
13
|
+
</li>
|
|
14
|
+
<li>
|
|
15
|
+
<LocalizedClientLink href="/contact">
|
|
16
|
+
Returns & Exchanges
|
|
17
|
+
</LocalizedClientLink>
|
|
18
|
+
</li>
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default Help
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HttpTypes } from "@medusajs/types"
|
|
2
|
+
import { Table, Text } from "@medusajs/ui"
|
|
3
|
+
|
|
4
|
+
import LineItemOptions from "@modules/common/components/line-item-options"
|
|
5
|
+
import LineItemPrice from "@modules/common/components/line-item-price"
|
|
6
|
+
import LineItemUnitPrice from "@modules/common/components/line-item-unit-price"
|
|
7
|
+
import Thumbnail from "@modules/products/components/thumbnail"
|
|
8
|
+
|
|
9
|
+
type ItemProps = {
|
|
10
|
+
item: HttpTypes.StoreCartLineItem | HttpTypes.StoreOrderLineItem
|
|
11
|
+
currencyCode: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Item = ({ item, currencyCode }: ItemProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<Table.Row className="w-full" data-testid="product-row">
|
|
17
|
+
<Table.Cell className="!pl-0 p-4 w-24">
|
|
18
|
+
<div className="flex w-16">
|
|
19
|
+
<Thumbnail
|
|
20
|
+
thumbnail={item.thumbnail}
|
|
21
|
+
variantImages={item.variant?.images}
|
|
22
|
+
images={item.variant?.product?.images}
|
|
23
|
+
size="square"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</Table.Cell>
|
|
27
|
+
|
|
28
|
+
<Table.Cell className="text-left">
|
|
29
|
+
<Text
|
|
30
|
+
className="txt-medium-plus text-ui-fg-base"
|
|
31
|
+
data-testid="product-name"
|
|
32
|
+
>
|
|
33
|
+
{item.product_title}
|
|
34
|
+
</Text>
|
|
35
|
+
<LineItemOptions variant={item.variant} data-testid="product-variant" />
|
|
36
|
+
</Table.Cell>
|
|
37
|
+
|
|
38
|
+
<Table.Cell className="!pr-0">
|
|
39
|
+
<span className="!pr-0 flex flex-col items-end h-full justify-center">
|
|
40
|
+
<span className="flex gap-x-1 ">
|
|
41
|
+
<Text className="text-ui-fg-muted">
|
|
42
|
+
<span data-testid="product-quantity">{item.quantity}</span>x{" "}
|
|
43
|
+
</Text>
|
|
44
|
+
<LineItemUnitPrice
|
|
45
|
+
item={item}
|
|
46
|
+
style="tight"
|
|
47
|
+
currencyCode={currencyCode}
|
|
48
|
+
/>
|
|
49
|
+
</span>
|
|
50
|
+
|
|
51
|
+
<LineItemPrice
|
|
52
|
+
item={item}
|
|
53
|
+
style="tight"
|
|
54
|
+
currencyCode={currencyCode}
|
|
55
|
+
/>
|
|
56
|
+
</span>
|
|
57
|
+
</Table.Cell>
|
|
58
|
+
</Table.Row>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default Item
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import repeat from "@core/util/repeat"
|
|
2
|
+
import { HttpTypes } from "@medusajs/types"
|
|
3
|
+
import { Table } from "@medusajs/ui"
|
|
4
|
+
|
|
5
|
+
import Divider from "@modules/common/components/divider"
|
|
6
|
+
import Item from "@modules/order/components/item"
|
|
7
|
+
import SkeletonLineItem from "@modules/skeletons/components/skeleton-line-item"
|
|
8
|
+
|
|
9
|
+
type ItemsProps = {
|
|
10
|
+
order: HttpTypes.StoreOrder
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Items = ({ order }: ItemsProps) => {
|
|
14
|
+
const items = order.items
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="flex flex-col">
|
|
18
|
+
<Divider className="!mb-0" />
|
|
19
|
+
<Table>
|
|
20
|
+
<Table.Body data-testid="products-table">
|
|
21
|
+
{items?.length
|
|
22
|
+
? items
|
|
23
|
+
.sort((a, b) => {
|
|
24
|
+
return (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1
|
|
25
|
+
})
|
|
26
|
+
.map((item) => {
|
|
27
|
+
return (
|
|
28
|
+
<Item
|
|
29
|
+
key={item.id}
|
|
30
|
+
item={item}
|
|
31
|
+
currencyCode={order.currency_code}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
: repeat(5).map((i) => {
|
|
36
|
+
return <SkeletonLineItem key={i} />
|
|
37
|
+
})}
|
|
38
|
+
</Table.Body>
|
|
39
|
+
</Table>
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default Items
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { resetOnboardingState } from "@core/data/onboarding"
|
|
4
|
+
import { Button, Container, Text } from "@medusajs/ui"
|
|
5
|
+
|
|
6
|
+
const OnboardingCta = ({ orderId }: { orderId: string }) => {
|
|
7
|
+
return (
|
|
8
|
+
<Container className="max-w-4xl h-full bg-ui-bg-subtle w-full">
|
|
9
|
+
<div className="flex flex-col gap-y-4 center p-4 md:items-center">
|
|
10
|
+
<Text className="text-ui-fg-base text-xl">
|
|
11
|
+
Your test order was successfully created! 🎉
|
|
12
|
+
</Text>
|
|
13
|
+
<Text className="text-ui-fg-subtle text-small-regular">
|
|
14
|
+
You can now complete setting up your store in the admin.
|
|
15
|
+
</Text>
|
|
16
|
+
<Button
|
|
17
|
+
className="w-fit"
|
|
18
|
+
size="xlarge"
|
|
19
|
+
onClick={() => resetOnboardingState(orderId)}
|
|
20
|
+
>
|
|
21
|
+
Complete setup in admin
|
|
22
|
+
</Button>
|
|
23
|
+
</div>
|
|
24
|
+
</Container>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default OnboardingCta
|
package/templates/storefront/src/modules/order/components/order-confirmation-back-handler/index.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useEffect } from "react"
|
|
4
|
+
import { useParams, useRouter } from "next/navigation"
|
|
5
|
+
|
|
6
|
+
export default function OrderConfirmationBackHandler() {
|
|
7
|
+
const router = useRouter()
|
|
8
|
+
const params = useParams()
|
|
9
|
+
const countryCode = params?.countryCode || "in"
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const handlePopState = (event: PopStateEvent) => {
|
|
13
|
+
// Redirect to localized store
|
|
14
|
+
router.push(`/${countryCode}/store`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Push an dummy state
|
|
18
|
+
window.history.pushState(null, "", window.location.href)
|
|
19
|
+
|
|
20
|
+
window.addEventListener("popstate", handlePopState)
|
|
21
|
+
|
|
22
|
+
return () => {
|
|
23
|
+
window.removeEventListener("popstate", handlePopState)
|
|
24
|
+
}
|
|
25
|
+
}, [router, countryCode])
|
|
26
|
+
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { HttpTypes } from "@medusajs/types"
|
|
2
|
+
import { Text } from "@medusajs/ui"
|
|
3
|
+
|
|
4
|
+
type OrderDetailsProps = {
|
|
5
|
+
order: HttpTypes.StoreOrder
|
|
6
|
+
showStatus?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const OrderDetails = ({ order, showStatus }: OrderDetailsProps) => {
|
|
10
|
+
const formatStatus = (str: string) => {
|
|
11
|
+
const formatted = str.split("_").join(" ")
|
|
12
|
+
|
|
13
|
+
return formatted.slice(0, 1).toUpperCase() + formatted.slice(1)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div>
|
|
18
|
+
<Text>
|
|
19
|
+
We have sent the order confirmation details to{" "}
|
|
20
|
+
<span
|
|
21
|
+
className="text-ui-fg-medium-plus font-semibold"
|
|
22
|
+
data-testid="order-email"
|
|
23
|
+
>
|
|
24
|
+
{order.email}
|
|
25
|
+
</span>
|
|
26
|
+
.
|
|
27
|
+
</Text>
|
|
28
|
+
<Text className="mt-2">
|
|
29
|
+
Order date:{" "}
|
|
30
|
+
<span data-testid="order-date">
|
|
31
|
+
{new Date(order.created_at).toDateString()}
|
|
32
|
+
</span>
|
|
33
|
+
</Text>
|
|
34
|
+
<Text className="mt-2 text-ui-fg-interactive">
|
|
35
|
+
Order number: <span data-testid="order-id">{order.display_id}</span>
|
|
36
|
+
</Text>
|
|
37
|
+
|
|
38
|
+
<div className="flex items-center text-compact-small gap-x-4 mt-4">
|
|
39
|
+
{showStatus && (
|
|
40
|
+
<>
|
|
41
|
+
<Text>
|
|
42
|
+
Order status:{" "}
|
|
43
|
+
<span className="text-ui-fg-subtle " data-testid="order-status">
|
|
44
|
+
{formatStatus(order.fulfillment_status)}
|
|
45
|
+
</span>
|
|
46
|
+
</Text>
|
|
47
|
+
<Text>
|
|
48
|
+
Payment status:{" "}
|
|
49
|
+
<span
|
|
50
|
+
className="text-ui-fg-subtle "
|
|
51
|
+
sata-testid="order-payment-status"
|
|
52
|
+
>
|
|
53
|
+
{formatStatus(order.payment_status)}
|
|
54
|
+
</span>
|
|
55
|
+
</Text>
|
|
56
|
+
</>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default OrderDetails
|