@salifbiaye/create-boutique 0.1.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/README.md +1 -0
- package/cli/dist/commands.js +382 -0
- package/cli/dist/create.js +194 -0
- package/cli/dist/docker.js +19 -0
- package/cli/dist/generate.js +322 -0
- package/cli/dist/guide.js +72 -0
- package/cli/dist/index.js +156 -0
- package/cli/dist/paths.js +29 -0
- package/cli/dist/ports.js +54 -0
- package/cli/dist/project.js +119 -0
- package/cli/dist/themes.js +24 -0
- package/docs/fiche-client.en.html +137 -0
- package/docs/fiche-client.html +137 -0
- package/docs/guide-complet.en.html +259 -0
- package/docs/guide-complet.fr.html +259 -0
- package/package.json +51 -0
- package/templates/backend/.dockerignore +9 -0
- package/templates/backend/Dockerfile +30 -0
- package/templates/backend/README.md +78 -0
- package/templates/backend/TEMPLATE_VERSION +1 -0
- package/templates/backend/docker/entrypoint.sh +28 -0
- package/templates/backend/instrumentation.ts +24 -0
- package/templates/backend/medusa-config.ts +114 -0
- package/templates/backend/package-lock.json +16222 -0
- package/templates/backend/package.json +39 -0
- package/templates/backend/src/admin/README.md +33 -0
- package/templates/backend/src/admin/components/image-field.tsx +61 -0
- package/templates/backend/src/admin/i18n/README.md +58 -0
- package/templates/backend/src/admin/i18n/index.ts +8 -0
- package/templates/backend/src/admin/i18n/json/en.json +66 -0
- package/templates/backend/src/admin/i18n/json/fr.json +66 -0
- package/templates/backend/src/admin/lib/client.ts +9 -0
- package/templates/backend/src/admin/routes/boutique-campaigns/campaign-drawer.tsx +286 -0
- package/templates/backend/src/admin/routes/boutique-campaigns/page.tsx +113 -0
- package/templates/backend/src/admin/tsconfig.json +24 -0
- package/templates/backend/src/admin/vite-env.d.ts +1 -0
- package/templates/backend/src/admin/widgets/category-image.tsx +56 -0
- package/templates/backend/src/api/README.md +135 -0
- package/templates/backend/src/api/admin/boutique-campaigns/[salesChannelId]/route.ts +30 -0
- package/templates/backend/src/api/admin/boutique-campaigns/route.ts +24 -0
- package/templates/backend/src/api/middlewares.ts +28 -0
- package/templates/backend/src/api/rate-limit.ts +30 -0
- package/templates/backend/src/api/route.ts +6 -0
- package/templates/backend/src/api/store/campaign/route.ts +25 -0
- package/templates/backend/src/api/store/order-lookup/route.ts +74 -0
- package/templates/backend/src/emails/en.json +64 -0
- package/templates/backend/src/emails/fr.json +64 -0
- package/templates/backend/src/jobs/README.md +38 -0
- package/templates/backend/src/lib/emails.ts +94 -0
- package/templates/backend/src/lib/notify.ts +148 -0
- package/templates/backend/src/lib/project.ts +146 -0
- package/templates/backend/src/links/README.md +26 -0
- package/templates/backend/src/links/campaign-sales-channel.ts +9 -0
- package/templates/backend/src/modules/README.md +117 -0
- package/templates/backend/src/modules/campaign/index.ts +9 -0
- package/templates/backend/src/modules/campaign/migrations/.snapshot-boutique-campaign.json +272 -0
- package/templates/backend/src/modules/campaign/migrations/Migration20260928141440.ts +16 -0
- package/templates/backend/src/modules/campaign/migrations/Migration20260928145243.ts +13 -0
- package/templates/backend/src/modules/campaign/models/campaign.ts +28 -0
- package/templates/backend/src/modules/campaign/service.ts +6 -0
- package/templates/backend/src/modules/campaign/validators.ts +94 -0
- package/templates/backend/src/modules/resend/index.ts +6 -0
- package/templates/backend/src/modules/resend/service.ts +63 -0
- package/templates/backend/src/scripts/README.md +63 -0
- package/templates/backend/src/scripts/campaign-export.ts +15 -0
- package/templates/backend/src/scripts/campaign-import.ts +38 -0
- package/templates/backend/src/scripts/price-report.ts +34 -0
- package/templates/backend/src/scripts/seed.ts +418 -0
- package/templates/backend/src/scripts/storage.ts +63 -0
- package/templates/backend/src/subscribers/README.md +61 -0
- package/templates/backend/src/subscribers/account-emails.ts +27 -0
- package/templates/backend/src/subscribers/fulfillment-emails.ts +42 -0
- package/templates/backend/src/subscribers/order-emails.ts +12 -0
- package/templates/backend/src/subscribers/return-refund-emails.ts +50 -0
- package/templates/backend/src/workflows/README.md +81 -0
- package/templates/backend/src/workflows/steps/upsert-campaign.ts +53 -0
- package/templates/backend/src/workflows/upsert-campaign.ts +30 -0
- package/templates/backend/tsconfig.json +36 -0
- package/templates/storefront/.dockerignore +7 -0
- package/templates/storefront/.github/ISSUE_TEMPLATE/bug-report.yml +71 -0
- package/templates/storefront/.prettierrc +8 -0
- package/templates/storefront/Dockerfile +37 -0
- package/templates/storefront/LICENSE +21 -0
- package/templates/storefront/README.md +127 -0
- package/templates/storefront/locales/en.json +269 -0
- package/templates/storefront/locales/fr.json +269 -0
- package/templates/storefront/next-env.d.ts +7 -0
- package/templates/storefront/next-sitemap.js +19 -0
- package/templates/storefront/next.config.js +29 -0
- package/templates/storefront/package-lock.json +9031 -0
- package/templates/storefront/package.json +49 -0
- package/templates/storefront/postcss.config.js +6 -0
- package/templates/storefront/public/favicon.ico +0 -0
- package/templates/storefront/scripts/sync-design.mjs +30 -0
- package/templates/storefront/src/app/(checkout)/checkout/page.tsx +31 -0
- package/templates/storefront/src/app/(checkout)/layout.tsx +29 -0
- package/templates/storefront/src/app/(checkout)/not-found.tsx +20 -0
- package/templates/storefront/src/app/(main)/account/@dashboard/addresses/page.tsx +34 -0
- package/templates/storefront/src/app/(main)/account/@dashboard/loading.tsx +9 -0
- package/templates/storefront/src/app/(main)/account/@dashboard/orders/details/[id]/page.tsx +33 -0
- package/templates/storefront/src/app/(main)/account/@dashboard/orders/page.tsx +37 -0
- package/templates/storefront/src/app/(main)/account/@dashboard/page.tsx +22 -0
- package/templates/storefront/src/app/(main)/account/@dashboard/profile/page.tsx +53 -0
- package/templates/storefront/src/app/(main)/account/@login/page.tsx +12 -0
- package/templates/storefront/src/app/(main)/account/layout.tsx +20 -0
- package/templates/storefront/src/app/(main)/account/loading.tsx +9 -0
- package/templates/storefront/src/app/(main)/cart/loading.tsx +5 -0
- package/templates/storefront/src/app/(main)/cart/not-found.tsx +21 -0
- package/templates/storefront/src/app/(main)/cart/page.tsx +21 -0
- package/templates/storefront/src/app/(main)/categories/[...category]/page.tsx +55 -0
- package/templates/storefront/src/app/(main)/collections/[handle]/page.tsx +55 -0
- package/templates/storefront/src/app/(main)/layout.tsx +43 -0
- package/templates/storefront/src/app/(main)/legal/[page]/page.tsx +42 -0
- package/templates/storefront/src/app/(main)/not-found.tsx +21 -0
- package/templates/storefront/src/app/(main)/order/[id]/confirmed/loading.tsx +5 -0
- package/templates/storefront/src/app/(main)/order/[id]/confirmed/page.tsx +23 -0
- package/templates/storefront/src/app/(main)/order/[id]/transfer/[token]/accept/page.tsx +42 -0
- package/templates/storefront/src/app/(main)/order/[id]/transfer/[token]/decline/page.tsx +42 -0
- package/templates/storefront/src/app/(main)/order/[id]/transfer/[token]/page.tsx +35 -0
- package/templates/storefront/src/app/(main)/order/track/page.tsx +32 -0
- package/templates/storefront/src/app/(main)/page.tsx +68 -0
- package/templates/storefront/src/app/(main)/products/[handle]/page.tsx +86 -0
- package/templates/storefront/src/app/(main)/store/page.tsx +28 -0
- package/templates/storefront/src/app/api/health/route.ts +13 -0
- package/templates/storefront/src/app/layout.tsx +42 -0
- package/templates/storefront/src/app/not-found.tsx +21 -0
- package/templates/storefront/src/app/opengraph-image.jpg +0 -0
- package/templates/storefront/src/app/twitter-image.jpg +0 -0
- package/templates/storefront/src/instrumentation-node.ts +18 -0
- package/templates/storefront/src/instrumentation.ts +9 -0
- package/templates/storefront/src/lib/boutique/campaign.ts +116 -0
- package/templates/storefront/src/lib/boutique/config.ts +152 -0
- package/templates/storefront/src/lib/boutique/fonts.ts +29 -0
- package/templates/storefront/src/lib/boutique/i18n-client.tsx +34 -0
- package/templates/storefront/src/lib/boutique/i18n.ts +43 -0
- package/templates/storefront/src/lib/boutique/schema.ts +131 -0
- package/templates/storefront/src/lib/config.ts +39 -0
- package/templates/storefront/src/lib/constants.tsx +75 -0
- package/templates/storefront/src/lib/context/modal-context.tsx +34 -0
- package/templates/storefront/src/lib/data/cart.ts +434 -0
- package/templates/storefront/src/lib/data/categories.ts +49 -0
- package/templates/storefront/src/lib/data/collections.ts +59 -0
- package/templates/storefront/src/lib/data/cookies.ts +103 -0
- package/templates/storefront/src/lib/data/customer.ts +261 -0
- package/templates/storefront/src/lib/data/fulfillment.ts +68 -0
- package/templates/storefront/src/lib/data/onboarding.ts +9 -0
- package/templates/storefront/src/lib/data/order-lookup.ts +34 -0
- package/templates/storefront/src/lib/data/orders.ts +112 -0
- package/templates/storefront/src/lib/data/payment.ts +35 -0
- package/templates/storefront/src/lib/data/products.ts +127 -0
- package/templates/storefront/src/lib/data/regions.ts +70 -0
- package/templates/storefront/src/lib/data/variants.ts +38 -0
- package/templates/storefront/src/lib/hooks/use-in-view.tsx +29 -0
- package/templates/storefront/src/lib/hooks/use-toggle-state.tsx +46 -0
- package/templates/storefront/src/lib/util/compare-addresses.ts +28 -0
- package/templates/storefront/src/lib/util/get-percentage-diff.ts +6 -0
- package/templates/storefront/src/lib/util/get-product-price.ts +79 -0
- package/templates/storefront/src/lib/util/isEmpty.ts +11 -0
- package/templates/storefront/src/lib/util/medusa-error.ts +22 -0
- package/templates/storefront/src/lib/util/money.ts +35 -0
- package/templates/storefront/src/lib/util/product.ts +5 -0
- package/templates/storefront/src/lib/util/repeat.ts +5 -0
- package/templates/storefront/src/lib/util/sort-products.ts +50 -0
- package/templates/storefront/src/modules/account/components/account-info/index.tsx +140 -0
- package/templates/storefront/src/modules/account/components/account-nav/index.tsx +198 -0
- package/templates/storefront/src/modules/account/components/address-book/index.tsx +28 -0
- package/templates/storefront/src/modules/account/components/address-card/add-address.tsx +169 -0
- package/templates/storefront/src/modules/account/components/address-card/edit-address-modal.tsx +241 -0
- package/templates/storefront/src/modules/account/components/login/index.tsx +65 -0
- package/templates/storefront/src/modules/account/components/order-card/index.tsx +88 -0
- package/templates/storefront/src/modules/account/components/order-overview/index.tsx +47 -0
- package/templates/storefront/src/modules/account/components/overview/index.tsx +169 -0
- package/templates/storefront/src/modules/account/components/profile-billing-address/index.tsx +193 -0
- package/templates/storefront/src/modules/account/components/profile-email/index.tsx +75 -0
- package/templates/storefront/src/modules/account/components/profile-name/index.tsx +79 -0
- package/templates/storefront/src/modules/account/components/profile-password/index.tsx +72 -0
- package/templates/storefront/src/modules/account/components/profile-phone/index.tsx +74 -0
- package/templates/storefront/src/modules/account/components/register/index.tsx +107 -0
- package/templates/storefront/src/modules/account/components/transfer-request-form/index.tsx +83 -0
- package/templates/storefront/src/modules/account/templates/account-layout.tsx +43 -0
- package/templates/storefront/src/modules/account/templates/login-template.tsx +27 -0
- package/templates/storefront/src/modules/cart/components/cart-item-select/index.tsx +75 -0
- package/templates/storefront/src/modules/cart/components/empty-cart-message/index.tsx +25 -0
- package/templates/storefront/src/modules/cart/components/item/index.tsx +144 -0
- package/templates/storefront/src/modules/cart/components/sign-in-prompt/index.tsx +27 -0
- package/templates/storefront/src/modules/cart/templates/index.tsx +51 -0
- package/templates/storefront/src/modules/cart/templates/items.tsx +58 -0
- package/templates/storefront/src/modules/cart/templates/preview.tsx +51 -0
- package/templates/storefront/src/modules/cart/templates/summary.tsx +50 -0
- package/templates/storefront/src/modules/categories/templates/index.tsx +94 -0
- package/templates/storefront/src/modules/checkout/components/address-select/index.tsx +117 -0
- package/templates/storefront/src/modules/checkout/components/addresses/index.tsx +186 -0
- package/templates/storefront/src/modules/checkout/components/billing_address/index.tsx +114 -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 +181 -0
- package/templates/storefront/src/modules/checkout/components/error-message/index.tsx +13 -0
- package/templates/storefront/src/modules/checkout/components/payment/index.tsx +261 -0
- package/templates/storefront/src/modules/checkout/components/payment-button/index.tsx +195 -0
- package/templates/storefront/src/modules/checkout/components/payment-container/index.tsx +130 -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 +42 -0
- package/templates/storefront/src/modules/checkout/components/payment-wrapper/stripe-wrapper.tsx +54 -0
- package/templates/storefront/src/modules/checkout/components/review/index.tsx +54 -0
- package/templates/storefront/src/modules/checkout/components/shipping/index.tsx +417 -0
- package/templates/storefront/src/modules/checkout/components/shipping-address/index.tsx +219 -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 +31 -0
- package/templates/storefront/src/modules/collections/templates/index.tsx +44 -0
- package/templates/storefront/src/modules/common/components/cart-totals/index.tsx +84 -0
- package/templates/storefront/src/modules/common/components/checkbox/index.tsx +44 -0
- package/templates/storefront/src/modules/common/components/delete-button/index.tsx +42 -0
- package/templates/storefront/src/modules/common/components/divider/index.tsx +9 -0
- package/templates/storefront/src/modules/common/components/filter-radio-group/index.tsx +61 -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 +63 -0
- package/templates/storefront/src/modules/common/components/line-item-unit-price/index.tsx +62 -0
- package/templates/storefront/src/modules/common/components/localized-client-link/index.tsx +29 -0
- package/templates/storefront/src/modules/common/components/modal/index.tsx +118 -0
- package/templates/storefront/src/modules/common/components/native-select/index.tsx +76 -0
- package/templates/storefront/src/modules/common/components/radio/index.tsx +27 -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/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/map-pin.tsx +37 -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/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/layout/components/cart-mismatch-banner/index.tsx +59 -0
- package/templates/storefront/src/modules/order/components/help/index.tsx +26 -0
- package/templates/storefront/src/modules/order/components/item/index.tsx +57 -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-details/index.tsx +64 -0
- package/templates/storefront/src/modules/order/components/order-summary/index.tsx +61 -0
- package/templates/storefront/src/modules/order/components/payment-details/index.tsx +64 -0
- package/templates/storefront/src/modules/order/components/shipping-details/index.tsx +74 -0
- package/templates/storefront/src/modules/order/components/transfer-actions/index.tsx +83 -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 +53 -0
- package/templates/storefront/src/modules/order/templates/order-details-template.tsx +46 -0
- package/templates/storefront/src/modules/products/components/thumbnail/index.tsx +70 -0
- package/templates/storefront/src/modules/products/templates/index.tsx +118 -0
- package/templates/storefront/src/modules/shipping/components/free-shipping-price-nudge/index.tsx +285 -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/store/components/pagination/index.tsx +114 -0
- package/templates/storefront/src/modules/store/components/refinement-list/index.tsx +41 -0
- package/templates/storefront/src/modules/store/components/refinement-list/sort-products/index.tsx +48 -0
- package/templates/storefront/src/modules/store/templates/index.tsx +42 -0
- package/templates/storefront/src/modules/store/templates/paginated-products.tsx +80 -0
- package/templates/storefront/src/modules/ub/button.tsx +41 -0
- package/templates/storefront/src/modules/ub/campaign-blocks.tsx +197 -0
- package/templates/storefront/src/modules/ub/campaign-ended.tsx +28 -0
- package/templates/storefront/src/modules/ub/category-tiles.tsx +41 -0
- package/templates/storefront/src/modules/ub/countdown.tsx +46 -0
- package/templates/storefront/src/modules/ub/footer.tsx +56 -0
- package/templates/storefront/src/modules/ub/icons.tsx +42 -0
- package/templates/storefront/src/modules/ub/nav.tsx +90 -0
- package/templates/storefront/src/modules/ub/pdp/buy-box.tsx +140 -0
- package/templates/storefront/src/modules/ub/pdp/gallery.tsx +40 -0
- package/templates/storefront/src/modules/ub/product-card.tsx +66 -0
- package/templates/storefront/src/modules/ub/top-bar.tsx +20 -0
- package/templates/storefront/src/modules/ub/track-form.tsx +92 -0
- package/templates/storefront/src/proxy.ts +89 -0
- package/templates/storefront/src/styles/globals.css +98 -0
- package/templates/storefront/src/styles/ub/bundle.css +372 -0
- package/templates/storefront/src/styles/ub/fonts.css +17 -0
- package/templates/storefront/src/styles/ub/medusa-ui.css +90 -0
- package/templates/storefront/src/styles/ub/overrides.css +12 -0
- package/templates/storefront/src/styles/ub/tokens.css +9 -0
- package/templates/storefront/src/types/global.ts +24 -0
- package/templates/storefront/src/types/icon.ts +4 -0
- package/templates/storefront/tailwind.config.js +164 -0
- package/templates/storefront/themes/black-friday/campaign.en.json +31 -0
- package/templates/storefront/themes/black-friday/campaign.fr.json +31 -0
- package/templates/storefront/themes/black-friday/theme.json +9 -0
- package/templates/storefront/themes/cyber-monday/campaign.en.json +31 -0
- package/templates/storefront/themes/cyber-monday/campaign.fr.json +31 -0
- package/templates/storefront/themes/cyber-monday/theme.json +9 -0
- package/templates/storefront/themes/halloween/campaign.en.json +31 -0
- package/templates/storefront/themes/halloween/campaign.fr.json +31 -0
- package/templates/storefront/themes/halloween/theme.json +9 -0
- package/templates/storefront/themes/noel/campaign.en.json +31 -0
- package/templates/storefront/themes/noel/campaign.fr.json +31 -0
- package/templates/storefront/themes/noel/theme.json +9 -0
- package/templates/storefront/themes/nouvel-an/campaign.en.json +31 -0
- package/templates/storefront/themes/nouvel-an/campaign.fr.json +31 -0
- package/templates/storefront/themes/nouvel-an/theme.json +9 -0
- package/templates/storefront/themes/thanksgiving/campaign.en.json +31 -0
- package/templates/storefront/themes/thanksgiving/campaign.fr.json +31 -0
- package/templates/storefront/themes/thanksgiving/theme.json +9 -0
- package/templates/storefront/tsconfig.json +53 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useActionState } from "react";
|
|
4
|
+
|
|
5
|
+
import Input from "@modules/common/components/input"
|
|
6
|
+
|
|
7
|
+
import AccountInfo from "../account-info"
|
|
8
|
+
import { HttpTypes } from "@medusajs/types"
|
|
9
|
+
import { updateCustomer } from "@lib/data/customer"
|
|
10
|
+
|
|
11
|
+
type MyInformationProps = {
|
|
12
|
+
customer: HttpTypes.StoreCustomer
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ProfileName: React.FC<MyInformationProps> = ({ customer }) => {
|
|
16
|
+
const [successState, setSuccessState] = React.useState(false)
|
|
17
|
+
|
|
18
|
+
const updateCustomerName = async (
|
|
19
|
+
_currentState: Record<string, unknown>,
|
|
20
|
+
formData: FormData
|
|
21
|
+
) => {
|
|
22
|
+
const customer = {
|
|
23
|
+
first_name: formData.get("first_name") as string,
|
|
24
|
+
last_name: formData.get("last_name") as string,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
await updateCustomer(customer)
|
|
29
|
+
return { success: true, error: null }
|
|
30
|
+
} catch (error: any) {
|
|
31
|
+
return { success: false, error: error.toString() }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const [state, formAction] = useActionState(updateCustomerName, {
|
|
36
|
+
error: false,
|
|
37
|
+
success: false,
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const clearState = () => {
|
|
41
|
+
setSuccessState(false)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
setSuccessState(state.success)
|
|
46
|
+
}, [state])
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<form action={formAction} className="w-full overflow-visible">
|
|
50
|
+
<AccountInfo
|
|
51
|
+
label="form.name"
|
|
52
|
+
currentInfo={`${customer.first_name} ${customer.last_name}`}
|
|
53
|
+
isSuccess={successState}
|
|
54
|
+
isError={!!state?.error}
|
|
55
|
+
clearState={clearState}
|
|
56
|
+
data-testid="account-name-editor"
|
|
57
|
+
>
|
|
58
|
+
<div className="grid grid-cols-2 gap-x-4">
|
|
59
|
+
<Input
|
|
60
|
+
label="form.firstName"
|
|
61
|
+
name="first_name"
|
|
62
|
+
required
|
|
63
|
+
defaultValue={customer.first_name ?? ""}
|
|
64
|
+
data-testid="first-name-input"
|
|
65
|
+
/>
|
|
66
|
+
<Input
|
|
67
|
+
label="form.lastName"
|
|
68
|
+
name="last_name"
|
|
69
|
+
required
|
|
70
|
+
defaultValue={customer.last_name ?? ""}
|
|
71
|
+
data-testid="last-name-input"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
</AccountInfo>
|
|
75
|
+
</form>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default ProfileName
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
5
|
+
import React, { useEffect, useActionState } from "react"
|
|
6
|
+
import Input from "@modules/common/components/input"
|
|
7
|
+
import AccountInfo from "../account-info"
|
|
8
|
+
import { HttpTypes } from "@medusajs/types"
|
|
9
|
+
import { toast } from "@medusajs/ui"
|
|
10
|
+
|
|
11
|
+
type MyInformationProps = {
|
|
12
|
+
customer: HttpTypes.StoreCustomer
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ProfilePassword: React.FC<MyInformationProps> = ({ customer }) => {
|
|
16
|
+
const [successState, setSuccessState] = React.useState(false)
|
|
17
|
+
|
|
18
|
+
// TODO: Add support for password updates
|
|
19
|
+
const updatePassword = async () => {
|
|
20
|
+
toast.info("Password update is not implemented")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const clearState = () => {
|
|
24
|
+
setSuccessState(false)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<form
|
|
29
|
+
action={updatePassword}
|
|
30
|
+
onReset={() => clearState()}
|
|
31
|
+
className="w-full"
|
|
32
|
+
>
|
|
33
|
+
<AccountInfo
|
|
34
|
+
label="form.password"
|
|
35
|
+
currentInfo={
|
|
36
|
+
<span><T k="account.passwordHidden" /></span>
|
|
37
|
+
}
|
|
38
|
+
isSuccess={successState}
|
|
39
|
+
isError={false}
|
|
40
|
+
errorMessage={undefined}
|
|
41
|
+
clearState={clearState}
|
|
42
|
+
data-testid="account-password-editor"
|
|
43
|
+
>
|
|
44
|
+
<div className="grid grid-cols-2 gap-4">
|
|
45
|
+
<Input
|
|
46
|
+
label="form.oldPassword"
|
|
47
|
+
name="old_password"
|
|
48
|
+
required
|
|
49
|
+
type="password"
|
|
50
|
+
data-testid="old-password-input"
|
|
51
|
+
/>
|
|
52
|
+
<Input
|
|
53
|
+
label="form.newPassword"
|
|
54
|
+
type="password"
|
|
55
|
+
name="new_password"
|
|
56
|
+
required
|
|
57
|
+
data-testid="new-password-input"
|
|
58
|
+
/>
|
|
59
|
+
<Input
|
|
60
|
+
label="form.confirmPassword"
|
|
61
|
+
type="password"
|
|
62
|
+
name="confirm_password"
|
|
63
|
+
required
|
|
64
|
+
data-testid="confirm-password-input"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</AccountInfo>
|
|
68
|
+
</form>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default ProfilePassword
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useActionState } from "react";
|
|
4
|
+
|
|
5
|
+
import Input from "@modules/common/components/input"
|
|
6
|
+
|
|
7
|
+
import AccountInfo from "../account-info"
|
|
8
|
+
import { HttpTypes } from "@medusajs/types"
|
|
9
|
+
import { updateCustomer } from "@lib/data/customer"
|
|
10
|
+
|
|
11
|
+
type MyInformationProps = {
|
|
12
|
+
customer: HttpTypes.StoreCustomer
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ProfileEmail: React.FC<MyInformationProps> = ({ customer }) => {
|
|
16
|
+
const [successState, setSuccessState] = React.useState(false)
|
|
17
|
+
|
|
18
|
+
const updateCustomerPhone = async (
|
|
19
|
+
_currentState: Record<string, unknown>,
|
|
20
|
+
formData: FormData
|
|
21
|
+
) => {
|
|
22
|
+
const customer = {
|
|
23
|
+
phone: formData.get("phone") as string,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
await updateCustomer(customer)
|
|
28
|
+
return { success: true, error: null }
|
|
29
|
+
} catch (error: any) {
|
|
30
|
+
return { success: false, error: error.toString() }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const [state, formAction] = useActionState(updateCustomerPhone, {
|
|
35
|
+
error: false,
|
|
36
|
+
success: false,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const clearState = () => {
|
|
40
|
+
setSuccessState(false)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setSuccessState(state.success)
|
|
45
|
+
}, [state])
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<form action={formAction} className="w-full">
|
|
49
|
+
<AccountInfo
|
|
50
|
+
label="form.phone"
|
|
51
|
+
currentInfo={`${customer.phone}`}
|
|
52
|
+
isSuccess={successState}
|
|
53
|
+
isError={!!state.error}
|
|
54
|
+
errorMessage={state.error}
|
|
55
|
+
clearState={clearState}
|
|
56
|
+
data-testid="account-phone-editor"
|
|
57
|
+
>
|
|
58
|
+
<div className="grid grid-cols-1 gap-y-2">
|
|
59
|
+
<Input
|
|
60
|
+
label="form.phone"
|
|
61
|
+
name="phone"
|
|
62
|
+
type="phone"
|
|
63
|
+
autoComplete="phone"
|
|
64
|
+
required
|
|
65
|
+
defaultValue={customer.phone ?? ""}
|
|
66
|
+
data-testid="phone-input"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</AccountInfo>
|
|
70
|
+
</form>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default ProfileEmail
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
5
|
+
import { useActionState } from "react"
|
|
6
|
+
import Input from "@modules/common/components/input"
|
|
7
|
+
import { LOGIN_VIEW } from "@modules/account/templates/login-template"
|
|
8
|
+
import ErrorMessage from "@modules/checkout/components/error-message"
|
|
9
|
+
import { SubmitButton } from "@modules/checkout/components/submit-button"
|
|
10
|
+
import LocalizedClientLink from "@modules/common/components/localized-client-link"
|
|
11
|
+
import { signup } from "@lib/data/customer"
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
setCurrentView: (view: LOGIN_VIEW) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Register = ({ setCurrentView }: Props) => {
|
|
18
|
+
const [message, formAction] = useActionState(signup, null)
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
className="max-w-sm flex flex-col items-center"
|
|
23
|
+
data-testid="register-page"
|
|
24
|
+
>
|
|
25
|
+
<h1 className="text-large-semi uppercase mb-6">
|
|
26
|
+
<T k="account.becomeMember" />
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="text-center text-base-regular text-ui-fg-base mb-4">
|
|
29
|
+
<T k="account.registerText" />
|
|
30
|
+
</p>
|
|
31
|
+
<form className="w-full flex flex-col" action={formAction}>
|
|
32
|
+
<div className="flex flex-col w-full gap-y-2">
|
|
33
|
+
<Input
|
|
34
|
+
label="form.firstName"
|
|
35
|
+
name="first_name"
|
|
36
|
+
required
|
|
37
|
+
autoComplete="given-name"
|
|
38
|
+
data-testid="first-name-input"
|
|
39
|
+
/>
|
|
40
|
+
<Input
|
|
41
|
+
label="form.lastName"
|
|
42
|
+
name="last_name"
|
|
43
|
+
required
|
|
44
|
+
autoComplete="family-name"
|
|
45
|
+
data-testid="last-name-input"
|
|
46
|
+
/>
|
|
47
|
+
<Input
|
|
48
|
+
label="form.email"
|
|
49
|
+
name="email"
|
|
50
|
+
required
|
|
51
|
+
type="email"
|
|
52
|
+
autoComplete="email"
|
|
53
|
+
data-testid="email-input"
|
|
54
|
+
/>
|
|
55
|
+
<Input
|
|
56
|
+
label="form.phone"
|
|
57
|
+
name="phone"
|
|
58
|
+
type="tel"
|
|
59
|
+
autoComplete="tel"
|
|
60
|
+
data-testid="phone-input"
|
|
61
|
+
/>
|
|
62
|
+
<Input
|
|
63
|
+
label="form.password"
|
|
64
|
+
name="password"
|
|
65
|
+
required
|
|
66
|
+
type="password"
|
|
67
|
+
autoComplete="new-password"
|
|
68
|
+
data-testid="password-input"
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
<ErrorMessage error={message} data-testid="register-error" />
|
|
72
|
+
<span className="text-center text-ui-fg-base text-small-regular mt-6">
|
|
73
|
+
<T k="account.agree" />{" "}
|
|
74
|
+
<LocalizedClientLink
|
|
75
|
+
href="/content/privacy-policy"
|
|
76
|
+
className="underline"
|
|
77
|
+
>
|
|
78
|
+
<T k="account.privacy" />
|
|
79
|
+
</LocalizedClientLink>{" "}
|
|
80
|
+
{" "}<T k="account.and" />{" "}
|
|
81
|
+
<LocalizedClientLink
|
|
82
|
+
href="/content/terms-of-use"
|
|
83
|
+
className="underline"
|
|
84
|
+
>
|
|
85
|
+
<T k="account.terms" />
|
|
86
|
+
</LocalizedClientLink>
|
|
87
|
+
.
|
|
88
|
+
</span>
|
|
89
|
+
<SubmitButton className="w-full mt-6" data-testid="register-button">
|
|
90
|
+
<T k="account.join" />
|
|
91
|
+
</SubmitButton>
|
|
92
|
+
</form>
|
|
93
|
+
<span className="text-center text-ui-fg-base text-small-regular mt-6">
|
|
94
|
+
<T k="account.alreadyMember" />{" "}
|
|
95
|
+
<button
|
|
96
|
+
onClick={() => setCurrentView(LOGIN_VIEW.SIGN_IN)}
|
|
97
|
+
className="underline"
|
|
98
|
+
>
|
|
99
|
+
<T k="account.signIn" />
|
|
100
|
+
</button>
|
|
101
|
+
.
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default Register
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
5
|
+
import { useActionState } from "react"
|
|
6
|
+
import { createTransferRequest } from "@lib/data/orders"
|
|
7
|
+
import { Text, Heading, Input, Button, IconButton, Toaster } from "@medusajs/ui"
|
|
8
|
+
import { SubmitButton } from "@modules/checkout/components/submit-button"
|
|
9
|
+
import { CheckCircleMiniSolid, XCircleSolid } from "@medusajs/icons"
|
|
10
|
+
import { useEffect, useState } from "react"
|
|
11
|
+
|
|
12
|
+
export default function TransferRequestForm() {
|
|
13
|
+
const [showSuccess, setShowSuccess] = useState(false)
|
|
14
|
+
|
|
15
|
+
const [state, formAction] = useActionState(createTransferRequest, {
|
|
16
|
+
success: false,
|
|
17
|
+
error: null,
|
|
18
|
+
order: null,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (state.success && state.order) {
|
|
23
|
+
setShowSuccess(true)
|
|
24
|
+
}
|
|
25
|
+
}, [state.success, state.order])
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex flex-col gap-y-4 w-full">
|
|
29
|
+
<div className="grid sm:grid-cols-2 items-center gap-x-8 gap-y-4 w-full">
|
|
30
|
+
<div className="flex flex-col gap-y-1">
|
|
31
|
+
<Heading level="h3" className="text-lg text-neutral-950">
|
|
32
|
+
<T k="account.orderTransfers" />
|
|
33
|
+
</Heading>
|
|
34
|
+
<Text className="text-base-regular text-neutral-500">
|
|
35
|
+
<T k="account.cantFind" />
|
|
36
|
+
<br /> <T k="account.connectOrder" />
|
|
37
|
+
</Text>
|
|
38
|
+
</div>
|
|
39
|
+
<form
|
|
40
|
+
action={formAction}
|
|
41
|
+
className="flex flex-col gap-y-1 sm:items-end"
|
|
42
|
+
>
|
|
43
|
+
<div className="flex flex-col gap-y-2 w-full">
|
|
44
|
+
<Input className="w-full" name="order_id" placeholder="Order ID" />
|
|
45
|
+
<SubmitButton
|
|
46
|
+
variant="secondary"
|
|
47
|
+
className="w-fit whitespace-nowrap self-end"
|
|
48
|
+
>
|
|
49
|
+
<T k="account.requestTransfer" />
|
|
50
|
+
</SubmitButton>
|
|
51
|
+
</div>
|
|
52
|
+
</form>
|
|
53
|
+
</div>
|
|
54
|
+
{!state.success && state.error && (
|
|
55
|
+
<Text className="text-base-regular text-rose-500 text-right">
|
|
56
|
+
{state.error}
|
|
57
|
+
</Text>
|
|
58
|
+
)}
|
|
59
|
+
{showSuccess && (
|
|
60
|
+
<div className="flex justify-between p-4 bg-neutral-50 shadow-borders-base w-full self-stretch items-center">
|
|
61
|
+
<div className="flex gap-x-2 items-center">
|
|
62
|
+
<CheckCircleMiniSolid className="w-4 h-4 text-emerald-500" />
|
|
63
|
+
<div className="flex flex-col gap-y-1">
|
|
64
|
+
<Text className="text-medim-pl text-neutral-950">
|
|
65
|
+
Transfer for order {state.order?.id} requested
|
|
66
|
+
</Text>
|
|
67
|
+
<Text className="text-base-regular text-neutral-600">
|
|
68
|
+
Transfer request email sent to {state.order?.email}
|
|
69
|
+
</Text>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<IconButton
|
|
73
|
+
variant="transparent"
|
|
74
|
+
className="h-fit"
|
|
75
|
+
onClick={() => setShowSuccess(false)}
|
|
76
|
+
>
|
|
77
|
+
<XCircleSolid className="w-4 h-4 text-neutral-500" />
|
|
78
|
+
</IconButton>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
2
|
+
import React from "react"
|
|
3
|
+
|
|
4
|
+
import UnderlineLink from "@modules/common/components/interactive-link"
|
|
5
|
+
|
|
6
|
+
import AccountNav from "../components/account-nav"
|
|
7
|
+
import { HttpTypes } from "@medusajs/types"
|
|
8
|
+
|
|
9
|
+
interface AccountLayoutProps {
|
|
10
|
+
customer: HttpTypes.StoreCustomer | null
|
|
11
|
+
children: React.ReactNode
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const AccountLayout: React.FC<AccountLayoutProps> = ({
|
|
15
|
+
customer,
|
|
16
|
+
children,
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex-1 small:py-12" data-testid="account-page">
|
|
20
|
+
<div className="flex-1 content-container h-full max-w-5xl mx-auto bg-white flex flex-col">
|
|
21
|
+
<div className="grid grid-cols-1 small:grid-cols-[240px_1fr] py-12">
|
|
22
|
+
<div>{customer && <AccountNav customer={customer} />}</div>
|
|
23
|
+
<div className="flex-1">{children}</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div className="flex flex-col small:flex-row items-end justify-between small:border-t border-gray-200 py-12 gap-8">
|
|
26
|
+
<div>
|
|
27
|
+
<h3 className="text-xl-semi mb-4"><T k="account.questions" /></h3>
|
|
28
|
+
<span className="txt-medium">
|
|
29
|
+
<T k="account.questionsText" />
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<UnderlineLink href="/legal/contact">
|
|
34
|
+
<T k="account.contactUs" />
|
|
35
|
+
</UnderlineLink>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default AccountLayout
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useState } from "react"
|
|
4
|
+
|
|
5
|
+
import Register from "@modules/account/components/register"
|
|
6
|
+
import Login from "@modules/account/components/login"
|
|
7
|
+
|
|
8
|
+
export enum LOGIN_VIEW {
|
|
9
|
+
SIGN_IN = "sign-in",
|
|
10
|
+
REGISTER = "register",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const LoginTemplate = () => {
|
|
14
|
+
const [currentView, setCurrentView] = useState("sign-in")
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="w-full flex justify-start px-8 py-8">
|
|
18
|
+
{currentView === "sign-in" ? (
|
|
19
|
+
<Login setCurrentView={setCurrentView} />
|
|
20
|
+
) : (
|
|
21
|
+
<Register setCurrentView={setCurrentView} />
|
|
22
|
+
)}
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default LoginTemplate
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { IconBadge, clx } from "@medusajs/ui"
|
|
4
|
+
import {
|
|
5
|
+
SelectHTMLAttributes,
|
|
6
|
+
forwardRef,
|
|
7
|
+
useEffect,
|
|
8
|
+
useImperativeHandle,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from "react"
|
|
12
|
+
import { useT } from "@lib/boutique/i18n-client"
|
|
13
|
+
|
|
14
|
+
import ChevronDown from "@modules/common/icons/chevron-down"
|
|
15
|
+
|
|
16
|
+
type NativeSelectProps = {
|
|
17
|
+
placeholder?: string
|
|
18
|
+
errors?: Record<string, unknown>
|
|
19
|
+
touched?: Record<string, unknown>
|
|
20
|
+
} & Omit<SelectHTMLAttributes<HTMLSelectElement>, "size">
|
|
21
|
+
|
|
22
|
+
const CartItemSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
|
|
23
|
+
({ placeholder = "form.select", className, children, ...props }, ref) => {
|
|
24
|
+
const t = useT()
|
|
25
|
+
const innerRef = useRef<HTMLSelectElement>(null)
|
|
26
|
+
const [isPlaceholder, setIsPlaceholder] = useState(false)
|
|
27
|
+
|
|
28
|
+
useImperativeHandle<HTMLSelectElement | null, HTMLSelectElement | null>(
|
|
29
|
+
ref,
|
|
30
|
+
() => innerRef.current
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (innerRef.current && innerRef.current.value === "") {
|
|
35
|
+
setIsPlaceholder(true)
|
|
36
|
+
} else {
|
|
37
|
+
setIsPlaceholder(false)
|
|
38
|
+
}
|
|
39
|
+
}, [innerRef.current?.value])
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div>
|
|
43
|
+
<IconBadge
|
|
44
|
+
onFocus={() => innerRef.current?.focus()}
|
|
45
|
+
onBlur={() => innerRef.current?.blur()}
|
|
46
|
+
className={clx(
|
|
47
|
+
"relative flex items-center txt-compact-small border text-ui-fg-base group",
|
|
48
|
+
className,
|
|
49
|
+
{
|
|
50
|
+
"text-ui-fg-subtle": isPlaceholder,
|
|
51
|
+
}
|
|
52
|
+
)}
|
|
53
|
+
>
|
|
54
|
+
<select
|
|
55
|
+
ref={innerRef}
|
|
56
|
+
{...props}
|
|
57
|
+
className="appearance-none bg-transparent border-none px-4 transition-colors duration-150 focus:border-gray-700 outline-none w-16 h-16 items-center justify-center"
|
|
58
|
+
>
|
|
59
|
+
<option disabled value="">
|
|
60
|
+
{t(placeholder)}
|
|
61
|
+
</option>
|
|
62
|
+
{children}
|
|
63
|
+
</select>
|
|
64
|
+
<span className="absolute flex pointer-events-none justify-end w-8 group-hover:animate-pulse">
|
|
65
|
+
<ChevronDown />
|
|
66
|
+
</span>
|
|
67
|
+
</IconBadge>
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
CartItemSelect.displayName = "CartItemSelect"
|
|
74
|
+
|
|
75
|
+
export default CartItemSelect
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
2
|
+
import { Heading, Text } from "@medusajs/ui"
|
|
3
|
+
|
|
4
|
+
import InteractiveLink from "@modules/common/components/interactive-link"
|
|
5
|
+
|
|
6
|
+
const EmptyCartMessage = () => {
|
|
7
|
+
return (
|
|
8
|
+
<div className="py-48 px-2 flex flex-col justify-center items-start" data-testid="empty-cart-message">
|
|
9
|
+
<Heading
|
|
10
|
+
level="h1"
|
|
11
|
+
className="flex flex-row text-3xl-regular gap-x-2 items-baseline"
|
|
12
|
+
>
|
|
13
|
+
<T k="cart.title" />
|
|
14
|
+
</Heading>
|
|
15
|
+
<Text className="text-base-regular mt-4 mb-6 max-w-[32rem]">
|
|
16
|
+
<T k="cart.empty" />
|
|
17
|
+
</Text>
|
|
18
|
+
<div>
|
|
19
|
+
<InteractiveLink href="/store"><T k="cart.explore" /></InteractiveLink>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default EmptyCartMessage
|