@lookiero/checkout 9.13.0 → 10.0.0-beta.0
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/dist/fake-dependencies/@lookiero/payments-front/index.d.ts +8 -6
- package/dist/fake-dependencies/@lookiero/payments-front/index.js +7 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -2
- package/dist/pact.config.d.ts +21 -0
- package/dist/pact.config.js +16 -0
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/ExpoRoot.js +19 -15
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +1 -1
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +2 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
- package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.d.ts +1 -1
- package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +2 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
- package/dist/src/infrastructure/tracking/tracking.d.ts +2 -2
- package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +10 -17
- package/dist/src/infrastructure/tracking/useTrackCheckout.js +27 -12
- package/dist/src/infrastructure/ui/Root.d.ts +6 -6
- package/dist/src/infrastructure/ui/Root.js +2 -3
- package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +1 -2
- package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +2 -3
- package/dist/src/infrastructure/ui/components/atoms/price/Price.js +0 -3
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +3 -7
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +2 -18
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +2 -14
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +3 -4
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +1 -0
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +6 -6
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +1 -0
- package/dist/src/infrastructure/ui/components/templates/footer/Footer.d.ts +3 -0
- package/dist/src/infrastructure/ui/components/templates/footer/Footer.js +13 -0
- package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
- package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
- package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +4 -4
- package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.d.ts +26 -0
- package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +135 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
- package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +3 -2
- package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +17 -26
- package/dist/src/infrastructure/ui/hooks/useStaticInfo.d.ts +2 -0
- package/dist/src/infrastructure/ui/hooks/useStaticInfo.js +2 -2
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +22 -55
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
- package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -2
- package/dist/src/infrastructure/ui/i18n/i18n.js +2 -2
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +3 -14
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +5 -5
- package/dist/src/infrastructure/ui/routing/Routing.js +8 -18
- package/dist/src/infrastructure/ui/routing/routes.d.ts +0 -1
- package/dist/src/infrastructure/ui/routing/routes.js +0 -1
- package/dist/src/infrastructure/ui/test/render.js +3 -7
- package/dist/src/infrastructure/ui/views/App.js +5 -7
- package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
- package/dist/src/infrastructure/ui/views/App.style.js +8 -0
- package/dist/src/infrastructure/ui/views/checkout/Checkout.d.ts +7 -2
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +24 -15
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +3 -0
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +3 -0
- package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +16 -16
- package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +2 -2
- package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
- package/dist/src/infrastructure/ui/views/item/Item.js +1 -3
- package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +5 -11
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -4
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +1 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
- package/dist/src/infrastructure/ui/views/return/components/price/Price.js +0 -3
- package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +6 -6
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +1 -2
- package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
- package/dist/src/infrastructure/ui/views/summary/Summary.js +5 -6
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -3
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +6 -8
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
- package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +1 -3
- package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
- package/dist/src/projection/customer/customer.d.ts +2 -0
- package/dist/src/projection/order/order.d.ts +1 -1
- package/dist/src/projection/shared/country.d.ts +14 -0
- package/dist/src/projection/shared/country.js +15 -0
- package/dist/src/projection/shared/customer.d.ts +9 -0
- package/dist/src/projection/shared/customer.js +1 -0
- package/dist/src/projection/shared/locale.d.ts +12 -0
- package/dist/src/projection/shared/locale.js +13 -0
- package/dist/src/projection/shared/order.d.ts +6 -0
- package/dist/src/projection/shared/order.js +1 -0
- package/dist/src/projection/shared/price.d.ts +11 -0
- package/dist/src/projection/shared/price.js +1 -0
- package/dist/src/projection/shared/size.d.ts +21 -0
- package/dist/src/projection/shared/size.js +4 -0
- package/dist/src/projection/shared/subscription.d.ts +2 -0
- package/dist/src/projection/shared/subscription.js +1 -0
- package/dist/src/projection/subscription/subscription.d.ts +1 -1
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +15 -0
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
- package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
- package/dist/src/shared/ui/components/atoms/field/Field.d.ts +14 -0
- package/dist/src/shared/ui/components/atoms/field/Field.js +29 -0
- package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +16 -0
- package/dist/src/shared/ui/components/atoms/field/Field.style.js +19 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +24 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.js +28 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +29 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +37 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/fake-dependencies/@lookiero/payments-front/index.tsx +32 -9
- package/index.ts +11 -5
- package/jest.config.js +2 -2
- package/package.json +8 -7
- package/src/ExpoRoot.tsx +44 -38
- package/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.ts +4 -1
- package/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.ts +3 -2
- package/src/infrastructure/tracking/tracking.ts +2 -2
- package/src/infrastructure/tracking/useTrackCheckout.ts +66 -56
- package/src/infrastructure/ui/Root.tsx +9 -9
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +2 -3
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +2 -3
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
- package/src/infrastructure/ui/components/atoms/price/Price.tsx +0 -3
- package/src/infrastructure/ui/components/atoms/price/__snapshots__/Price.test.tsx.snap +3 -3
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.ts +4 -25
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +7 -13
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +1 -2
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +1 -2
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +1 -0
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +2 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +2 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +2 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +1 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +5 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +7 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +1 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +2 -4
- package/src/infrastructure/ui/components/templates/footer/Footer.test.tsx +15 -0
- package/src/infrastructure/ui/components/templates/footer/Footer.tsx +19 -0
- package/src/infrastructure/ui/components/templates/footer/__snapshots__/Footer.test.tsx.snap +1127 -0
- package/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.tsx +2 -2
- package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +1 -1
- package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx +2 -2
- package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +1 -1
- package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +5 -4
- package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
- package/src/infrastructure/ui/hooks/{useSubmitCheckout.test.ts → useCheckoutFlow.test.ts} +1 -1
- package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +212 -0
- package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +18 -60
- package/src/infrastructure/ui/hooks/useStaticInfo.tsx +4 -2
- package/src/infrastructure/ui/i18n/i18n.ts +2 -3
- package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +3 -3
- package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +3 -17
- package/src/infrastructure/ui/routing/Routing.tsx +25 -39
- package/src/infrastructure/ui/routing/routes.ts +0 -1
- package/src/infrastructure/ui/test/render.tsx +4 -10
- package/src/infrastructure/ui/views/App.tsx +5 -14
- package/src/infrastructure/ui/views/checkout/Checkout.style.ts +3 -0
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +55 -18
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +116 -121
- package/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.tsx +2 -2
- package/src/infrastructure/ui/views/checkout/components/deliveryBanner/__snapshots__/DeliveryBanner.test.tsx.snap +1 -1
- package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
- package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -2
- package/src/infrastructure/ui/views/item/Item.tsx +1 -2
- package/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.tsx +3 -3
- package/src/infrastructure/ui/views/item/components/banner/__snapshots__/CustomerDecissionBanner.test.tsx.snap +3 -3
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +5 -11
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +88 -160
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +4 -4
- package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +128 -244
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +1 -2
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
- package/src/infrastructure/ui/views/item/components/productVariantDescription/__snapshots__/ProductVariantDescription.test.tsx.snap +8 -10
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +30 -30
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -2
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +1 -1
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -4
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +41 -75
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +102 -105
- package/src/infrastructure/ui/views/return/components/price/Price.tsx +0 -3
- package/src/infrastructure/ui/views/return/components/price/__snapshots__/Price.test.tsx.snap +3 -3
- package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +3 -3
- package/src/infrastructure/ui/views/return/components/productVariantPreview/__snapshots__/ProductVariantPreview.test.tsx.snap +1 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +1 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +6 -6
- package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +4 -4
- package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +30 -30
- package/src/infrastructure/ui/views/summary/Summary.tsx +5 -6
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -3
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +82 -154
- package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +6 -8
- package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +1 -2
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +62 -62
- package/src/projection/customer/customer.ts +2 -0
- package/src/projection/order/order.ts +1 -1
- package/src/projection/subscription/subscription.ts +1 -1
- package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +0 -169
- package/src/infrastructure/ui/routing/useBasePath.test.tsx +0 -19
- package/src/infrastructure/ui/routing/useBasePath.tsx +0 -24
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +0 -125
|
@@ -4,7 +4,7 @@ import { InfoBox, Text } from "@lookiero/aurora";
|
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { useScreenSize } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
7
|
-
import {
|
|
7
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
8
|
import { style } from "./CustomerDecissionBanner.style";
|
|
9
9
|
const i18nMessageForCheckoutItemStatus = {
|
|
10
10
|
[CheckoutItemStatus.KEPT]: I18nMessages.ITEM_BANNER_CUSTOMER_KEPT_DECISSION,
|
|
@@ -12,8 +12,8 @@ const i18nMessageForCheckoutItemStatus = {
|
|
|
12
12
|
[CheckoutItemStatus.RETURNED]: I18nMessages.ITEM_BANNER_CUSTOMER_RETURNED_DECISSION,
|
|
13
13
|
};
|
|
14
14
|
const CustomerDecissionBanner = ({ checkoutItemStatus, onPress }) => {
|
|
15
|
-
const decissionText = useI18nMessage({
|
|
16
|
-
const bannerButtonText = useI18nMessage({
|
|
15
|
+
const decissionText = useI18nMessage({ id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
|
|
16
|
+
const bannerButtonText = useI18nMessage({ id: I18nMessages.ITEM_BANNER_BUTTON });
|
|
17
17
|
const screenSize = useScreenSize();
|
|
18
18
|
const isSmallScreen = screenSize === "S";
|
|
19
19
|
return (React.createElement(View, { style: [style.container, isSmallScreen ? style.smallContainer : null] },
|
|
@@ -3,19 +3,13 @@ import { View } from "react-native";
|
|
|
3
3
|
import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
|
-
import {
|
|
6
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./GetOutOfCheckoutModal.style";
|
|
8
8
|
const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
9
|
-
const titleText = useI18nMessage({
|
|
10
|
-
const descriptionText = useI18nMessage({
|
|
11
|
-
const dismissButtonText = useI18nMessage({
|
|
12
|
-
|
|
13
|
-
id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON,
|
|
14
|
-
});
|
|
15
|
-
const confirmButtonText = useI18nMessage({
|
|
16
|
-
domain: DOMAIN,
|
|
17
|
-
id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON,
|
|
18
|
-
});
|
|
9
|
+
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
11
|
+
const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
|
|
12
|
+
const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
|
|
19
13
|
return (React.createElement(Modal, { portalHostName: "Checkout", visible: visible, onClose: onDismiss },
|
|
20
14
|
React.createElement(View, { style: style.modalContent },
|
|
21
15
|
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
@@ -5,14 +5,14 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { size } from "../../../../../../projection/size/size";
|
|
7
7
|
import { Body } from "../../../../components/layouts/body/Body";
|
|
8
|
-
import {
|
|
8
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { SelectModal } from "../selectModal/SelectModal";
|
|
10
10
|
import { style } from "./ItemActions.style";
|
|
11
11
|
const ItemActions = ({ productVariants, currentProductVariant, country, onShowSizeWithoutStockModal = () => void 0, onKeep, onReplace, onReturn, onLayout, }) => {
|
|
12
12
|
const [modalVisible, setModalVisible] = useState(false);
|
|
13
|
-
const changeSizeButtonText = useI18nMessage({
|
|
14
|
-
const keepButtonText = useI18nMessage({
|
|
15
|
-
const returnButtonText = useI18nMessage({
|
|
13
|
+
const changeSizeButtonText = useI18nMessage({ id: I18nMessages.ITEM_CHANGE_SIZE_BUTTON });
|
|
14
|
+
const keepButtonText = useI18nMessage({ id: I18nMessages.ITEM_KEEP_BUTTON });
|
|
15
|
+
const returnButtonText = useI18nMessage({ id: I18nMessages.ITEM_RETURN_BUTTON });
|
|
16
16
|
const sizeSelectorOptions = useMemo(() => (productVariants || []).map((productVariant) => ({
|
|
17
17
|
label: size({ size: productVariant.size, country }),
|
|
18
18
|
value: productVariant.id,
|
|
@@ -5,11 +5,11 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { useScreenSize } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { size } from "../../../../../../projection/size/size";
|
|
7
7
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
8
|
-
import {
|
|
8
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { style } from "./ProductVariantDescription.style";
|
|
10
10
|
const ProductVariantDescription = ({ brand, name, price, size: sizeProjection, country, }) => {
|
|
11
|
-
const sizeText = useI18nMessage({
|
|
12
|
-
const uniqueText = useI18nMessage({
|
|
11
|
+
const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
|
|
12
|
+
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
13
13
|
const screenDevice = useScreenSize();
|
|
14
14
|
const isDesktopScreen = screenDevice !== "S";
|
|
15
15
|
return (React.createElement(View, { style: [style.container, isDesktopScreen ? null : style.smallContainer] },
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
const {
|
|
3
|
+
const { space4, space6 } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
brand: {
|
|
6
6
|
flex: 1,
|
|
7
|
-
gap: space1,
|
|
8
7
|
},
|
|
9
8
|
container: {
|
|
10
9
|
width: "100%",
|
|
@@ -7,7 +7,7 @@ import { ReturnQuestions } from "../../../../components/organisms/returnQuestion
|
|
|
7
7
|
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
8
8
|
import { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
|
|
9
9
|
import { ReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem";
|
|
10
|
-
import {
|
|
10
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
11
11
|
import { style } from "./ReturnQuestionsFeedback.style";
|
|
12
12
|
const returnQuestionItems = {
|
|
13
13
|
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionFeedbackItem,
|
|
@@ -18,7 +18,7 @@ const returnQuestionItems = {
|
|
|
18
18
|
[ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
|
|
19
19
|
};
|
|
20
20
|
const ReturnQuestionsFeedback = ({ returnQuestions, onEditFeedback }) => {
|
|
21
|
-
const titleText = useI18nMessage({
|
|
21
|
+
const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE });
|
|
22
22
|
return (React.createElement(View, null,
|
|
23
23
|
React.createElement(View, { style: style.titleContainer },
|
|
24
24
|
React.createElement(Text, { level: 2 }, titleText),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
|
|
5
|
+
interface ReturnQuestionsFormProps {
|
|
6
|
+
readonly visible: boolean;
|
|
7
|
+
readonly returnQuestions: ReturnQuestionProjection[];
|
|
8
|
+
readonly onSubmit: (feedback: FeedbackProjection) => void;
|
|
9
|
+
readonly onClose: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ReturnQuestionsForm: FC<ReturnQuestionsFormProps>;
|
|
12
|
+
export { ReturnQuestionsForm };
|
package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PortalHost } from "@gorhom/portal";
|
|
2
|
+
import React, { useCallback } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { Button, Text } from "@lookiero/aurora";
|
|
5
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
+
import { Modal } from "@lookiero/sty-psp-ui";
|
|
7
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
8
|
+
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
9
|
+
import { useReturnQuestionFeedback } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
10
|
+
import { ReturnQuestionItemProvider } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
11
|
+
import { HostDefaultReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem";
|
|
12
|
+
import { HostSelectReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem";
|
|
13
|
+
import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem";
|
|
14
|
+
import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
|
|
15
|
+
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
16
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
17
|
+
import { style } from "./ReturnQuestionsForm.style";
|
|
18
|
+
|
|
19
|
+
const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
|
|
20
|
+
const returnQuestionItems = {
|
|
21
|
+
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionItem,
|
|
22
|
+
[ReturnQuestionType.HOST_TEXTAREA]: HostDefaultReturnQuestionItem,
|
|
23
|
+
[ReturnQuestionType.HOST_SELECT]: HostSelectReturnQuestionItem,
|
|
24
|
+
[ReturnQuestionType.HOST_STACK]: HostStackReturnQuestionItem,
|
|
25
|
+
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
26
|
+
[ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
|
|
27
|
+
};
|
|
28
|
+
const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) => {
|
|
29
|
+
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
30
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
31
|
+
const feedback = useReturnQuestionFeedback();
|
|
32
|
+
const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
33
|
+
return React.createElement(
|
|
34
|
+
ReturnQuestionItemProvider,
|
|
35
|
+
{ returnQuestionItems: returnQuestionItems },
|
|
36
|
+
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
37
|
+
React.createElement(
|
|
38
|
+
Modal,
|
|
39
|
+
{
|
|
40
|
+
portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME,
|
|
41
|
+
testID: "return-questions-form-modal",
|
|
42
|
+
visible: visible,
|
|
43
|
+
scroll: true,
|
|
44
|
+
showCloseButton: true,
|
|
45
|
+
onClose: onClose,
|
|
46
|
+
},
|
|
47
|
+
React.createElement(
|
|
48
|
+
View,
|
|
49
|
+
{ style: style.modalContent },
|
|
50
|
+
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
51
|
+
React.createElement(ReturnQuestions, {
|
|
52
|
+
portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME,
|
|
53
|
+
returnQuestions: returnQuestions,
|
|
54
|
+
}),
|
|
55
|
+
React.createElement(
|
|
56
|
+
Button,
|
|
57
|
+
{ style: style.submit, testID: "return-questions-button", onPress: handleOnSubmit },
|
|
58
|
+
submitButtonText,
|
|
59
|
+
),
|
|
60
|
+
),
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export { ReturnQuestionsForm };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
|
|
4
|
+
const { space6, space8 } = theme();
|
|
5
|
+
const style = StyleSheet.create({
|
|
6
|
+
modalContent: {
|
|
7
|
+
paddingHorizontal: space6,
|
|
8
|
+
},
|
|
9
|
+
submit: {
|
|
10
|
+
marginTop: space8,
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
marginBottom: space6,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export { style };
|
|
@@ -3,12 +3,12 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Button, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
|
-
import {
|
|
6
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./SizeWithoutStockModal.style";
|
|
8
8
|
const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
9
|
-
const titleText = useI18nMessage({
|
|
10
|
-
const descriptionText = useI18nMessage({
|
|
11
|
-
const buttonText = useI18nMessage({
|
|
9
|
+
const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
10
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
11
|
+
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
12
12
|
return (React.createElement(Modal, { portalHostName: "Checkout", visible: visible, showCloseButton: true, onClose: onDismiss },
|
|
13
13
|
React.createElement(View, { style: style.modalContent },
|
|
14
14
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
description: {
|
|
3
|
+
color: string;
|
|
4
|
+
};
|
|
5
|
+
desktopInfo: {
|
|
6
|
+
borderTopLeftRadius: number;
|
|
7
|
+
borderTopRightRadius: number;
|
|
8
|
+
};
|
|
9
|
+
desktopLayoutSpacing: {
|
|
10
|
+
paddingVertical: number;
|
|
11
|
+
};
|
|
12
|
+
headerWrapper: {
|
|
13
|
+
display: "flex";
|
|
14
|
+
flexDirection: "column";
|
|
15
|
+
};
|
|
16
|
+
info: {
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
paddingBottom: number;
|
|
19
|
+
paddingHorizontal: number;
|
|
20
|
+
paddingTop: number;
|
|
21
|
+
};
|
|
22
|
+
layout: {
|
|
23
|
+
flex: number;
|
|
24
|
+
justifyContent: "center";
|
|
25
|
+
};
|
|
26
|
+
safeAreaView: {
|
|
27
|
+
backgroundColor: string;
|
|
28
|
+
flex: number;
|
|
29
|
+
};
|
|
30
|
+
scrollView: {
|
|
31
|
+
flex: number;
|
|
32
|
+
};
|
|
33
|
+
submit: {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
borderBottomLeftRadius: number;
|
|
36
|
+
borderBottomRightRadius: number;
|
|
37
|
+
padding: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export { style };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
|
|
4
|
+
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
5
|
+
const style = StyleSheet.create({
|
|
6
|
+
description: {
|
|
7
|
+
color: colorTextMedium,
|
|
8
|
+
},
|
|
9
|
+
desktopInfo: {
|
|
10
|
+
borderTopLeftRadius: borderRadius5,
|
|
11
|
+
borderTopRightRadius: borderRadius5,
|
|
12
|
+
},
|
|
13
|
+
desktopLayoutSpacing: {
|
|
14
|
+
paddingVertical: space8,
|
|
15
|
+
},
|
|
16
|
+
headerWrapper: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
},
|
|
20
|
+
info: {
|
|
21
|
+
backgroundColor: colorBgBase,
|
|
22
|
+
paddingBottom: space4,
|
|
23
|
+
paddingHorizontal: space6,
|
|
24
|
+
paddingTop: space8,
|
|
25
|
+
},
|
|
26
|
+
layout: {
|
|
27
|
+
flex: 1,
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
},
|
|
30
|
+
safeAreaView: {
|
|
31
|
+
backgroundColor: colorBgPrimaryLight,
|
|
32
|
+
flex: 1,
|
|
33
|
+
},
|
|
34
|
+
scrollView: {
|
|
35
|
+
flex: 1,
|
|
36
|
+
},
|
|
37
|
+
submit: {
|
|
38
|
+
backgroundColor: colorBgBase,
|
|
39
|
+
borderBottomLeftRadius: borderRadius5,
|
|
40
|
+
borderBottomRightRadius: borderRadius5,
|
|
41
|
+
padding: space6,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
export { style };
|
|
@@ -2,18 +2,15 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nNumber } from "@lookiero/i18n-react";
|
|
5
|
-
import { DOMAIN } from "../../../../i18n/i18n";
|
|
6
5
|
import { style } from "./Price.style";
|
|
7
6
|
const Price = ({ price, withPercentage = false }) => {
|
|
8
7
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
9
8
|
const productPrice = useI18nNumber({
|
|
10
|
-
domain: DOMAIN,
|
|
11
9
|
value: price.amount / 100,
|
|
12
10
|
style: "currency",
|
|
13
11
|
currency: price.currency,
|
|
14
12
|
});
|
|
15
13
|
const productDiscountedPrice = useI18nNumber({
|
|
16
|
-
domain: DOMAIN,
|
|
17
14
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
18
15
|
style: "currency",
|
|
19
16
|
currency: price.currency,
|
|
@@ -5,14 +5,14 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { Column, Row } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { size } from "../../../../../../projection/size/size";
|
|
7
7
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
8
|
-
import {
|
|
8
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { Price } from "../price/Price";
|
|
10
10
|
import { IMAGE_SIZE, style } from "./ProductVariantPreview.style";
|
|
11
11
|
const ProductVariantPreview = ({ item, country }) => {
|
|
12
12
|
const cdnImageUrl = useMediaImage();
|
|
13
13
|
const { screen } = useDevice();
|
|
14
|
-
const sizeText = useI18nMessage({
|
|
15
|
-
const uniqueText = useI18nMessage({
|
|
14
|
+
const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
|
|
15
|
+
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
16
16
|
const { productVariant: { media, brand, name, size: sizeProjection }, price, } = item;
|
|
17
17
|
const mainImage = media.find((mediaElement) => mediaElement.perspective === "MAIN");
|
|
18
18
|
return (React.createElement(View, { style: [style.wrapper, !screen.S && style.mobileWrapper], testID: "product-variant-preview" },
|
|
@@ -24,9 +24,9 @@ import { HostStackReturnQuestionItem } from "../../../../components/organisms/re
|
|
|
24
24
|
import { RadioReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem";
|
|
25
25
|
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
26
26
|
import { ItemDetailHeader } from "../../../../components/templates/header/itemDetailHeader/ItemDetailHeader";
|
|
27
|
-
import {
|
|
27
|
+
import { useStaticInfo } from "../../../../hooks/useStaticInfo";
|
|
28
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
28
29
|
import { Routes } from "../../../../routing/routes";
|
|
29
|
-
import { useBasePath } from "../../../../routing/useBasePath";
|
|
30
30
|
import { ProductVariantPreview } from "../productVariantPreview/ProductVariantPreview";
|
|
31
31
|
import { style } from "./ReturnQuestionsForm.style";
|
|
32
32
|
const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
|
|
@@ -40,12 +40,12 @@ const returnQuestionItems = {
|
|
|
40
40
|
};
|
|
41
41
|
const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout, segment, }) => {
|
|
42
42
|
const navigate = useNavigate();
|
|
43
|
-
const basePath =
|
|
43
|
+
const { basePath } = useStaticInfo();
|
|
44
44
|
const logger = useLogger();
|
|
45
45
|
const { screen } = useDevice();
|
|
46
|
-
const titleText = useI18nMessage({
|
|
47
|
-
const descriptionText = useI18nMessage({
|
|
48
|
-
const submitButtonText = useI18nMessage({
|
|
46
|
+
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
47
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_DESCRIPTION });
|
|
48
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
49
49
|
const feedback = useReturnQuestionFeedback();
|
|
50
50
|
const [returnQuestions] = useListReturnQuestionsByCheckoutItemId({
|
|
51
51
|
checkoutItemId: checkoutItem.id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.style";
|
|
4
|
-
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium,
|
|
4
|
+
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
5
5
|
const style = StyleSheet.create({
|
|
6
6
|
background: {
|
|
7
7
|
backgroundColor: colorBgPrimaryLight,
|
|
@@ -25,7 +25,6 @@ const style = StyleSheet.create({
|
|
|
25
25
|
},
|
|
26
26
|
info: {
|
|
27
27
|
backgroundColor: colorBgBase,
|
|
28
|
-
gap: space1,
|
|
29
28
|
paddingBottom: space4,
|
|
30
29
|
paddingHorizontal: space6,
|
|
31
30
|
paddingTop: space8,
|
|
@@ -7,12 +7,12 @@ import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/
|
|
|
7
7
|
import { size } from "../../../../../../projection/size/size";
|
|
8
8
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
9
9
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
10
|
-
import { COLOR_I18N_PREFIX,
|
|
10
|
+
import { COLOR_I18N_PREFIX, I18nMessages } from "../../../../i18n/i18n";
|
|
11
11
|
import { IMAGE_WIDTH, style } from "./ProductVariant.style";
|
|
12
12
|
const ProductVariant = ({ media, brand, name, price, size: sizeProjection, color, status, country, style: customStyle, onPress, }) => {
|
|
13
|
-
const uniqueText = useI18nMessage({
|
|
14
|
-
const colorLabel = useI18nMessage({
|
|
15
|
-
const sizeChangeText = useI18nMessage({
|
|
13
|
+
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
14
|
+
const colorLabel = useI18nMessage({ id: color.name, prefix: COLOR_I18N_PREFIX });
|
|
15
|
+
const sizeChangeText = useI18nMessage({ id: I18nMessages.PRODUCT_VARIANT_SIZE_CHANGE });
|
|
16
16
|
const cdnImageUrl = useMediaImage();
|
|
17
17
|
return (React.createElement(Pressable, { pointerEvents: onPress ? "auto" : "none", style: style.container, testID: "product-variant", onPress: onPress },
|
|
18
18
|
React.createElement(View, { style: style.row },
|
|
@@ -16,24 +16,23 @@ import { useTrackPressPricing } from "../../../tracking/useTrackPressPricing";
|
|
|
16
16
|
import { FiveItemsDiscountBanner } from "../../components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
|
|
17
17
|
import { Body } from "../../components/layouts/body/Body";
|
|
18
18
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
19
|
-
import {
|
|
19
|
+
import { I18nMessages } from "../../i18n/i18n";
|
|
20
20
|
import { Routes } from "../../routing/routes";
|
|
21
|
-
import { useBasePath } from "../../routing/useBasePath";
|
|
22
21
|
import { style } from "./Summary.style";
|
|
23
22
|
import { CollapsiblePricing } from "./components/collapsiblePricing/CollapsiblePricing";
|
|
24
23
|
const Summary = ({ layout: Layout, children }) => {
|
|
25
24
|
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
26
25
|
const [pricingCollapsed, setPricingCollapsed] = useState(true);
|
|
27
26
|
const [pricingHeight, setPricingHeight] = useState(0);
|
|
28
|
-
const titleText = useI18nMessage({
|
|
29
|
-
const descriptionText = useI18nMessage({
|
|
30
|
-
const submitButtonText = useI18nMessage({
|
|
27
|
+
const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
|
|
28
|
+
const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
|
|
29
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
31
30
|
const { screen } = useDevice();
|
|
32
31
|
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
33
32
|
const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
|
|
34
33
|
const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
|
|
35
34
|
const navigate = useNavigate();
|
|
36
|
-
const basePath =
|
|
35
|
+
const { basePath } = useStaticInfo();
|
|
37
36
|
const match = useMatch(`${basePath}/${Routes.SUMMARY}/${Routes.SUMMARY_TABS}`);
|
|
38
37
|
const tab = match?.params.tab;
|
|
39
38
|
const trackPressPricing = useTrackPressPricing({
|
package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js
CHANGED
|
@@ -4,14 +4,13 @@ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-na
|
|
|
4
4
|
import { Button, Icon, Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
7
|
-
import {
|
|
7
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
8
|
import { Pricing } from "../pricing/Pricing";
|
|
9
9
|
import { style } from "./CollapsiblePricing.style";
|
|
10
10
|
const CollapsiblePricing = ({ pricing, totalCheckoutItemsKept, collapsible = true, collapsed = false, submitButtonText, onPress = () => void 0, onSubmit, }) => {
|
|
11
11
|
const { pendingToPay } = pricing;
|
|
12
|
-
const totalText = useI18nMessage({
|
|
12
|
+
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL });
|
|
13
13
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
14
|
-
domain: DOMAIN,
|
|
15
14
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
16
15
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
17
16
|
});
|
|
@@ -3,28 +3,26 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
6
|
-
import {
|
|
6
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./Pricing.style";
|
|
8
8
|
const Row = ({ action = false, text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
9
9
|
React.createElement(Text, { action: action, level: level }, text),
|
|
10
10
|
children));
|
|
11
11
|
const Pricing = ({ pricing, totalCheckoutItemsKept }) => {
|
|
12
12
|
const { pendingToPay, subtotal, balanceDiscount, discount, discountPercentage = 0, service } = pricing;
|
|
13
|
-
const totalText = useI18nMessage({
|
|
13
|
+
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL });
|
|
14
14
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
15
|
-
domain: DOMAIN,
|
|
16
15
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
17
16
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
18
17
|
});
|
|
19
|
-
const subtotalText = useI18nMessage({
|
|
20
|
-
const freeText = useI18nMessage({
|
|
18
|
+
const subtotalText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
19
|
+
const freeText = useI18nMessage({ id: I18nMessages.SUMMARY_FREE });
|
|
21
20
|
const discountText = useI18nMessage({
|
|
22
|
-
domain: DOMAIN,
|
|
23
21
|
id: I18nMessages.SUMMARY_DISCOUNT,
|
|
24
22
|
values: { discount: discountPercentage?.toString() },
|
|
25
23
|
});
|
|
26
|
-
const creditText = useI18nMessage({
|
|
27
|
-
const feeText = useI18nMessage({
|
|
24
|
+
const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT });
|
|
25
|
+
const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE });
|
|
28
26
|
return (React.createElement(View, null,
|
|
29
27
|
React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
|
|
30
28
|
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { LayoutRectangle } from "react-native";
|
|
3
|
+
import { PricingProjection } from "../../../../../../projection/pricing/pricing";
|
|
4
|
+
|
|
5
|
+
interface StickyPricingProps {
|
|
6
|
+
readonly pricing: PricingProjection;
|
|
7
|
+
readonly totalCheckoutItemsKept: number;
|
|
8
|
+
readonly collapsed: boolean;
|
|
9
|
+
readonly onPress: () => void;
|
|
10
|
+
readonly onSubmit: () => void;
|
|
11
|
+
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const StickyPricing: FC<StickyPricingProps>;
|
|
14
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
3
|
+
import { Body } from "../../../../components/layouts/body/Body";
|
|
4
|
+
import { Pricing } from "../pricing/Pricing";
|
|
5
|
+
import { style } from "./StickyPricing.style";
|
|
6
|
+
|
|
7
|
+
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, onPress, onSubmit, onLayout }) =>
|
|
8
|
+
React.createElement(
|
|
9
|
+
Sticky,
|
|
10
|
+
{ style: style.sticky, onLayout: onLayout },
|
|
11
|
+
React.createElement(
|
|
12
|
+
Body,
|
|
13
|
+
null,
|
|
14
|
+
React.createElement(Pricing, {
|
|
15
|
+
balanceDiscount: pricing.balanceDiscount,
|
|
16
|
+
collapsed: collapsed,
|
|
17
|
+
discount: pricing.discount,
|
|
18
|
+
discountPercentage: pricing.discountPercentage,
|
|
19
|
+
pendingToPay: pricing.pendingToPay,
|
|
20
|
+
service: pricing.service,
|
|
21
|
+
subtotal: pricing.subtotal,
|
|
22
|
+
totalCheckoutItemsKept: totalCheckoutItemsKept,
|
|
23
|
+
onPress: onPress,
|
|
24
|
+
onSubmit: onSubmit,
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
export { StickyPricing };
|
|
@@ -10,7 +10,6 @@ import { useTrackPressItem } from "../../../tracking/useTrackPressItem";
|
|
|
10
10
|
import { useTrackTabView } from "../../../tracking/useTrackTabView";
|
|
11
11
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
12
12
|
import { Routes } from "../../routing/routes";
|
|
13
|
-
import { useBasePath } from "../../routing/useBasePath";
|
|
14
13
|
import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
|
|
15
14
|
const TAB_INDEX = {
|
|
16
15
|
keep: 0,
|
|
@@ -18,11 +17,10 @@ const TAB_INDEX = {
|
|
|
18
17
|
};
|
|
19
18
|
const SummaryTabs = () => {
|
|
20
19
|
const { tab } = useParams();
|
|
21
|
-
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
20
|
+
const { customer: { customerId, country, segment }, basePath, } = useStaticInfo();
|
|
22
21
|
const tabIndex = useMemo(() => TAB_INDEX[tab] || 0, [tab]);
|
|
23
22
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
24
23
|
const navigate = useNavigate();
|
|
25
|
-
const basePath = useBasePath();
|
|
26
24
|
useTrackPageView({
|
|
27
25
|
page: TrackingPage.SUMMARY,
|
|
28
26
|
country,
|