@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,145 @@
|
|
|
1
|
+
import { Disclosure } from "@headlessui/react"
|
|
2
|
+
import { Badge, Button, clx } from "@medusajs/ui"
|
|
3
|
+
import { useEffect } from "react"
|
|
4
|
+
|
|
5
|
+
import useToggleState from "@core/hooks/use-toggle-state"
|
|
6
|
+
import { useFormStatus } from "react-dom"
|
|
7
|
+
|
|
8
|
+
type AccountInfoProps = {
|
|
9
|
+
label: string
|
|
10
|
+
currentInfo: string | React.ReactNode
|
|
11
|
+
isSuccess?: boolean
|
|
12
|
+
isError?: boolean
|
|
13
|
+
errorMessage?: string
|
|
14
|
+
clearState: () => void
|
|
15
|
+
children?: React.ReactNode
|
|
16
|
+
'data-testid'?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const AccountInfo = ({
|
|
20
|
+
label,
|
|
21
|
+
currentInfo,
|
|
22
|
+
isSuccess,
|
|
23
|
+
isError,
|
|
24
|
+
clearState,
|
|
25
|
+
errorMessage = "An error occurred, please try again",
|
|
26
|
+
children,
|
|
27
|
+
'data-testid': dataTestid
|
|
28
|
+
}: AccountInfoProps) => {
|
|
29
|
+
const { state, close, toggle } = useToggleState()
|
|
30
|
+
|
|
31
|
+
const { pending } = useFormStatus()
|
|
32
|
+
|
|
33
|
+
const handleToggle = () => {
|
|
34
|
+
clearState()
|
|
35
|
+
setTimeout(() => toggle(), 100)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (isSuccess) {
|
|
40
|
+
close()
|
|
41
|
+
}
|
|
42
|
+
}, [isSuccess, close])
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="text-small-regular" data-testid={dataTestid}>
|
|
46
|
+
<div className="flex items-start justify-between">
|
|
47
|
+
<div className="flex flex-col gap-y-1">
|
|
48
|
+
<span className="text-sm font-bold text-heading uppercase tracking-wider">{label}</span>
|
|
49
|
+
{!state && (
|
|
50
|
+
<div className="flex flex-1">
|
|
51
|
+
{typeof currentInfo === "string" ? (
|
|
52
|
+
<span className="text-sm text-gray-600 font-medium" data-testid="current-info">
|
|
53
|
+
{currentInfo}
|
|
54
|
+
</span>
|
|
55
|
+
) : (
|
|
56
|
+
currentInfo
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
<div>
|
|
62
|
+
<Button
|
|
63
|
+
variant="secondary"
|
|
64
|
+
className="w-auto h-7 px-4 rounded-full text-[11px] font-bold uppercase tracking-wider"
|
|
65
|
+
onClick={handleToggle}
|
|
66
|
+
type={state ? "reset" : "button"}
|
|
67
|
+
data-testid="edit-button"
|
|
68
|
+
data-active={state}
|
|
69
|
+
>
|
|
70
|
+
{state ? "Cancel" : "Edit"}
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{/* Success state */}
|
|
76
|
+
<Disclosure>
|
|
77
|
+
<Disclosure.Panel
|
|
78
|
+
static
|
|
79
|
+
className={clx(
|
|
80
|
+
"transition-[max-height,opacity] duration-300 ease-in-out overflow-hidden",
|
|
81
|
+
{
|
|
82
|
+
"max-h-[1000px] opacity-100": isSuccess,
|
|
83
|
+
"max-h-0 opacity-0": !isSuccess,
|
|
84
|
+
}
|
|
85
|
+
)}
|
|
86
|
+
data-testid="success-message"
|
|
87
|
+
>
|
|
88
|
+
<div className="my-2">
|
|
89
|
+
<Badge className="px-3 py-1 rounded-full bg-green-50 text-green-700 border-green-100 text-[10px] font-bold uppercase tracking-wider">
|
|
90
|
+
{label} updated succesfully
|
|
91
|
+
</Badge>
|
|
92
|
+
</div>
|
|
93
|
+
</Disclosure.Panel>
|
|
94
|
+
</Disclosure>
|
|
95
|
+
|
|
96
|
+
{/* Error state */}
|
|
97
|
+
<Disclosure>
|
|
98
|
+
<Disclosure.Panel
|
|
99
|
+
static
|
|
100
|
+
className={clx(
|
|
101
|
+
"transition-[max-height,opacity] duration-300 ease-in-out overflow-hidden",
|
|
102
|
+
{
|
|
103
|
+
"max-h-[1000px] opacity-100": isError,
|
|
104
|
+
"max-h-0 opacity-0": !isError,
|
|
105
|
+
}
|
|
106
|
+
)}
|
|
107
|
+
data-testid="error-message"
|
|
108
|
+
>
|
|
109
|
+
<Badge className="p-2 my-4" color="red">
|
|
110
|
+
<span>{errorMessage}</span>
|
|
111
|
+
</Badge>
|
|
112
|
+
</Disclosure.Panel>
|
|
113
|
+
</Disclosure>
|
|
114
|
+
|
|
115
|
+
<Disclosure>
|
|
116
|
+
<Disclosure.Panel
|
|
117
|
+
static
|
|
118
|
+
className={clx(
|
|
119
|
+
"transition-[max-height,opacity] duration-300 ease-in-out overflow-visible",
|
|
120
|
+
{
|
|
121
|
+
"max-h-[1000px] opacity-100": state,
|
|
122
|
+
"max-h-0 opacity-0": !state,
|
|
123
|
+
}
|
|
124
|
+
)}
|
|
125
|
+
>
|
|
126
|
+
<div className="flex flex-col gap-y-1 py-2">
|
|
127
|
+
<div>{children}</div>
|
|
128
|
+
<div className="flex items-center justify-end mt-2">
|
|
129
|
+
<Button
|
|
130
|
+
isLoading={pending}
|
|
131
|
+
className="w-fit px-8 h-11 rounded-[30px] text-sm bg-brand-accent hover:bg-brand-accent-hover text-inverse border-none shadow-lg shadow-brand-sm"
|
|
132
|
+
type="submit"
|
|
133
|
+
data-testid="save-button"
|
|
134
|
+
>
|
|
135
|
+
Save changes
|
|
136
|
+
</Button>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</Disclosure.Panel>
|
|
140
|
+
</Disclosure>
|
|
141
|
+
</div>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default AccountInfo
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
export const AccountDetailsIcon = ({ color = "currentColor", ...props }: React.SVGProps<SVGSVGElement>) => (
|
|
6
|
+
<svg width="24" height="24" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
7
|
+
<g clipPath="url(#clip0_account_details)">
|
|
8
|
+
<path d="M33.164 33.2736C35.3952 31.0742 36.6237 28.1357 36.6237 25C36.6237 18.5897 31.409 13.375 24.9987 13.375C18.5885 13.375 13.376 18.5897 13.376 25C13.376 28.1335 14.6041 31.0716 16.8339 33.2717C18.9403 35.3604 21.7689 36.5596 24.7347 36.6212C24.8236 36.6231 24.9102 36.625 24.9991 36.625C28.0563 36.6283 30.9907 35.4238 33.164 33.2736ZM24.9987 14.1017C31.0081 14.1017 35.897 18.9906 35.897 25C35.897 27.7266 34.9044 30.2935 33.0916 32.2967C32.5719 30.7829 31.4225 30.3895 29.1579 30.1195C28.4217 30.0317 27.8922 29.7655 27.5836 29.3286C27.2112 28.8006 27.236 28.135 27.2716 27.8342C28.3025 27.247 28.7109 25.6052 28.8462 24.8631C28.9704 24.8432 29.0712 24.7941 29.1474 24.7439C29.5745 24.4604 29.8047 23.7085 29.8527 22.4459C29.8588 22.2774 29.8303 22.1095 29.7691 21.9524C29.7079 21.7953 29.6153 21.6524 29.4969 21.5324C29.373 21.4077 29.2241 21.3107 29.06 21.2477C29.3296 20.2022 29.1927 19.111 28.6662 18.1514C28.3882 17.6401 28.0086 17.1911 27.5506 16.832C27.0927 16.4728 26.5662 16.2111 26.0034 16.063C24.8165 15.7457 24.7636 15.7364 24.7344 15.7311C23.9049 15.5961 23.2947 15.721 22.9224 16.1016C22.7097 16.3187 22.6141 16.5869 22.5804 16.8227H22.1551C22.1016 16.8227 22.0487 16.8346 22.0003 16.8574C21.9518 16.8802 21.909 16.9135 21.875 16.9547C20.1496 19.045 20.4751 20.5667 20.8295 21.2954C20.7084 21.3554 20.597 21.4352 20.5006 21.5324C20.3821 21.6523 20.2895 21.7952 20.2283 21.9523C20.1671 22.1094 20.1386 22.2774 20.1447 22.4459C20.1924 23.7089 20.423 24.4604 20.8501 24.7439C20.9262 24.7941 21.0271 24.8429 21.1512 24.8631C21.2862 25.6052 21.6946 27.2466 22.7259 27.8342C22.7619 28.1357 22.7862 28.8006 22.4139 29.3286C22.1052 29.7659 21.5757 30.0321 20.84 30.1195C18.5754 30.3895 17.426 30.7825 16.9062 32.2945C15.0946 30.2909 14.1027 27.7247 14.1027 25C14.1024 18.9906 18.9905 14.1017 24.9987 14.1017ZM32.3859 33.0089C30.3912 34.8546 27.7164 35.9286 24.9826 35.8874C22.2204 35.9237 19.4765 34.7984 17.4875 32.89C17.8107 31.51 18.4824 31.1327 20.9259 30.8414C21.878 30.7277 22.58 30.3576 23.0116 29.7415C23.6922 28.7702 23.4196 27.5601 23.4076 27.5091C23.3945 27.4528 23.3681 27.4005 23.3307 27.3565C23.2932 27.3124 23.2458 27.278 23.1924 27.256C22.3119 26.8937 21.9016 25.0911 21.8176 24.4274C21.8107 24.3729 21.7915 24.3207 21.7616 24.2747C21.7316 24.2287 21.6916 24.1901 21.6446 24.1617C21.5976 24.1334 21.5448 24.116 21.4901 24.111C21.4355 24.1059 21.3804 24.1133 21.329 24.1326C21.2739 24.1536 21.2607 24.1446 21.2517 24.139C21.1314 24.0591 20.9157 23.6069 20.8707 22.4189C20.8651 22.2779 20.9172 22.1451 21.017 22.0442C21.0658 21.9935 21.1249 21.9538 21.1902 21.9276C21.2556 21.9014 21.3258 21.8894 21.3961 21.8924C21.5412 21.9017 21.6736 21.8129 21.7347 21.6816C21.7644 21.617 21.7747 21.5452 21.7642 21.4749C21.7538 21.4045 21.7231 21.3388 21.6759 21.2856C21.6252 21.2286 20.4804 19.8891 22.3287 17.5499H22.9407C23.0472 17.5499 23.1481 17.5011 23.2171 17.4201C23.2512 17.3796 23.2761 17.3321 23.2902 17.2811C23.3043 17.23 23.3073 17.1765 23.2989 17.1242C23.2985 17.1209 23.2494 16.8025 23.4451 16.6067C23.6412 16.4102 24.0474 16.3555 24.6042 16.4459C24.6481 16.4556 24.992 16.5449 25.8159 16.7654C26.2837 16.8884 26.7215 17.1059 27.1021 17.4044C27.4828 17.703 27.7984 18.0762 28.0295 18.5012C28.2718 18.9381 28.4175 19.4219 28.4567 19.92C28.4958 20.418 28.4275 20.9187 28.2564 21.388C28.2084 21.502 28.2215 21.6325 28.2912 21.7345C28.361 21.8365 28.4772 21.9021 28.6014 21.8924C28.7435 21.8864 28.88 21.9422 28.9805 22.0442C29.0802 22.1451 29.132 22.2779 29.1267 22.4189C29.0821 23.6069 28.8665 24.0591 28.7457 24.139C28.7371 24.1446 28.724 24.1536 28.6685 24.1326C28.6171 24.1135 28.562 24.1062 28.5074 24.1113C28.4528 24.1164 28.4 24.1338 28.3531 24.1621C28.3061 24.1904 28.2661 24.229 28.2361 24.2749C28.2061 24.3209 28.1869 24.373 28.1799 24.4274C28.0959 25.0911 27.6856 26.8934 26.8051 27.256C26.7517 27.278 26.7043 27.3125 26.6669 27.3565C26.6294 27.4005 26.603 27.4529 26.5899 27.5091C26.5779 27.5601 26.3052 28.7702 26.9859 29.7415C27.4175 30.3576 28.1195 30.7277 29.072 30.8414C31.6452 31.1477 32.2119 31.5906 32.5107 32.8915C32.4695 32.9309 32.4279 32.9702 32.3859 33.0089Z" fill={color} stroke={color} strokeWidth="0.2" />
|
|
9
|
+
</g>
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="clip0_account_details">
|
|
12
|
+
<rect width="24" height="24" fill="white" transform="translate(13 13)" />
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
export const AddressesIcon = ({ color = "currentColor", ...props }: React.SVGProps<SVGSVGElement>) => (
|
|
19
|
+
<svg width="24" height="24" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
20
|
+
<g clipPath="url(#clip0_addresses)">
|
|
21
|
+
<path d="M25.2466 14.0921C25.1775 14.0326 25.0899 14 24.9995 14C24.9091 14 24.8216 14.0326 24.7525 14.0921L20.1978 18.0122V16.0965C20.1978 15.9928 20.1574 15.8933 20.0855 15.82C20.0136 15.7466 19.9161 15.7054 19.8145 15.7054H16.7747C16.673 15.7054 16.5755 15.7466 16.5036 15.82C16.4317 15.8933 16.3913 15.9928 16.3913 16.0965V21.2886L13.636 23.6603C13.5585 23.7273 13.5101 23.8228 13.5014 23.9261C13.4927 24.0293 13.5244 24.1319 13.5896 24.2114L15.2843 26.2608C15.3167 26.3001 15.3565 26.3325 15.4012 26.3561C15.4459 26.3797 15.4947 26.3941 15.5449 26.3984C15.5951 26.4027 15.6456 26.3969 15.6935 26.3813C15.7415 26.3657 15.786 26.3406 15.8244 26.3074L16.3898 25.8208V35.6089C16.3898 35.7126 16.4302 35.8121 16.5021 35.8854C16.574 35.9588 16.6715 36 16.7731 36H33.2255C33.3272 36 33.4247 35.9588 33.4966 35.8854C33.5685 35.8121 33.6089 35.7126 33.6089 35.6089V25.8208L34.1743 26.3074C34.2521 26.3741 34.3526 26.4067 34.4539 26.3979C34.5552 26.3892 34.649 26.3399 34.7148 26.2608L36.4095 24.2114C36.442 24.1722 36.4667 24.1268 36.482 24.0778C36.4973 24.0288 36.5029 23.9772 36.4986 23.926C36.4943 23.8748 36.4801 23.825 36.4568 23.7794C36.4336 23.7338 36.4017 23.6933 36.3631 23.6603L25.2466 14.0921ZM17.158 16.488H19.4311V18.6724L17.158 20.6288V16.488ZM32.8422 35.2182H25.7944C26.9719 33.6748 29.8024 29.7457 29.8024 27.6411C29.8024 24.9389 27.6477 22.7404 24.9993 22.7404C22.3509 22.7404 20.1962 24.9389 20.1962 27.6411C20.1962 29.7457 23.0267 33.6748 24.2043 35.2182H17.1565V25.1614L24.9993 18.4108L32.8422 25.1614V35.2182ZM24.9993 34.9866C23.6462 33.2458 20.9629 29.4261 20.9629 27.6415C20.9629 25.3703 22.7737 23.523 24.9993 23.523C27.2249 23.523 29.0358 25.3707 29.0358 27.6415C29.0358 29.4261 26.3525 33.2462 24.9993 34.9866ZM34.3755 25.4579L25.2466 17.6004C25.1775 17.5407 25.0899 17.5079 24.9993 17.5079C24.9088 17.5079 24.8212 17.5407 24.7521 17.6004L15.6232 25.4579L14.423 24.0064L24.9993 14.9028L35.5757 24.0064L34.3755 25.4579Z" fill={color} stroke={color} strokeWidth="0.2" />
|
|
22
|
+
<path d="M24.9996 25.158C23.6575 25.158 22.5654 26.2722 22.5654 27.6415C22.5654 29.0108 23.6575 30.1251 24.9996 30.1251C26.3416 30.1251 27.4337 29.0108 27.4337 27.6415C27.4337 26.2722 26.3416 25.158 24.9996 25.158ZM24.9996 29.3425C24.0803 29.3425 23.3321 28.5794 23.3321 27.6411C23.3321 26.7029 24.08 25.9398 24.9996 25.9398C25.9192 25.9398 26.667 26.7029 26.667 27.6411C26.667 28.5794 25.9192 29.3425 24.9996 29.3425Z" fill={color} stroke={color} strokeWidth="0.2" />
|
|
23
|
+
</g>
|
|
24
|
+
<defs>
|
|
25
|
+
<clipPath id="clip0_addresses">
|
|
26
|
+
<rect width="24" height="24" fill="white" transform="translate(13 13)" />
|
|
27
|
+
</clipPath>
|
|
28
|
+
</defs>
|
|
29
|
+
</svg>
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export const OrdersIcon = ({ color = "currentColor", ...props }: React.SVGProps<SVGSVGElement>) => (
|
|
33
|
+
<svg width="24" height="24" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
34
|
+
<path d="M34.414 20.0717L34.3978 20.0435C34.3755 19.9969 34.3498 19.9521 34.3208 19.9093L31.2856 14.6179C31.0669 14.2368 30.6599 14 30.2232 14H19.7773C19.3399 14 18.9325 14.2373 18.714 14.6195L15.6292 20.0158C15.6023 20.0633 15.5815 20.1141 15.5673 20.167C15.5227 20.2884 15.4999 20.4168 15.5 20.5462V34.4838C15.5 35.3198 16.1745 36 17.0036 36H32.9963C33.8254 36 34.4999 35.3198 34.4999 34.4838V20.4951C34.4999 20.4764 34.4994 20.4579 34.4984 20.4394C34.5075 20.3111 34.478 20.1829 34.414 20.0717ZM25.6613 15.2895H30.1935L32.5812 19.4521H25.6613V15.2895ZM19.807 15.2895H24.3824V19.4521H17.4275L19.807 15.2895ZM33.2211 34.4839C33.221 34.544 33.1973 34.6016 33.1552 34.6441C33.113 34.6865 33.0559 34.7104 32.9963 34.7105H17.0036C16.944 34.7104 16.8869 34.6865 16.8448 34.6441C16.8026 34.6016 16.7789 34.544 16.7789 34.4839V20.7416H33.2211V34.4839Z" fill={color} />
|
|
35
|
+
<path d="M27.903 25.6026C27.6533 25.3509 27.2484 25.3509 26.9987 25.6026L24.1435 28.4816L23.0457 27.3746C22.796 27.1228 22.3911 27.1228 22.1414 27.3746C21.8917 27.6263 21.8917 28.0346 22.1414 28.2864L23.6915 29.8494C23.7508 29.9093 23.8212 29.9569 23.8988 29.9893C23.9764 30.0217 24.0596 30.0384 24.1436 30.0383C24.3072 30.0383 24.4709 29.9753 24.5957 29.8494L27.903 26.5145C28.1527 26.2627 28.1527 25.8544 27.903 25.6026Z" fill={color} />
|
|
36
|
+
</svg>
|
|
37
|
+
)
|
|
38
|
+
export const LogoutIcon = ({ color = "#E70000", ...props }: React.SVGProps<SVGSVGElement>) => (
|
|
39
|
+
<svg width="24" height="24" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
40
|
+
<path d="M81.3188 65.5335H51.4738C51.0498 65.5335 50.6431 65.3649 50.3433 65.0647C50.0434 64.7645 49.875 64.3574 49.875 63.9329C49.875 63.5084 50.0434 63.1013 50.3433 62.8011C50.6431 62.5009 51.0498 62.3323 51.4738 62.3323H81.3188C81.7428 62.3323 82.1495 62.5009 82.4493 62.8011C82.7492 63.1013 82.9176 63.5084 82.9176 63.9329C82.9176 64.3574 82.7492 64.7645 82.4493 65.0647C82.1495 65.3649 81.7428 65.5335 81.3188 65.5335Z" fill={color} />
|
|
41
|
+
<path d="M72.7913 74.0701C72.4751 74.0703 72.166 73.9765 71.903 73.8008C71.64 73.6251 71.435 73.3752 71.3138 73.0828C71.1926 72.7905 71.1608 72.4687 71.2223 72.1582C71.2838 71.8477 71.4359 71.5624 71.6594 71.3384L79.0375 63.9329L71.6594 56.5274C71.3685 56.2252 71.2079 55.8206 71.2121 55.4009C71.2164 54.9812 71.3851 54.58 71.6819 54.2836C71.9788 53.9873 72.3801 53.8195 72.7993 53.8165C73.2185 53.8134 73.6222 53.9754 73.9233 54.2674L82.4291 62.804C82.728 63.1044 82.8958 63.5111 82.8958 63.9351C82.8958 64.3591 82.728 64.7658 82.4291 65.0662L73.9233 73.6027C73.7747 73.7515 73.5982 73.8693 73.4039 73.9495C73.2097 74.0298 73.0015 74.0707 72.7913 74.0701ZM62.1324 86.875H42.9464C41.3919 86.8739 39.9015 86.2552 38.8023 85.1548C37.7031 84.0544 37.0851 82.5623 37.084 81.0061V48.9939C37.0851 47.4377 37.7031 45.9456 38.8023 44.8452C39.9015 43.7448 41.3919 43.1261 42.9464 43.125H62.1324C63.6869 43.1261 65.1774 43.7448 66.2765 44.8452C67.3757 45.9456 67.9937 47.4377 67.9948 48.9939V53.2622C67.9948 53.6867 67.8264 54.0938 67.5265 54.394C67.2267 54.6942 66.82 54.8628 66.396 54.8628C65.972 54.8628 65.5653 54.6942 65.2654 54.394C64.9656 54.0938 64.7972 53.6867 64.7972 53.2622V48.9939C64.796 48.2867 64.5149 47.6089 64.0154 47.1088C63.5159 46.6088 62.8388 46.3273 62.1324 46.3262H42.9464C42.24 46.3273 41.5629 46.6088 41.0634 47.1088C40.5639 47.6089 40.2828 48.2867 40.2817 48.9939V81.0061C40.2828 81.7133 40.5639 82.3911 41.0634 82.8912C41.5629 83.3912 42.24 83.6727 42.9464 83.6738H62.1324C62.8388 83.6727 63.5159 83.3912 64.0154 82.8912C64.5149 82.3911 64.796 81.7133 64.7972 81.0061V74.6037C64.7972 74.1792 64.9656 73.772 65.2654 73.4719C65.5653 73.1717 65.972 73.003 66.396 73.003C66.82 73.003 67.2267 73.1717 67.5265 73.4719C67.8264 73.772 67.9948 74.1792 67.9948 74.6037V81.0061C67.9937 82.5623 67.3757 84.0544 66.2765 85.1548C65.1774 86.2552 63.6869 86.8739 62.1324 86.875Z" fill={color} />
|
|
42
|
+
</svg>
|
|
43
|
+
)
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { clx } from "@medusajs/ui"
|
|
4
|
+
import { ArrowRightOnRectangle } from "@medusajs/icons"
|
|
5
|
+
import { useParams, usePathname } from "next/navigation"
|
|
6
|
+
|
|
7
|
+
import ChevronDown from "@modules/common/icons/chevron-down"
|
|
8
|
+
import LocalizedClientLink from "@modules/common/components/localized-client-link"
|
|
9
|
+
import { HttpTypes } from "@medusajs/types"
|
|
10
|
+
import { signout } from "@core/data/customer"
|
|
11
|
+
import { AccountDetailsIcon, AddressesIcon, OrdersIcon, LogoutIcon } from "./icons"
|
|
12
|
+
import { PaymentMethodsIcon } from "./payment-methods-icon"
|
|
13
|
+
import LogoutModal from "./logout-modal"
|
|
14
|
+
import { useState, useEffect } from "react"
|
|
15
|
+
|
|
16
|
+
// Helper function to get profile image URL from metadata
|
|
17
|
+
const getProfileImageUrl = (
|
|
18
|
+
customer: HttpTypes.StoreCustomer | null,
|
|
19
|
+
accentHex = "8B5AB1"
|
|
20
|
+
): string => {
|
|
21
|
+
if (!customer) {
|
|
22
|
+
return `https://ui-avatars.com/api/?name=J+W&background=${accentHex}&color=fff&size=256&bold=true`
|
|
23
|
+
}
|
|
24
|
+
const metadata = customer.metadata as Record<string, any> | undefined
|
|
25
|
+
if (metadata?.profile_image_url) {
|
|
26
|
+
return metadata.profile_image_url
|
|
27
|
+
}
|
|
28
|
+
return `https://ui-avatars.com/api/?name=${customer.first_name || "J"}+${customer.last_name || "W"}&background=${accentHex}&color=fff&size=256&bold=true`
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const useBrandAccentHex = () => {
|
|
32
|
+
const [accentHex, setAccentHex] = useState("8B5AB1")
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const raw = getComputedStyle(document.documentElement)
|
|
36
|
+
.getPropertyValue("--color-brand-accent")
|
|
37
|
+
.trim()
|
|
38
|
+
if (raw) {
|
|
39
|
+
setAccentHex(raw.replace("#", ""))
|
|
40
|
+
}
|
|
41
|
+
}, [])
|
|
42
|
+
|
|
43
|
+
return accentHex
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const AccountNav = ({
|
|
47
|
+
customer,
|
|
48
|
+
}: {
|
|
49
|
+
customer: HttpTypes.StoreCustomer | null
|
|
50
|
+
}) => {
|
|
51
|
+
const route = usePathname()
|
|
52
|
+
const { countryCode } = useParams() as { countryCode: string }
|
|
53
|
+
const [isLogoutModalOpen, setIsLogoutModalOpen] = useState(false)
|
|
54
|
+
const [isLoggingOut, setIsLoggingOut] = useState(false)
|
|
55
|
+
const accentHex = useBrandAccentHex()
|
|
56
|
+
|
|
57
|
+
const handleLogout = async () => {
|
|
58
|
+
setIsLoggingOut(true)
|
|
59
|
+
await signout(countryCode)
|
|
60
|
+
setIsLoggingOut(false)
|
|
61
|
+
setIsLogoutModalOpen(false)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div>
|
|
66
|
+
<div className="small:hidden" data-testid="mobile-account-nav">
|
|
67
|
+
{route !== `/${countryCode}/account` ? (
|
|
68
|
+
<div className="flex flex-col gap-y-4 px-4 py-4 bg-page-bg rounded-2xl border border-gray-100 shadow-sm mb-6">
|
|
69
|
+
<LocalizedClientLink
|
|
70
|
+
href="/account"
|
|
71
|
+
className="flex items-center gap-x-2 text-base font-bold text-heading"
|
|
72
|
+
data-testid="account-main-link"
|
|
73
|
+
>
|
|
74
|
+
<ChevronDown className="transform rotate-90 w-5 h-5 text-brand-accent" />
|
|
75
|
+
<span>Back to Account</span>
|
|
76
|
+
</LocalizedClientLink>
|
|
77
|
+
</div>
|
|
78
|
+
) : (
|
|
79
|
+
<div className="flex flex-col gap-y-6">
|
|
80
|
+
<div className="bg-page-bg rounded-3xl shadow-sm p-6 border border-gray-100 flex flex-row items-center gap-x-4">
|
|
81
|
+
<div className="w-16 h-16 rounded-full overflow-hidden border border-gray-100 shadow-sm flex-shrink-0">
|
|
82
|
+
<img
|
|
83
|
+
src={getProfileImageUrl(customer, accentHex)}
|
|
84
|
+
alt="Profile"
|
|
85
|
+
className="w-full h-full object-cover"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
<div className="flex flex-col overflow-hidden">
|
|
89
|
+
<h3 className="text-base font-bold text-heading truncate">
|
|
90
|
+
{customer?.first_name ? `${customer.first_name} ${customer.last_name}` : "Jimmy Willson"}
|
|
91
|
+
</h3>
|
|
92
|
+
<p className="text-xs text-gray-500 truncate">{customer?.email}</p>
|
|
93
|
+
<p className="text-xs text-gray-500 mt-0.5">{customer?.phone}</p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
{/* Menu List - Mobile */}
|
|
98
|
+
<div className="bg-page-bg rounded-3xl shadow-sm border border-gray-100 overflow-hidden">
|
|
99
|
+
<ul className="flex flex-col">
|
|
100
|
+
<li className="border-b border-gray-100 last:border-0">
|
|
101
|
+
<LocalizedClientLink
|
|
102
|
+
href="/account/profile"
|
|
103
|
+
className="flex items-center justify-between py-5 px-6 group active:bg-gray-50 transition-colors"
|
|
104
|
+
data-testid="profile-link"
|
|
105
|
+
>
|
|
106
|
+
<div className="flex items-center gap-x-4">
|
|
107
|
+
<div className="w-[50px] h-[50px] rounded-full bg-brand-accent-muted flex items-center justify-center text-brand-accent">
|
|
108
|
+
<AccountDetailsIcon width="50" height="50" />
|
|
109
|
+
</div>
|
|
110
|
+
<span className="font-bold text-gray-700">Account Details</span>
|
|
111
|
+
</div>
|
|
112
|
+
<ChevronDown className="transform -rotate-90 text-gray-400" />
|
|
113
|
+
</LocalizedClientLink>
|
|
114
|
+
</li>
|
|
115
|
+
<li className="border-b border-gray-100 last:border-0">
|
|
116
|
+
<LocalizedClientLink
|
|
117
|
+
href="/account/addresses"
|
|
118
|
+
className="flex items-center justify-between py-5 px-6 group active:bg-gray-50 transition-colors"
|
|
119
|
+
data-testid="addresses-link"
|
|
120
|
+
>
|
|
121
|
+
<div className="flex items-center gap-x-4">
|
|
122
|
+
<div className="w-[50px] h-[50px] rounded-full bg-brand-accent-muted flex items-center justify-center text-brand-accent">
|
|
123
|
+
<AddressesIcon width="50" height="50" />
|
|
124
|
+
</div>
|
|
125
|
+
<span className="font-bold text-gray-700">Addresses</span>
|
|
126
|
+
</div>
|
|
127
|
+
<ChevronDown className="transform -rotate-90 text-gray-400" />
|
|
128
|
+
</LocalizedClientLink>
|
|
129
|
+
</li>
|
|
130
|
+
<li className="border-b border-gray-100 last:border-0">
|
|
131
|
+
<LocalizedClientLink
|
|
132
|
+
href="/account/orders"
|
|
133
|
+
className="flex items-center justify-between py-5 px-6 group active:bg-gray-50 transition-colors"
|
|
134
|
+
data-testid="orders-link"
|
|
135
|
+
>
|
|
136
|
+
<div className="flex items-center gap-x-4">
|
|
137
|
+
<div className="w-[50px] h-[50px] rounded-full bg-brand-accent-muted flex items-center justify-center text-brand-accent">
|
|
138
|
+
<OrdersIcon width="50" height="50" />
|
|
139
|
+
</div>
|
|
140
|
+
<span className="font-bold text-gray-700">Orders</span>
|
|
141
|
+
</div>
|
|
142
|
+
<ChevronDown className="transform -rotate-90 text-gray-400" />
|
|
143
|
+
</LocalizedClientLink>
|
|
144
|
+
</li>
|
|
145
|
+
<li className="border-b border-gray-100 last:border-0">
|
|
146
|
+
<LocalizedClientLink
|
|
147
|
+
href="/account/payment-methods"
|
|
148
|
+
className="flex items-center justify-between py-5 px-6 group active:bg-gray-50 transition-colors"
|
|
149
|
+
data-testid="payment-methods-link"
|
|
150
|
+
>
|
|
151
|
+
<div className="flex items-center gap-x-4">
|
|
152
|
+
<div className="w-[50px] h-[50px] rounded-full bg-brand-accent-muted flex items-center justify-center text-brand-accent">
|
|
153
|
+
<PaymentMethodsIcon width="50" height="50" />
|
|
154
|
+
</div>
|
|
155
|
+
<span className="font-bold text-gray-700">Payment Methods</span>
|
|
156
|
+
</div>
|
|
157
|
+
<ChevronDown className="transform -rotate-90 text-gray-400" />
|
|
158
|
+
</LocalizedClientLink>
|
|
159
|
+
</li>
|
|
160
|
+
<li>
|
|
161
|
+
<button
|
|
162
|
+
type="button"
|
|
163
|
+
className="flex items-center justify-between py-5 px-6 w-full text-left group active:bg-red-50 transition-colors"
|
|
164
|
+
onClick={() => setIsLogoutModalOpen(true)}
|
|
165
|
+
data-testid="logout-button"
|
|
166
|
+
>
|
|
167
|
+
<div className="flex items-center gap-x-4">
|
|
168
|
+
<div className="w-[50px] h-[50px] rounded-full bg-red-50 flex items-center justify-center text-red-500">
|
|
169
|
+
<LogoutIcon width="50" height="50" color="#E70000" />
|
|
170
|
+
</div>
|
|
171
|
+
<span className="font-bold text-red-500">Log out</span>
|
|
172
|
+
</div>
|
|
173
|
+
<ChevronDown className="transform -rotate-90 text-gray-400" />
|
|
174
|
+
</button>
|
|
175
|
+
</li>
|
|
176
|
+
|
|
177
|
+
</ul>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
<div className="hidden small:block" data-testid="account-nav">
|
|
183
|
+
<div className="bg-page-bg rounded-3xl shadow-sm border border-gray-100 min-w-[300px] min-h-[500px] flex flex-col justify-between overflow-hidden">
|
|
184
|
+
<div className="px-6 pt-6">
|
|
185
|
+
{/* User Profile Section */}
|
|
186
|
+
<div className="flex flex-row items-center gap-x-4 mb-6">
|
|
187
|
+
<div className="w-16 h-16 rounded-full overflow-hidden border border-gray-100 shadow-sm flex-shrink-0">
|
|
188
|
+
<img
|
|
189
|
+
src={getProfileImageUrl(customer, accentHex)}
|
|
190
|
+
alt="Profile"
|
|
191
|
+
className="w-full h-full object-cover"
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
<div className="flex flex-col overflow-hidden">
|
|
195
|
+
<h3 className="text-base font-bold text-heading truncate">
|
|
196
|
+
{customer?.first_name ? `${customer.first_name} ${customer.last_name}` : "Jimmy Willson"}
|
|
197
|
+
</h3>
|
|
198
|
+
<p className="text-xs text-gray-500 truncate max-w-[180px]">{customer?.email}</p>
|
|
199
|
+
<p className="text-xs text-gray-500 mt-0.5">{customer?.phone}</p>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div className="border-t border-gray-200 my-4"></div>
|
|
204
|
+
|
|
205
|
+
<div className="text-base-regular">
|
|
206
|
+
<ul className="flex mb-0 justify-start items-start flex-col gap-y-3">
|
|
207
|
+
|
|
208
|
+
<li className="w-full">
|
|
209
|
+
<AccountNavLink
|
|
210
|
+
href="/account/profile"
|
|
211
|
+
route={route!}
|
|
212
|
+
data-testid="profile-link"
|
|
213
|
+
icon={(active) => <AccountDetailsIcon width="50" height="50" />}
|
|
214
|
+
>
|
|
215
|
+
Account Details
|
|
216
|
+
</AccountNavLink>
|
|
217
|
+
</li>
|
|
218
|
+
<li className="w-full">
|
|
219
|
+
<AccountNavLink
|
|
220
|
+
href="/account/addresses"
|
|
221
|
+
route={route!}
|
|
222
|
+
data-testid="addresses-link"
|
|
223
|
+
icon={(active) => <AddressesIcon width="50" height="50" />}
|
|
224
|
+
>
|
|
225
|
+
Addresses
|
|
226
|
+
</AccountNavLink>
|
|
227
|
+
</li>
|
|
228
|
+
<li className="w-full">
|
|
229
|
+
<AccountNavLink
|
|
230
|
+
href="/account/orders"
|
|
231
|
+
route={route!}
|
|
232
|
+
data-testid="orders-link"
|
|
233
|
+
icon={(active) => <OrdersIcon width="50" height="50" />}
|
|
234
|
+
>
|
|
235
|
+
Orders
|
|
236
|
+
</AccountNavLink>
|
|
237
|
+
</li>
|
|
238
|
+
<li className="w-full">
|
|
239
|
+
<AccountNavLink
|
|
240
|
+
href="/account/payment-methods"
|
|
241
|
+
route={route!}
|
|
242
|
+
data-testid="payment-methods-link"
|
|
243
|
+
icon={(active) => <PaymentMethodsIcon width="50" height="50" />}
|
|
244
|
+
>
|
|
245
|
+
Payment Methods
|
|
246
|
+
</AccountNavLink>
|
|
247
|
+
</li>
|
|
248
|
+
</ul>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
<div className="px-6 pt-4 mt-2 border-t border-gray-200 pb-6">
|
|
253
|
+
<button
|
|
254
|
+
type="button"
|
|
255
|
+
onClick={() => setIsLogoutModalOpen(true)}
|
|
256
|
+
data-testid="logout-button"
|
|
257
|
+
className="flex items-center gap-x-3 w-full px-4 py-3 rounded-xl hover:bg-red-50 transition-all font-medium group"
|
|
258
|
+
>
|
|
259
|
+
<div className="w-[50px] h-[50px] rounded-full bg-red-50 flex items-center justify-center text-red-500 group-hover:bg-red-100 transition-colors">
|
|
260
|
+
<LogoutIcon width="50" height="50" color="#E70000" />
|
|
261
|
+
</div>
|
|
262
|
+
<span className="text-red-500">Log Out</span>
|
|
263
|
+
</button>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
<LogoutModal
|
|
271
|
+
isOpen={isLogoutModalOpen}
|
|
272
|
+
close={() => setIsLogoutModalOpen(false)}
|
|
273
|
+
onConfirm={handleLogout}
|
|
274
|
+
isLoggingOut={isLoggingOut}
|
|
275
|
+
/>
|
|
276
|
+
</div>
|
|
277
|
+
)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
type AccountNavLinkProps = {
|
|
281
|
+
href: string
|
|
282
|
+
route: string
|
|
283
|
+
children: React.ReactNode
|
|
284
|
+
"data-testid"?: string
|
|
285
|
+
icon?: (active: boolean) => React.ReactNode
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const AccountNavLink = ({
|
|
289
|
+
href,
|
|
290
|
+
route,
|
|
291
|
+
children,
|
|
292
|
+
"data-testid": dataTestId,
|
|
293
|
+
icon,
|
|
294
|
+
}: AccountNavLinkProps) => {
|
|
295
|
+
const { countryCode }: { countryCode: string } = useParams()
|
|
296
|
+
|
|
297
|
+
const active = route.split(countryCode)[1] === href
|
|
298
|
+
return (
|
|
299
|
+
<LocalizedClientLink
|
|
300
|
+
href={href}
|
|
301
|
+
className={clx("flex items-center gap-x-3 w-full px-4 py-3 rounded-xl transition-all font-medium", {
|
|
302
|
+
"text-inverse bg-brand-accent shadow-md": active,
|
|
303
|
+
"text-body hover:bg-surface-muted": !active,
|
|
304
|
+
})}
|
|
305
|
+
data-testid={dataTestId}
|
|
306
|
+
>
|
|
307
|
+
<div className={clx("w-[50px] h-[50px] rounded-full flex items-center justify-center transition-colors", {
|
|
308
|
+
"text-brand-accent bg-page-bg": active,
|
|
309
|
+
"text-brand-accent bg-brand-accent-muted": !active
|
|
310
|
+
})}>
|
|
311
|
+
{icon && icon(active)}
|
|
312
|
+
</div>
|
|
313
|
+
<span>{children}</span>
|
|
314
|
+
</LocalizedClientLink>
|
|
315
|
+
)
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export default AccountNav
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Dialog, Transition } from "@headlessui/react"
|
|
4
|
+
import { ArrowRightOnRectangle } from "@medusajs/icons"
|
|
5
|
+
import { Button, clx } from "@medusajs/ui"
|
|
6
|
+
import React, { Fragment } from "react"
|
|
7
|
+
import { LogoutIcon } from "./icons"
|
|
8
|
+
|
|
9
|
+
type LogoutModalProps = {
|
|
10
|
+
isOpen: boolean
|
|
11
|
+
close: () => void
|
|
12
|
+
onConfirm: () => void
|
|
13
|
+
isLoggingOut: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const LogoutModal = ({
|
|
17
|
+
isOpen,
|
|
18
|
+
close,
|
|
19
|
+
onConfirm,
|
|
20
|
+
isLoggingOut,
|
|
21
|
+
}: LogoutModalProps) => {
|
|
22
|
+
return (
|
|
23
|
+
<Transition appear show={isOpen} as={Fragment}>
|
|
24
|
+
<Dialog as="div" className="relative z-[100]" onClose={close}>
|
|
25
|
+
<Transition.Child
|
|
26
|
+
as={Fragment}
|
|
27
|
+
enter="ease-out duration-300"
|
|
28
|
+
enterFrom="opacity-0"
|
|
29
|
+
enterTo="opacity-100"
|
|
30
|
+
leave="ease-in duration-200"
|
|
31
|
+
leaveFrom="opacity-100"
|
|
32
|
+
leaveTo="opacity-0"
|
|
33
|
+
>
|
|
34
|
+
<div className="fixed inset-0 bg-black/30 backdrop-blur-sm" />
|
|
35
|
+
</Transition.Child>
|
|
36
|
+
|
|
37
|
+
<div className="fixed inset-0 overflow-y-auto">
|
|
38
|
+
<div className="flex min-h-full items-center justify-center p-4 text-center">
|
|
39
|
+
<Transition.Child
|
|
40
|
+
as={Fragment}
|
|
41
|
+
enter="ease-out duration-300"
|
|
42
|
+
enterFrom="opacity-0 scale-95"
|
|
43
|
+
enterTo="opacity-100 scale-100"
|
|
44
|
+
leave="ease-in duration-200"
|
|
45
|
+
leaveFrom="opacity-100 scale-100"
|
|
46
|
+
leaveTo="opacity-0 scale-95"
|
|
47
|
+
>
|
|
48
|
+
<Dialog.Panel className="w-full max-w-[340px] transform overflow-hidden rounded-[40px] bg-white p-6 text-center align-middle shadow-xl transition-all">
|
|
49
|
+
<div className="flex flex-col items-center">
|
|
50
|
+
{/* Icon Section */}
|
|
51
|
+
<div className="w-[110px] h-[110px] rounded-full bg-[#E700001A] grid place-items-center mb-4">
|
|
52
|
+
<LogoutIcon width="60" height="60" color="#E70000" />
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
{/* Text Section */}
|
|
56
|
+
<Dialog.Title
|
|
57
|
+
as="h3"
|
|
58
|
+
className="text-2xl font-bold text-[#04122C] mb-1"
|
|
59
|
+
>
|
|
60
|
+
Log Out
|
|
61
|
+
</Dialog.Title>
|
|
62
|
+
<p className="text-gray-400 text-sm font-medium mb-6">
|
|
63
|
+
Are you sure want to log out?
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
{/* Buttons Section */}
|
|
67
|
+
<div className="flex gap-x-3 w-full">
|
|
68
|
+
<button
|
|
69
|
+
onClick={close}
|
|
70
|
+
className="flex-1 px-4 py-3 rounded-full border border-gray-200 font-bold text-gray-700 hover:bg-gray-50 transition-all text-base"
|
|
71
|
+
>
|
|
72
|
+
Cancel
|
|
73
|
+
</button>
|
|
74
|
+
<button
|
|
75
|
+
onClick={onConfirm}
|
|
76
|
+
disabled={isLoggingOut}
|
|
77
|
+
className="flex-1 px-4 py-3 rounded-full bg-brand-accent font-bold text-inverse hover:bg-brand-accent-hover transition-all text-base disabled:opacity-50"
|
|
78
|
+
>
|
|
79
|
+
{isLoggingOut ? "..." : "Log Out"}
|
|
80
|
+
</button>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</Dialog.Panel>
|
|
84
|
+
</Transition.Child>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</Dialog>
|
|
88
|
+
</Transition>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default LogoutModal
|
package/templates/storefront/src/modules/account/components/account-nav/payment-methods-icon.tsx
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
export const PaymentMethodsIcon = ({ color = "currentColor", ...props }: React.SVGProps<SVGSVGElement>) => (
|
|
6
|
+
<svg width="24" height="24" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
7
|
+
<path d="M42 16C42 13.7909 40.2091 12 38 12H12C9.79086 12 8 13.7909 8 16V34C8 36.2091 9.79086 38 12 38H38C40.2091 38 42 36.2091 42 34V16ZM12 14H38C39.1046 14 40 14.8954 40 16V19H10V16C10 14.8954 10.8954 14 12 14ZM10 34V23H40V34C40 35.1046 39.1046 36 38 36H12C10.8954 36 10 35.1046 10 34ZM15 30H21V32H15V30Z" fill={color} />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|