@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,74 @@
|
|
|
1
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
2
|
+
import { convertToLocale } from "@lib/util/money"
|
|
3
|
+
import { HttpTypes } from "@medusajs/types"
|
|
4
|
+
import { Heading, Text } from "@medusajs/ui"
|
|
5
|
+
|
|
6
|
+
import Divider from "@modules/common/components/divider"
|
|
7
|
+
|
|
8
|
+
type ShippingDetailsProps = {
|
|
9
|
+
order: HttpTypes.StoreOrder
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const ShippingDetails = ({ order }: ShippingDetailsProps) => {
|
|
13
|
+
return (
|
|
14
|
+
<div>
|
|
15
|
+
<Heading level="h2" className="flex flex-row text-3xl-regular my-6">
|
|
16
|
+
<T k="order.delivery" />
|
|
17
|
+
</Heading>
|
|
18
|
+
<div className="flex items-start gap-x-8">
|
|
19
|
+
<div
|
|
20
|
+
className="flex flex-col w-1/3"
|
|
21
|
+
data-testid="shipping-address-summary"
|
|
22
|
+
>
|
|
23
|
+
<Text className="txt-medium-plus text-ui-fg-base mb-1">
|
|
24
|
+
<T k="order.shippingAddress" />
|
|
25
|
+
</Text>
|
|
26
|
+
<Text className="txt-medium text-ui-fg-subtle">
|
|
27
|
+
{order.shipping_address?.first_name}{" "}
|
|
28
|
+
{order.shipping_address?.last_name}
|
|
29
|
+
</Text>
|
|
30
|
+
<Text className="txt-medium text-ui-fg-subtle">
|
|
31
|
+
{order.shipping_address?.address_1}{" "}
|
|
32
|
+
{order.shipping_address?.address_2}
|
|
33
|
+
</Text>
|
|
34
|
+
<Text className="txt-medium text-ui-fg-subtle">
|
|
35
|
+
{order.shipping_address?.postal_code},{" "}
|
|
36
|
+
{order.shipping_address?.city}
|
|
37
|
+
</Text>
|
|
38
|
+
<Text className="txt-medium text-ui-fg-subtle">
|
|
39
|
+
{order.shipping_address?.country_code?.toUpperCase()}
|
|
40
|
+
</Text>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div
|
|
44
|
+
className="flex flex-col w-1/3 "
|
|
45
|
+
data-testid="shipping-contact-summary"
|
|
46
|
+
>
|
|
47
|
+
<Text className="txt-medium-plus text-ui-fg-base mb-1">Contact</Text>
|
|
48
|
+
<Text className="txt-medium text-ui-fg-subtle">
|
|
49
|
+
{order.shipping_address?.phone}
|
|
50
|
+
</Text>
|
|
51
|
+
<Text className="txt-medium text-ui-fg-subtle">{order.email}</Text>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div
|
|
55
|
+
className="flex flex-col w-1/3"
|
|
56
|
+
data-testid="shipping-method-summary"
|
|
57
|
+
>
|
|
58
|
+
<Text className="txt-medium-plus text-ui-fg-base mb-1">Method</Text>
|
|
59
|
+
<Text className="txt-medium text-ui-fg-subtle">
|
|
60
|
+
{(order as any).shipping_methods[0]?.name} (
|
|
61
|
+
{convertToLocale({
|
|
62
|
+
amount: order.shipping_methods?.[0].total ?? 0,
|
|
63
|
+
currency_code: order.currency_code,
|
|
64
|
+
})}
|
|
65
|
+
)
|
|
66
|
+
</Text>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<Divider className="mt-8" />
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default ShippingDetails
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
5
|
+
import { acceptTransferRequest, declineTransferRequest } from "@lib/data/orders"
|
|
6
|
+
import { Button, Text } from "@medusajs/ui"
|
|
7
|
+
import { useState } from "react"
|
|
8
|
+
|
|
9
|
+
type TransferStatus = "pending" | "success" | "error"
|
|
10
|
+
|
|
11
|
+
const TransferActions = ({ id, token }: { id: string; token: string }) => {
|
|
12
|
+
const [errorMessage, setErrorMessage] = useState<string | null>(null)
|
|
13
|
+
const [status, setStatus] = useState<{
|
|
14
|
+
accept: TransferStatus | null
|
|
15
|
+
decline: TransferStatus | null
|
|
16
|
+
} | null>({
|
|
17
|
+
accept: null,
|
|
18
|
+
decline: null,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const acceptTransfer = async () => {
|
|
22
|
+
setStatus({ accept: "pending", decline: null })
|
|
23
|
+
setErrorMessage(null)
|
|
24
|
+
|
|
25
|
+
const { success, error } = await acceptTransferRequest(id, token)
|
|
26
|
+
|
|
27
|
+
if (error) setErrorMessage(error)
|
|
28
|
+
setStatus({ accept: success ? "success" : "error", decline: null })
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const declineTransfer = async () => {
|
|
32
|
+
setStatus({ accept: null, decline: "pending" })
|
|
33
|
+
setErrorMessage(null)
|
|
34
|
+
|
|
35
|
+
const { success, error } = await declineTransferRequest(id, token)
|
|
36
|
+
|
|
37
|
+
if (error) setErrorMessage(error)
|
|
38
|
+
setStatus({ accept: null, decline: success ? "success" : "error" })
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="flex flex-col gap-y-4">
|
|
43
|
+
{status?.accept === "success" && (
|
|
44
|
+
<Text className="text-emerald-500">
|
|
45
|
+
<T k="order.transferOk" />
|
|
46
|
+
</Text>
|
|
47
|
+
)}
|
|
48
|
+
{status?.decline === "success" && (
|
|
49
|
+
<Text className="text-emerald-500">
|
|
50
|
+
<T k="order.transferDeclinedOk" />
|
|
51
|
+
</Text>
|
|
52
|
+
)}
|
|
53
|
+
{status?.accept !== "success" && status?.decline !== "success" && (
|
|
54
|
+
<div className="flex gap-x-4">
|
|
55
|
+
<Button
|
|
56
|
+
size="large"
|
|
57
|
+
onClick={acceptTransfer}
|
|
58
|
+
isLoading={status?.accept === "pending"}
|
|
59
|
+
disabled={
|
|
60
|
+
status?.accept === "pending" || status?.decline === "pending"
|
|
61
|
+
}
|
|
62
|
+
>
|
|
63
|
+
<T k="order.acceptTransfer" />
|
|
64
|
+
</Button>
|
|
65
|
+
<Button
|
|
66
|
+
size="large"
|
|
67
|
+
variant="secondary"
|
|
68
|
+
onClick={declineTransfer}
|
|
69
|
+
isLoading={status?.decline === "pending"}
|
|
70
|
+
disabled={
|
|
71
|
+
status?.accept === "pending" || status?.decline === "pending"
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<T k="order.declineTransfer" />
|
|
75
|
+
</Button>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
{errorMessage && <Text className="text-red-500">{errorMessage}</Text>}
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default TransferActions
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { SVGProps } from "react"
|
|
2
|
+
|
|
3
|
+
const TransferImage = (props: SVGProps<SVGSVGElement>) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="280"
|
|
6
|
+
height="181"
|
|
7
|
+
viewBox="0 0 280 181"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<rect
|
|
12
|
+
x="0.00428286"
|
|
13
|
+
y="-0.742904"
|
|
14
|
+
width="33.5"
|
|
15
|
+
height="65.5"
|
|
16
|
+
rx="6.75"
|
|
17
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 189.756 88.938)"
|
|
18
|
+
fill="#D4D4D8"
|
|
19
|
+
stroke="#52525B"
|
|
20
|
+
strokeWidth="1.5"
|
|
21
|
+
/>
|
|
22
|
+
<rect
|
|
23
|
+
x="0.00428286"
|
|
24
|
+
y="-0.742904"
|
|
25
|
+
width="33.5"
|
|
26
|
+
height="65.5"
|
|
27
|
+
rx="6.75"
|
|
28
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 189.756 85.938)"
|
|
29
|
+
fill="white"
|
|
30
|
+
stroke="#52525B"
|
|
31
|
+
strokeWidth="1.5"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M180.579 107.642L179.126 108.459"
|
|
35
|
+
stroke="#52525B"
|
|
36
|
+
strokeWidth="1.5"
|
|
37
|
+
strokeLinecap="round"
|
|
38
|
+
strokeLinejoin="round"
|
|
39
|
+
/>
|
|
40
|
+
<path
|
|
41
|
+
opacity="0.88"
|
|
42
|
+
d="M182.305 110.046L180.257 110.034"
|
|
43
|
+
stroke="#52525B"
|
|
44
|
+
strokeWidth="1.5"
|
|
45
|
+
strokeLinecap="round"
|
|
46
|
+
strokeLinejoin="round"
|
|
47
|
+
/>
|
|
48
|
+
<path
|
|
49
|
+
opacity="0.75"
|
|
50
|
+
d="M180.551 112.429L179.108 111.596"
|
|
51
|
+
stroke="#52525B"
|
|
52
|
+
strokeWidth="1.5"
|
|
53
|
+
strokeLinecap="round"
|
|
54
|
+
strokeLinejoin="round"
|
|
55
|
+
/>
|
|
56
|
+
<path
|
|
57
|
+
opacity="0.63"
|
|
58
|
+
d="M176.347 113.397L176.354 112.23"
|
|
59
|
+
stroke="#52525B"
|
|
60
|
+
strokeWidth="1.5"
|
|
61
|
+
strokeLinecap="round"
|
|
62
|
+
strokeLinejoin="round"
|
|
63
|
+
/>
|
|
64
|
+
<path
|
|
65
|
+
opacity="0.5"
|
|
66
|
+
d="M172.154 112.381L173.606 111.564"
|
|
67
|
+
stroke="#52525B"
|
|
68
|
+
strokeWidth="1.5"
|
|
69
|
+
strokeLinecap="round"
|
|
70
|
+
strokeLinejoin="round"
|
|
71
|
+
/>
|
|
72
|
+
<path
|
|
73
|
+
opacity="0.38"
|
|
74
|
+
d="M170.428 109.977L172.476 109.989"
|
|
75
|
+
stroke="#52525B"
|
|
76
|
+
strokeWidth="1.5"
|
|
77
|
+
strokeLinecap="round"
|
|
78
|
+
strokeLinejoin="round"
|
|
79
|
+
/>
|
|
80
|
+
<path
|
|
81
|
+
opacity="0.25"
|
|
82
|
+
d="M172.181 107.594L173.624 108.428"
|
|
83
|
+
stroke="#52525B"
|
|
84
|
+
strokeWidth="1.5"
|
|
85
|
+
strokeLinecap="round"
|
|
86
|
+
strokeLinejoin="round"
|
|
87
|
+
/>
|
|
88
|
+
<path
|
|
89
|
+
opacity="0.13"
|
|
90
|
+
d="M176.386 106.626L176.379 107.793"
|
|
91
|
+
stroke="#52525B"
|
|
92
|
+
strokeWidth="1.5"
|
|
93
|
+
strokeLinecap="round"
|
|
94
|
+
strokeLinejoin="round"
|
|
95
|
+
/>
|
|
96
|
+
<rect
|
|
97
|
+
width="12"
|
|
98
|
+
height="3"
|
|
99
|
+
rx="1.5"
|
|
100
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 196.447 92.7925)"
|
|
101
|
+
fill="#D4D4D8"
|
|
102
|
+
/>
|
|
103
|
+
<rect
|
|
104
|
+
x="0.00428286"
|
|
105
|
+
y="-0.742904"
|
|
106
|
+
width="33.5"
|
|
107
|
+
height="65.5"
|
|
108
|
+
rx="6.75"
|
|
109
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 117.023 46.9146)"
|
|
110
|
+
fill="#D4D4D8"
|
|
111
|
+
stroke="#52525B"
|
|
112
|
+
strokeWidth="1.5"
|
|
113
|
+
/>
|
|
114
|
+
<rect
|
|
115
|
+
x="0.00428286"
|
|
116
|
+
y="-0.742904"
|
|
117
|
+
width="33.5"
|
|
118
|
+
height="65.5"
|
|
119
|
+
rx="6.75"
|
|
120
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 117.023 43.9146)"
|
|
121
|
+
fill="white"
|
|
122
|
+
stroke="#52525B"
|
|
123
|
+
strokeWidth="1.5"
|
|
124
|
+
/>
|
|
125
|
+
<rect
|
|
126
|
+
width="12"
|
|
127
|
+
height="3"
|
|
128
|
+
rx="1.5"
|
|
129
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 123.714 50.769)"
|
|
130
|
+
fill="#D4D4D8"
|
|
131
|
+
/>
|
|
132
|
+
<rect
|
|
133
|
+
width="17"
|
|
134
|
+
height="3"
|
|
135
|
+
rx="1.5"
|
|
136
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 97.5555 67.458)"
|
|
137
|
+
fill="#D4D4D8"
|
|
138
|
+
/>
|
|
139
|
+
<rect
|
|
140
|
+
width="12"
|
|
141
|
+
height="3"
|
|
142
|
+
rx="1.5"
|
|
143
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 93.1976 69.9092)"
|
|
144
|
+
fill="#D4D4D8"
|
|
145
|
+
/>
|
|
146
|
+
<path
|
|
147
|
+
d="M92.3603 64.4564C90.9277 63.6287 88.59 63.6152 87.148 64.4264C85.7059 65.2375 85.6983 66.5703 87.1308 67.398C88.5634 68.2257 90.9011 68.2392 92.3432 67.428C93.7852 66.6169 93.7929 65.2841 92.3603 64.4564ZM88.4382 66.6626C87.7221 66.2488 87.726 65.5822 88.4468 65.1768C89.1676 64.7713 90.3369 64.7781 91.0529 65.1918C91.769 65.6055 91.7652 66.2722 91.0444 66.6776C90.3236 67.083 89.1543 67.0763 88.4382 66.6626Z"
|
|
148
|
+
fill="#A1A1AA"
|
|
149
|
+
/>
|
|
150
|
+
<rect
|
|
151
|
+
width="17"
|
|
152
|
+
height="3"
|
|
153
|
+
rx="1.5"
|
|
154
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 109.758 60.5942)"
|
|
155
|
+
fill="#D4D4D8"
|
|
156
|
+
/>
|
|
157
|
+
<rect
|
|
158
|
+
width="12"
|
|
159
|
+
height="3"
|
|
160
|
+
rx="1.5"
|
|
161
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 105.4 63.0454)"
|
|
162
|
+
fill="#D4D4D8"
|
|
163
|
+
/>
|
|
164
|
+
<path
|
|
165
|
+
d="M104.562 57.5926C103.13 56.7649 100.792 56.7514 99.35 57.5626C97.908 58.3737 97.9003 59.7065 99.3329 60.5342C100.765 61.3619 103.103 61.3754 104.545 60.5642C105.987 59.7531 105.995 58.4203 104.562 57.5926ZM103.858 59.3971L100.815 59.6265C100.683 59.6366 100.55 59.6133 100.449 59.5629C100.44 59.5584 100.432 59.5544 100.424 59.5499C100.339 59.5004 100.29 59.4335 100.29 59.3637L100.293 58.62C100.294 58.4751 100.501 58.3585 100.756 58.3599C101.01 58.3614 101.216 58.48 101.216 58.6256L101.214 59.0669L103.732 58.8768C103.983 58.8577 104.217 58.9584 104.251 59.1029C104.286 59.2468 104.11 59.3787 103.858 59.3976L103.858 59.3971Z"
|
|
166
|
+
fill="#A1A1AA"
|
|
167
|
+
/>
|
|
168
|
+
<g clip-path="url(#clip0_20786_38285)">
|
|
169
|
+
<path
|
|
170
|
+
d="M133.106 82.3025L140.49 82.345L140.514 78.1353"
|
|
171
|
+
stroke="#A1A1AA"
|
|
172
|
+
strokeWidth="1.5"
|
|
173
|
+
strokeLinecap="round"
|
|
174
|
+
strokeLinejoin="round"
|
|
175
|
+
/>
|
|
176
|
+
</g>
|
|
177
|
+
<g clip-path="url(#clip1_20786_38285)">
|
|
178
|
+
<path
|
|
179
|
+
d="M143.496 88.3059L150.88 88.3485L150.905 84.1387"
|
|
180
|
+
stroke="#A1A1AA"
|
|
181
|
+
strokeWidth="1.5"
|
|
182
|
+
strokeLinecap="round"
|
|
183
|
+
strokeLinejoin="round"
|
|
184
|
+
/>
|
|
185
|
+
</g>
|
|
186
|
+
<g clip-path="url(#clip2_20786_38285)">
|
|
187
|
+
<path
|
|
188
|
+
d="M153.887 94.3093L161.271 94.3519L161.295 90.1421"
|
|
189
|
+
stroke="#A1A1AA"
|
|
190
|
+
strokeWidth="1.5"
|
|
191
|
+
strokeLinecap="round"
|
|
192
|
+
strokeLinejoin="round"
|
|
193
|
+
/>
|
|
194
|
+
</g>
|
|
195
|
+
<g clip-path="url(#clip3_20786_38285)">
|
|
196
|
+
<path
|
|
197
|
+
d="M126.113 89.6911L118.729 89.6486L118.705 93.8583"
|
|
198
|
+
stroke="#A1A1AA"
|
|
199
|
+
strokeWidth="1.5"
|
|
200
|
+
strokeLinecap="round"
|
|
201
|
+
strokeLinejoin="round"
|
|
202
|
+
/>
|
|
203
|
+
</g>
|
|
204
|
+
<g clip-path="url(#clip4_20786_38285)">
|
|
205
|
+
<path
|
|
206
|
+
d="M136.504 95.6945L129.12 95.652L129.095 99.8618"
|
|
207
|
+
stroke="#A1A1AA"
|
|
208
|
+
strokeWidth="1.5"
|
|
209
|
+
strokeLinecap="round"
|
|
210
|
+
strokeLinejoin="round"
|
|
211
|
+
/>
|
|
212
|
+
</g>
|
|
213
|
+
<g clip-path="url(#clip5_20786_38285)">
|
|
214
|
+
<path
|
|
215
|
+
d="M146.894 101.698L139.51 101.655L139.486 105.865"
|
|
216
|
+
stroke="#A1A1AA"
|
|
217
|
+
strokeWidth="1.5"
|
|
218
|
+
strokeLinecap="round"
|
|
219
|
+
strokeLinejoin="round"
|
|
220
|
+
/>
|
|
221
|
+
</g>
|
|
222
|
+
<defs>
|
|
223
|
+
<clipPath id="clip0_20786_38285">
|
|
224
|
+
<rect
|
|
225
|
+
width="12"
|
|
226
|
+
height="12"
|
|
227
|
+
fill="white"
|
|
228
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 138.36 75.1509)"
|
|
229
|
+
/>
|
|
230
|
+
</clipPath>
|
|
231
|
+
<clipPath id="clip1_20786_38285">
|
|
232
|
+
<rect
|
|
233
|
+
width="12"
|
|
234
|
+
height="12"
|
|
235
|
+
fill="white"
|
|
236
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 148.75 81.1543)"
|
|
237
|
+
/>
|
|
238
|
+
</clipPath>
|
|
239
|
+
<clipPath id="clip2_20786_38285">
|
|
240
|
+
<rect
|
|
241
|
+
width="12"
|
|
242
|
+
height="12"
|
|
243
|
+
fill="white"
|
|
244
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 159.14 87.1577)"
|
|
245
|
+
/>
|
|
246
|
+
</clipPath>
|
|
247
|
+
<clipPath id="clip3_20786_38285">
|
|
248
|
+
<rect
|
|
249
|
+
width="12"
|
|
250
|
+
height="12"
|
|
251
|
+
fill="white"
|
|
252
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 120.928 84.9561)"
|
|
253
|
+
/>
|
|
254
|
+
</clipPath>
|
|
255
|
+
<clipPath id="clip4_20786_38285">
|
|
256
|
+
<rect
|
|
257
|
+
width="12"
|
|
258
|
+
height="12"
|
|
259
|
+
fill="white"
|
|
260
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 131.318 90.9595)"
|
|
261
|
+
/>
|
|
262
|
+
</clipPath>
|
|
263
|
+
<clipPath id="clip5_20786_38285">
|
|
264
|
+
<rect
|
|
265
|
+
width="12"
|
|
266
|
+
height="12"
|
|
267
|
+
fill="white"
|
|
268
|
+
transform="matrix(0.865865 0.500278 -0.871576 0.490261 141.709 96.9629)"
|
|
269
|
+
/>
|
|
270
|
+
</clipPath>
|
|
271
|
+
</defs>
|
|
272
|
+
</svg>
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
export default TransferImage
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { T } from "@lib/boutique/i18n-client"
|
|
2
|
+
import { Heading } from "@medusajs/ui"
|
|
3
|
+
import { cookies as nextCookies } from "next/headers"
|
|
4
|
+
|
|
5
|
+
import CartTotals from "@modules/common/components/cart-totals"
|
|
6
|
+
import Help from "@modules/order/components/help"
|
|
7
|
+
import Items from "@modules/order/components/items"
|
|
8
|
+
import OnboardingCta from "@modules/order/components/onboarding-cta"
|
|
9
|
+
import OrderDetails from "@modules/order/components/order-details"
|
|
10
|
+
import ShippingDetails from "@modules/order/components/shipping-details"
|
|
11
|
+
import PaymentDetails from "@modules/order/components/payment-details"
|
|
12
|
+
import { HttpTypes } from "@medusajs/types"
|
|
13
|
+
|
|
14
|
+
type OrderCompletedTemplateProps = {
|
|
15
|
+
order: HttpTypes.StoreOrder
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default async function OrderCompletedTemplate({
|
|
19
|
+
order,
|
|
20
|
+
}: OrderCompletedTemplateProps) {
|
|
21
|
+
const cookies = await nextCookies()
|
|
22
|
+
|
|
23
|
+
const isOnboarding = cookies.get("_medusa_onboarding")?.value === "true"
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className="py-6 min-h-[calc(100vh-64px)]">
|
|
27
|
+
<div className="content-container flex flex-col justify-center items-center gap-y-10 max-w-4xl h-full w-full">
|
|
28
|
+
{isOnboarding && <OnboardingCta orderId={order.id} />}
|
|
29
|
+
<div
|
|
30
|
+
className="flex flex-col gap-4 max-w-4xl h-full bg-white w-full py-10"
|
|
31
|
+
data-testid="order-complete-container"
|
|
32
|
+
>
|
|
33
|
+
<Heading
|
|
34
|
+
level="h1"
|
|
35
|
+
className="flex flex-col gap-y-3 text-ui-fg-base text-3xl mb-4"
|
|
36
|
+
>
|
|
37
|
+
<span><T k="order.thanks" /></span>
|
|
38
|
+
<span><T k="order.placed" /></span>
|
|
39
|
+
</Heading>
|
|
40
|
+
<OrderDetails order={order} />
|
|
41
|
+
<Heading level="h2" className="flex flex-row text-3xl-regular">
|
|
42
|
+
<T k="order.summary" />
|
|
43
|
+
</Heading>
|
|
44
|
+
<Items order={order} />
|
|
45
|
+
<CartTotals totals={order} />
|
|
46
|
+
<ShippingDetails order={order} />
|
|
47
|
+
<PaymentDetails order={order} />
|
|
48
|
+
<Help />
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { XMark } from "@medusajs/icons"
|
|
4
|
+
import { HttpTypes } from "@medusajs/types"
|
|
5
|
+
import LocalizedClientLink from "@modules/common/components/localized-client-link"
|
|
6
|
+
import Help from "@modules/order/components/help"
|
|
7
|
+
import Items from "@modules/order/components/items"
|
|
8
|
+
import OrderDetails from "@modules/order/components/order-details"
|
|
9
|
+
import OrderSummary from "@modules/order/components/order-summary"
|
|
10
|
+
import ShippingDetails from "@modules/order/components/shipping-details"
|
|
11
|
+
import React from "react"
|
|
12
|
+
|
|
13
|
+
type OrderDetailsTemplateProps = {
|
|
14
|
+
order: HttpTypes.StoreOrder
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const OrderDetailsTemplate: React.FC<OrderDetailsTemplateProps> = ({
|
|
18
|
+
order,
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex flex-col justify-center gap-y-4">
|
|
22
|
+
<div className="flex gap-2 justify-between items-center">
|
|
23
|
+
<h1 className="text-2xl-semi">Order details</h1>
|
|
24
|
+
<LocalizedClientLink
|
|
25
|
+
href="/account/orders"
|
|
26
|
+
className="flex gap-2 items-center text-ui-fg-subtle hover:text-ui-fg-base"
|
|
27
|
+
data-testid="back-to-overview-button"
|
|
28
|
+
>
|
|
29
|
+
<XMark /> Back to overview
|
|
30
|
+
</LocalizedClientLink>
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
className="flex flex-col gap-4 h-full bg-white w-full"
|
|
34
|
+
data-testid="order-details-container"
|
|
35
|
+
>
|
|
36
|
+
<OrderDetails order={order} showStatus />
|
|
37
|
+
<Items order={order} />
|
|
38
|
+
<ShippingDetails order={order} />
|
|
39
|
+
<OrderSummary order={order} />
|
|
40
|
+
<Help />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default OrderDetailsTemplate
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Container, clx } from "@medusajs/ui"
|
|
2
|
+
import Image from "next/image"
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
import PlaceholderImage from "@modules/common/icons/placeholder-image"
|
|
6
|
+
|
|
7
|
+
type ThumbnailProps = {
|
|
8
|
+
thumbnail?: string | null
|
|
9
|
+
// TODO: Fix image typings
|
|
10
|
+
images?: any[] | null
|
|
11
|
+
size?: "small" | "medium" | "large" | "full" | "square"
|
|
12
|
+
isFeatured?: boolean
|
|
13
|
+
className?: string
|
|
14
|
+
"data-testid"?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Thumbnail: React.FC<ThumbnailProps> = ({
|
|
18
|
+
thumbnail,
|
|
19
|
+
images,
|
|
20
|
+
size = "small",
|
|
21
|
+
isFeatured,
|
|
22
|
+
className,
|
|
23
|
+
"data-testid": dataTestid,
|
|
24
|
+
}) => {
|
|
25
|
+
const initialImage = thumbnail || images?.[0]?.url
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Container
|
|
29
|
+
className={clx(
|
|
30
|
+
"relative w-full overflow-hidden p-4 bg-ui-bg-subtle shadow-elevation-card-rest rounded-large group-hover:shadow-elevation-card-hover transition-shadow ease-in-out duration-150",
|
|
31
|
+
className,
|
|
32
|
+
{
|
|
33
|
+
"aspect-[11/14]": isFeatured,
|
|
34
|
+
"aspect-[9/16]": !isFeatured && size !== "square",
|
|
35
|
+
"aspect-[1/1]": size === "square",
|
|
36
|
+
"w-[180px]": size === "small",
|
|
37
|
+
"w-[290px]": size === "medium",
|
|
38
|
+
"w-[440px]": size === "large",
|
|
39
|
+
"w-full": size === "full",
|
|
40
|
+
}
|
|
41
|
+
)}
|
|
42
|
+
data-testid={dataTestid}
|
|
43
|
+
>
|
|
44
|
+
<ImageOrPlaceholder image={initialImage} size={size} />
|
|
45
|
+
</Container>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ImageOrPlaceholder = ({
|
|
50
|
+
image,
|
|
51
|
+
size,
|
|
52
|
+
}: Pick<ThumbnailProps, "size"> & { image?: string }) => {
|
|
53
|
+
return image ? (
|
|
54
|
+
<Image
|
|
55
|
+
src={image}
|
|
56
|
+
alt="Thumbnail"
|
|
57
|
+
className="absolute inset-0 object-cover object-center"
|
|
58
|
+
draggable={false}
|
|
59
|
+
quality={50}
|
|
60
|
+
sizes="(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 480px, 800px"
|
|
61
|
+
fill
|
|
62
|
+
/>
|
|
63
|
+
) : (
|
|
64
|
+
<div className="w-full h-full absolute inset-0 flex items-center justify-center">
|
|
65
|
+
<PlaceholderImage size={size === "small" ? 16 : 24} />
|
|
66
|
+
</div>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default Thumbnail
|