@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-beta.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@lookiero/sty-psp-ab-testing": "^0.3",
|
|
25
25
|
"@lookiero/sty-psp-expo-config": "^0.2",
|
|
26
26
|
"@lookiero/sty-psp-http": "^2.0",
|
|
27
|
-
"@lookiero/sty-psp-i18n": "^0.
|
|
27
|
+
"@lookiero/sty-psp-i18n": "^0.2",
|
|
28
28
|
"@lookiero/sty-psp-locale": "^0.4",
|
|
29
29
|
"@lookiero/sty-psp-logging": "^0.5",
|
|
30
|
-
"@lookiero/sty-psp-notifications": "^0.
|
|
30
|
+
"@lookiero/sty-psp-notifications": "^0.6",
|
|
31
31
|
"@lookiero/sty-psp-react-native": "^0.3",
|
|
32
32
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
33
33
|
"@lookiero/sty-psp-storage": "^0.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@cypress/webpack-preprocessor": "^6.0.2",
|
|
47
47
|
"@lookiero/eslint-config-sty-psp": "*",
|
|
48
48
|
"@lookiero/event": "^0.3",
|
|
49
|
-
"@lookiero/payments-front": "
|
|
49
|
+
"@lookiero/payments-front": "7.0.0-LK-37705-2025.3.4.164034",
|
|
50
50
|
"@lookiero/sty-psp-jest-config": "*",
|
|
51
51
|
"@lookiero/sty-psp-prettier-config": "*",
|
|
52
52
|
"@lookiero/sty-psp-scripts": "*",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"expo-crypto": "~13.0.2",
|
|
62
62
|
"jest-mock-extended": ">=3",
|
|
63
63
|
"jest-when": ">=3",
|
|
64
|
+
"react-intl": "^6.5.1",
|
|
64
65
|
"react-native-gesture-handler": "~2.16.1",
|
|
65
66
|
"react-native-get-random-values": "~1.11.0",
|
|
66
67
|
"react-native-reanimated": "~3.10.1",
|
|
@@ -73,9 +74,9 @@
|
|
|
73
74
|
"@lookiero/aurora-fonts": ">=2",
|
|
74
75
|
"@lookiero/aurora-iconfont": ">=3",
|
|
75
76
|
"@lookiero/event": "^0.3",
|
|
76
|
-
"@lookiero/i18n": ">=
|
|
77
|
-
"@lookiero/i18n-react": ">=
|
|
78
|
-
"@lookiero/payments-front": "
|
|
77
|
+
"@lookiero/i18n": ">=0.9",
|
|
78
|
+
"@lookiero/i18n-react": ">=0.9",
|
|
79
|
+
"@lookiero/payments-front": "7.0.0-LK-37705-2025.3.4.164034",
|
|
79
80
|
"apollo-boost": "0.4.4",
|
|
80
81
|
"expo": ">=51",
|
|
81
82
|
"expo-font": ">=12",
|
package/src/ExpoRoot.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PortalProvider } from "@gorhom/portal";
|
|
1
2
|
import { useFonts } from "expo-font";
|
|
2
3
|
import "expo/build/Expo.fx";
|
|
3
4
|
import React, { FC, useCallback, useState } from "react";
|
|
@@ -17,25 +18,26 @@ import { KameleoonEnvironment } from "./infrastructure/ab-testing/kameleoonEnvir
|
|
|
17
18
|
import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
|
|
18
19
|
import { bootstrap as checkoutMockBootstrap } from "./infrastructure/delivery/bootstrap.mock";
|
|
19
20
|
import { root } from "./infrastructure/ui/Root";
|
|
20
|
-
import { DOMAIN } from "./infrastructure/ui/i18n/i18n";
|
|
21
21
|
import { Router } from "./infrastructure/ui/routing/router/Router";
|
|
22
22
|
import { Customer } from "./projection/customer/customer";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { OrderProjection } from "./projection/order/order";
|
|
24
|
+
import { SubscriptionProjection } from "./projection/subscription/subscription";
|
|
25
25
|
import { VERSION } from "./version";
|
|
26
26
|
|
|
27
|
-
const locale: Locale = Locale.
|
|
28
|
-
const subscription:
|
|
29
|
-
const order:
|
|
27
|
+
const locale: Locale = Locale.es_ES;
|
|
28
|
+
const subscription: SubscriptionProjection = "b";
|
|
29
|
+
const order: OrderProjection = {
|
|
30
30
|
isFirstOrder: false,
|
|
31
31
|
orderNumber: 3687582,
|
|
32
32
|
coupon: "MYLOOKIERO",
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const customer: Customer = {
|
|
36
|
-
customerId: "
|
|
37
|
-
country: Country.
|
|
36
|
+
customerId: "9cfb056e-6008-44b1-9075-320479bf92ac",
|
|
37
|
+
country: Country.NL,
|
|
38
38
|
segment: Segment.WOMEN,
|
|
39
|
+
email: "email@example.com",
|
|
40
|
+
name: "Adèle Léonce Émilie",
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
const sentryConfig: SentryEnvironment = {
|
|
@@ -52,7 +54,7 @@ const apiUrl =
|
|
|
52
54
|
? "/local-to-dev"
|
|
53
55
|
: "/checkout/api";
|
|
54
56
|
const authToken =
|
|
55
|
-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
57
|
+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDk0NjYsImV4cCI6MTc0MjQ3MDI5OSwiZGlzcGxheU5hbWUiOiJNaWtlbCIsImNvdW50cnlfY29kZSI6IkVTIiwiYWNjZXNzVmlhIjoiZW1haWwiLCJzdWJzY3JpcHRpb25TdGFydGluZ0RhdGUiOiIyMDI0LTExLTExIiwiaW1wZXJzb25hdGVkIjpmYWxzZSwidXVpZCI6ImQzYzIzNTRiLTk4MTEtNDZkNC1iMmJhLTVmYmEwMTJlZDk0ZCIsImlhdCI6MTc0MDA1MTA5OX0.AkuUZTsn9mgplQwatg0dPKyv1Hsc6r267UMahxMH19g";
|
|
56
58
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
57
59
|
|
|
58
60
|
const externalTranslationsUrl =
|
|
@@ -65,7 +67,7 @@ const translations: EndpointFunction[] = [
|
|
|
65
67
|
(locale) =>
|
|
66
68
|
translationExternalEndpoint({
|
|
67
69
|
translationsUrl: externalTranslationsUrl,
|
|
68
|
-
projects: [["checkout"]],
|
|
70
|
+
projects: [["user-area-front"], ["inventory-catalog", "feature;feature_value;Color"], ["checkout"]],
|
|
69
71
|
})(locale),
|
|
70
72
|
];
|
|
71
73
|
|
|
@@ -93,6 +95,7 @@ setPaymentsBridge({
|
|
|
93
95
|
useFeatureFlags: () => ({}),
|
|
94
96
|
locale: () => Promise.resolve("es-ES"),
|
|
95
97
|
scrollView: ScrollView,
|
|
98
|
+
hostUrl: "",
|
|
96
99
|
});
|
|
97
100
|
|
|
98
101
|
const kameleoonConfig: KameleoonEnvironment = {
|
|
@@ -106,7 +109,7 @@ const { Component: Messaging, queryBus } =
|
|
|
106
109
|
: checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
|
|
107
110
|
const I18n = i18n({
|
|
108
111
|
fetchTranslation: fetchTranslations({ translations }),
|
|
109
|
-
|
|
112
|
+
contextId: "CheckoutI18n",
|
|
110
113
|
});
|
|
111
114
|
const Root = root({
|
|
112
115
|
Messaging,
|
|
@@ -130,35 +133,38 @@ const ExpoRoot: FC = () => {
|
|
|
130
133
|
const onNotAccessible = useCallback(() => setIsAccessible(false), []);
|
|
131
134
|
|
|
132
135
|
return fontsLoaded ? (
|
|
133
|
-
<
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
136
|
+
<PortalProvider>
|
|
137
|
+
<PaymentsQueryProvider>
|
|
138
|
+
<EventProvider>
|
|
139
|
+
<Aurora>
|
|
140
|
+
{isAccessible === false && <Text heading={true}>Checkout is not accessible!</Text>}
|
|
137
141
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
142
|
+
<Router>
|
|
143
|
+
<Routes>
|
|
144
|
+
<Route
|
|
145
|
+
path="/checkout/*"
|
|
146
|
+
element={
|
|
147
|
+
<Root
|
|
148
|
+
basePath="/checkout"
|
|
149
|
+
customer={customer}
|
|
150
|
+
layout={DummyLayout}
|
|
151
|
+
locale={locale}
|
|
152
|
+
order={order}
|
|
153
|
+
subscription={subscription}
|
|
154
|
+
useRedirect={useRedirect}
|
|
155
|
+
onCheckoutFlowSuccess={() => console.log("Checkout flow success!")}
|
|
156
|
+
onNotAccessible={onNotAccessible}
|
|
157
|
+
/>
|
|
158
|
+
}
|
|
159
|
+
/>
|
|
155
160
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
<Route element={<Navigate to="/checkout" replace />} path="*" />
|
|
162
|
+
</Routes>
|
|
163
|
+
</Router>
|
|
164
|
+
</Aurora>
|
|
165
|
+
</EventProvider>
|
|
166
|
+
</PaymentsQueryProvider>
|
|
167
|
+
</PortalProvider>
|
|
162
168
|
) : null;
|
|
163
169
|
};
|
|
164
170
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
2
3
|
import { CommandStatus, useCommand } from "@lookiero/messaging-react";
|
|
3
4
|
import { Logger } from "@lookiero/sty-psp-logging";
|
|
4
5
|
import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
|
|
@@ -13,7 +14,7 @@ interface BlockCheckoutBookingFunction {
|
|
|
13
14
|
type UseBlockCheckoutBooking = [blockCheckoutBooking: BlockCheckoutBookingFunction, status: CommandStatus];
|
|
14
15
|
|
|
15
16
|
interface UseBlockCheckoutBookingFunctionArgs {
|
|
16
|
-
readonly checkoutBookingId: string;
|
|
17
|
+
readonly checkoutBookingId: string | undefined;
|
|
17
18
|
readonly logger: Logger;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -26,6 +27,8 @@ const useBlockCheckoutBooking: UseBlockCheckoutBookingFunction = ({ checkoutBook
|
|
|
26
27
|
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
27
28
|
|
|
28
29
|
const blockCheckoutBooking = useCallback(async () => {
|
|
30
|
+
invariant(checkoutBookingId, "checkoutBookingId is required");
|
|
31
|
+
|
|
29
32
|
try {
|
|
30
33
|
await commandBus(
|
|
31
34
|
blockCheckoutBookingCommand({
|
|
@@ -23,7 +23,7 @@ const DEFAULT_QUERY_OPTIONS: QueryOptions = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
interface UseViewPricingByCheckoutIdFunctionArgs {
|
|
26
|
-
readonly checkoutId: string;
|
|
26
|
+
readonly checkoutId: string | undefined;
|
|
27
27
|
readonly queryOptions?: QueryOptions;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -36,7 +36,7 @@ const useViewPricingByCheckoutId: UseViewPricingByCheckoutIdFunction = ({
|
|
|
36
36
|
queryOptions = DEFAULT_QUERY_OPTIONS,
|
|
37
37
|
}) =>
|
|
38
38
|
useQuery({
|
|
39
|
-
query: viewPricingByCheckoutId({ checkoutId }),
|
|
39
|
+
query: viewPricingByCheckoutId({ checkoutId: checkoutId as string }),
|
|
40
40
|
contextId: MESSAGING_CONTEXT_ID,
|
|
41
41
|
invalidation: shouldInvalidate,
|
|
42
42
|
options: {
|
|
@@ -44,6 +44,7 @@ const useViewPricingByCheckoutId: UseViewPricingByCheckoutIdFunction = ({
|
|
|
44
44
|
staleTime: Infinity,
|
|
45
45
|
retry: false,
|
|
46
46
|
refetchOnWindowFocus: false,
|
|
47
|
+
enabled: Boolean(checkoutId),
|
|
47
48
|
},
|
|
48
49
|
});
|
|
49
50
|
|
|
@@ -2,7 +2,7 @@ import { BaseTrackingEvent, TrackingEventCategory } from "@lookiero/sty-psp-trac
|
|
|
2
2
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
3
3
|
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
4
4
|
import { MediaPerspective } from "../../projection/checkoutItem/checkoutItem";
|
|
5
|
-
import {
|
|
5
|
+
import { SubscriptionProjection } from "../../projection/subscription/subscription";
|
|
6
6
|
|
|
7
7
|
const PROJECT = "checkout";
|
|
8
8
|
|
|
@@ -121,7 +121,7 @@ interface CheckoutTrackingEvent
|
|
|
121
121
|
readonly actionField: {
|
|
122
122
|
readonly items: number;
|
|
123
123
|
readonly currencyCode: Currency;
|
|
124
|
-
readonly subscription:
|
|
124
|
+
readonly subscription: SubscriptionProjection;
|
|
125
125
|
readonly coupon: string | null;
|
|
126
126
|
readonly orderId: number;
|
|
127
127
|
readonly value: number;
|
|
@@ -1,84 +1,94 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
2
3
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
5
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
6
|
+
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
5
7
|
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
6
|
-
import {
|
|
8
|
+
import { CheckoutProjection } from "../../projection/checkout/checkout";
|
|
9
|
+
import { OrderProjection } from "../../projection/order/order";
|
|
10
|
+
import { PricingProjection } from "../../projection/pricing/pricing";
|
|
11
|
+
import { SubscriptionProjection } from "../../projection/subscription/subscription";
|
|
7
12
|
import { PROJECT, TrackingPage } from "./tracking";
|
|
8
13
|
import { CheckoutTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
9
14
|
|
|
10
|
-
interface TrackCheckoutFunctionArgs {
|
|
11
|
-
readonly userId: string;
|
|
12
|
-
readonly totalReplacedFor: number;
|
|
13
|
-
readonly isFirstOrder: boolean;
|
|
14
|
-
readonly totalCheckoutItemsKept: number;
|
|
15
|
-
readonly currencyCode: Currency;
|
|
16
|
-
readonly subscription: Subscription;
|
|
17
|
-
readonly coupon: string | null;
|
|
18
|
-
readonly orderNumber: number;
|
|
19
|
-
readonly pendingToPay: number;
|
|
20
|
-
}
|
|
21
15
|
interface TrackCheckoutFunction {
|
|
22
|
-
(
|
|
16
|
+
(): void;
|
|
23
17
|
}
|
|
24
18
|
|
|
25
19
|
interface UseTrackCheckoutFunctionArgs {
|
|
26
|
-
readonly
|
|
20
|
+
readonly order: OrderProjection;
|
|
21
|
+
readonly checkout: CheckoutProjection | undefined;
|
|
22
|
+
readonly pricing: PricingProjection | undefined;
|
|
23
|
+
readonly subscription: SubscriptionProjection;
|
|
24
|
+
readonly userId: string;
|
|
27
25
|
readonly country: Country;
|
|
28
|
-
readonly checkoutId: string | undefined;
|
|
29
26
|
readonly segment: Segment;
|
|
30
27
|
}
|
|
28
|
+
|
|
31
29
|
interface UseTrackCheckoutFunction {
|
|
32
30
|
(args: UseTrackCheckoutFunctionArgs): TrackCheckoutFunction;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
const useTrackCheckout: UseTrackCheckoutFunction = ({
|
|
33
|
+
const useTrackCheckout: UseTrackCheckoutFunction = ({
|
|
34
|
+
order,
|
|
35
|
+
checkout,
|
|
36
|
+
pricing,
|
|
37
|
+
subscription,
|
|
38
|
+
segment,
|
|
39
|
+
country,
|
|
40
|
+
userId,
|
|
41
|
+
}) => {
|
|
36
42
|
const emitUserEvent = useEmitUserEvent<CheckoutTrackingEvent>();
|
|
43
|
+
const { coupon, isFirstOrder, orderNumber } = order;
|
|
37
44
|
|
|
38
|
-
const trackCheckout: TrackCheckoutFunction = useCallback(
|
|
39
|
-
(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
totalCheckoutItemsKept,
|
|
47
|
-
totalReplacedFor,
|
|
48
|
-
userId,
|
|
49
|
-
}) => {
|
|
50
|
-
if (!checkoutId) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
45
|
+
const trackCheckout: TrackCheckoutFunction = useCallback(() => {
|
|
46
|
+
invariant(checkout, "Checkout must be defined to track checkout");
|
|
47
|
+
|
|
48
|
+
const checkoutItemsKept = checkout.items.filter(
|
|
49
|
+
(checkoutItem) =>
|
|
50
|
+
checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED,
|
|
51
|
+
);
|
|
52
|
+
const totalReplacedFor = checkoutItemsKept?.filter(({ replacedFor }) => Boolean(replacedFor)).length || 0;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
54
|
+
const checkoutTrackingEvent: CheckoutTrackingEvent = {
|
|
55
|
+
event: TrackingEventName.CHECKOUT,
|
|
56
|
+
eventCategory: TrackingEventCategory.ECOMMERCE,
|
|
57
|
+
section: `${PROJECT}_${TrackingPage.CHECKOUT}`,
|
|
58
|
+
store: country,
|
|
59
|
+
segment,
|
|
60
|
+
checkoutId: checkout.id,
|
|
61
|
+
userId,
|
|
62
|
+
sizeChanges: totalReplacedFor,
|
|
63
|
+
isFirstOrder,
|
|
64
|
+
ecommerce: {
|
|
65
|
+
checkout: {
|
|
66
|
+
actionField: {
|
|
67
|
+
items: checkoutItemsKept.length || 0,
|
|
68
|
+
currencyCode: pricing?.pendingToPay.currency as Currency,
|
|
69
|
+
subscription,
|
|
70
|
+
coupon,
|
|
71
|
+
orderId: orderNumber,
|
|
72
|
+
value: (pricing?.pendingToPay.amount as number) / 100,
|
|
74
73
|
},
|
|
75
74
|
},
|
|
76
|
-
}
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
emitUserEvent(checkoutTrackingEvent);
|
|
79
|
+
}, [
|
|
80
|
+
checkout,
|
|
81
|
+
country,
|
|
82
|
+
coupon,
|
|
83
|
+
emitUserEvent,
|
|
84
|
+
isFirstOrder,
|
|
85
|
+
orderNumber,
|
|
86
|
+
pricing?.pendingToPay.amount,
|
|
87
|
+
pricing?.pendingToPay.currency,
|
|
88
|
+
segment,
|
|
89
|
+
subscription,
|
|
90
|
+
userId,
|
|
91
|
+
]);
|
|
82
92
|
|
|
83
93
|
return trackCheckout;
|
|
84
94
|
};
|
|
@@ -9,8 +9,8 @@ import { Locale } from "@lookiero/sty-psp-locale";
|
|
|
9
9
|
import { SentryEnvironment, SentryLoggerFunctionArgs, sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
|
|
10
10
|
import { Layout } from "@lookiero/sty-psp-ui";
|
|
11
11
|
import { Customer } from "../../projection/customer/customer";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { OrderProjection } from "../../projection/order/order";
|
|
13
|
+
import { SubscriptionProjection } from "../../projection/subscription/subscription";
|
|
14
14
|
import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
|
|
15
15
|
import { QueryBusProvider } from "./hooks/useQueryBus";
|
|
16
16
|
import { Routing } from "./routing/Routing";
|
|
@@ -31,13 +31,13 @@ interface RootFunction {
|
|
|
31
31
|
|
|
32
32
|
interface RootProps {
|
|
33
33
|
readonly basePath: string;
|
|
34
|
-
readonly locale
|
|
34
|
+
readonly locale: Locale;
|
|
35
35
|
readonly customer: Customer;
|
|
36
|
-
readonly order:
|
|
37
|
-
readonly subscription:
|
|
36
|
+
readonly order: OrderProjection;
|
|
37
|
+
readonly subscription: SubscriptionProjection;
|
|
38
38
|
readonly layout: Layout;
|
|
39
39
|
readonly onNotAccessible: () => void;
|
|
40
|
-
readonly
|
|
40
|
+
readonly onCheckoutFlowSuccess: () => void;
|
|
41
41
|
readonly useRedirect: () => Record<string, string>;
|
|
42
42
|
readonly useRoutes?: typeof reactRouterUseRoutes;
|
|
43
43
|
}
|
|
@@ -57,13 +57,13 @@ const root: RootFunction = ({
|
|
|
57
57
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
58
58
|
const Root = ({
|
|
59
59
|
basePath,
|
|
60
|
-
locale
|
|
60
|
+
locale,
|
|
61
61
|
customer,
|
|
62
62
|
order,
|
|
63
63
|
subscription,
|
|
64
64
|
layout,
|
|
65
65
|
onNotAccessible,
|
|
66
|
-
|
|
66
|
+
onCheckoutFlowSuccess,
|
|
67
67
|
useRedirect,
|
|
68
68
|
useRoutes = reactRouterUseRoutes,
|
|
69
69
|
}: RootProps) => {
|
|
@@ -84,7 +84,7 @@ const root: RootFunction = ({
|
|
|
84
84
|
subscription={subscription}
|
|
85
85
|
useRedirect={useRedirect}
|
|
86
86
|
useRoutes={useRoutes}
|
|
87
|
-
|
|
87
|
+
onCheckoutFlowSuccess={onCheckoutFlowSuccess}
|
|
88
88
|
onI18nError={development ? undefined : handleOnI18nError}
|
|
89
89
|
onNotAccessible={onNotAccessible}
|
|
90
90
|
/>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
// TODO: get the font family from Aurora
|
|
5
4
|
|
|
6
5
|
const style = StyleSheet.create({
|
|
7
6
|
textBold: {
|
|
8
|
-
fontFamily:
|
|
7
|
+
fontFamily: "AreaNormal-Extrabold",
|
|
9
8
|
},
|
|
10
9
|
});
|
|
11
10
|
|
package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
2
|
import { ALIGN, DISPLAY, InfoBox, INFOBOX_TYPE, Text } from "@lookiero/aurora";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
-
import {
|
|
4
|
+
import { I18nMessages } from "../../../i18n/i18n";
|
|
5
5
|
import { style } from "./FiveItemsDiscountBanner.style";
|
|
6
6
|
|
|
7
7
|
interface FiveItemsDiscountBannerProps {
|
|
@@ -9,11 +9,10 @@ interface FiveItemsDiscountBannerProps {
|
|
|
9
9
|
}
|
|
10
10
|
const FiveItemsDiscountBanner: FC<FiveItemsDiscountBannerProps> = ({ fiveItemsDiscount }) => {
|
|
11
11
|
const bannerText = useI18nMessage({
|
|
12
|
-
domain: DOMAIN,
|
|
13
12
|
id: I18nMessages.BANNER_DISCOUNT_TEXT,
|
|
14
13
|
values: {
|
|
15
14
|
discount: fiveItemsDiscount.toString(),
|
|
16
|
-
b: (chunks
|
|
15
|
+
b: (chunks) => (
|
|
17
16
|
<Text as="span" display={DISPLAY.INLINE} level={2} style={style.textBold}>
|
|
18
17
|
{chunks}
|
|
19
18
|
</Text>
|
|
@@ -3,7 +3,6 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nNumber } from "@lookiero/i18n-react";
|
|
5
5
|
import { PriceProjection } from "../../../../../projection/price/price";
|
|
6
|
-
import { DOMAIN } from "../../../i18n/i18n";
|
|
7
6
|
import { style } from "./Price.style";
|
|
8
7
|
|
|
9
8
|
type PriceVariant = "default" | "detail" | "subtotal" | "total";
|
|
@@ -30,13 +29,11 @@ interface PriceProps {
|
|
|
30
29
|
const Price: FC<PriceProps> = ({ price, variant = "default", withPercentage = false }) => {
|
|
31
30
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
32
31
|
const productPrice = useI18nNumber({
|
|
33
|
-
domain: DOMAIN,
|
|
34
32
|
value: price.amount / 100,
|
|
35
33
|
style: "currency",
|
|
36
34
|
currency: price.currency,
|
|
37
35
|
});
|
|
38
36
|
const productDiscountedPrice = useI18nNumber({
|
|
39
|
-
domain: DOMAIN,
|
|
40
37
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
41
38
|
style: "currency",
|
|
42
39
|
currency: price.currency,
|
|
@@ -51,7 +51,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
|
|
|
51
51
|
"paddingBottom": 0,
|
|
52
52
|
"paddingLeft": 0,
|
|
53
53
|
"paddingRight": 0,
|
|
54
|
-
"paddingTop":
|
|
54
|
+
"paddingTop": 4,
|
|
55
55
|
},
|
|
56
56
|
]
|
|
57
57
|
}
|
|
@@ -81,7 +81,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
|
|
|
81
81
|
"paddingBottom": 0,
|
|
82
82
|
"paddingLeft": 0,
|
|
83
83
|
"paddingRight": 0,
|
|
84
|
-
"paddingTop":
|
|
84
|
+
"paddingTop": 4,
|
|
85
85
|
"textDecorationLine": "line-through",
|
|
86
86
|
},
|
|
87
87
|
]
|
|
@@ -146,7 +146,7 @@ exports[`Price atom matches the snapshot for a non-discounted price: non-discoun
|
|
|
146
146
|
"paddingBottom": 0,
|
|
147
147
|
"paddingLeft": 0,
|
|
148
148
|
"paddingRight": 0,
|
|
149
|
-
"paddingTop":
|
|
149
|
+
"paddingTop": 4,
|
|
150
150
|
},
|
|
151
151
|
]
|
|
152
152
|
}
|
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
1
|
+
import { StyleSheet, ViewStyle } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
colorBorderActionSecondary,
|
|
6
|
-
colorBgActionPrimaryActive,
|
|
7
|
-
colorTextActionPrimary,
|
|
8
|
-
borderWidth2,
|
|
9
|
-
borderRadiusFull,
|
|
10
|
-
space6,
|
|
11
|
-
space16,
|
|
12
|
-
} = theme();
|
|
13
|
-
|
|
14
|
-
const HEIGHT = space16;
|
|
4
|
+
const { colorBorderActionSecondary, borderWidth2, borderStyle } = theme();
|
|
15
5
|
|
|
16
6
|
const style = StyleSheet.create({
|
|
17
7
|
button: {
|
|
18
|
-
alignContent: "center",
|
|
19
8
|
borderColor: colorBorderActionSecondary,
|
|
20
|
-
|
|
9
|
+
borderStyle: borderStyle,
|
|
21
10
|
borderWidth: borderWidth2,
|
|
22
11
|
flex: 1,
|
|
23
|
-
height: HEIGHT,
|
|
24
|
-
justifyContent: "center",
|
|
25
12
|
marginHorizontal: 12,
|
|
26
|
-
|
|
27
|
-
paddingRight: space6,
|
|
28
|
-
},
|
|
29
|
-
buttonActive: {
|
|
30
|
-
backgroundColor: colorBgActionPrimaryActive,
|
|
31
|
-
},
|
|
32
|
-
textActive: {
|
|
33
|
-
color: colorTextActionPrimary,
|
|
34
|
-
},
|
|
13
|
+
} as ViewStyle,
|
|
35
14
|
});
|
|
36
15
|
|
|
37
16
|
export { style };
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { ALIGN, Text } from "@lookiero/aurora";
|
|
2
|
+
import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
|
|
4
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
4
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
7
5
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
8
6
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
9
7
|
|
|
10
|
-
const ACTIVE_OPACITY = 0.6;
|
|
11
|
-
|
|
12
8
|
const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
13
9
|
checkoutQuestion,
|
|
14
10
|
checkoutQuestionParentId,
|
|
@@ -16,24 +12,22 @@ const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
16
12
|
}: CheckoutQuestionItemProps) => {
|
|
17
13
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
18
14
|
|
|
19
|
-
const optionText = useI18nMessage({
|
|
15
|
+
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
20
16
|
const handleOnPress = useCallback(
|
|
21
17
|
() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }),
|
|
22
18
|
[onChange, checkoutQuestion.id, checkoutQuestionParentId],
|
|
23
19
|
);
|
|
24
20
|
|
|
25
21
|
return (
|
|
26
|
-
<
|
|
22
|
+
<Button
|
|
27
23
|
accessibilityLabel={testID}
|
|
28
|
-
|
|
29
|
-
style={[style.button, feedback === checkoutQuestion.id && style.buttonActive]}
|
|
24
|
+
style={style.button}
|
|
30
25
|
testID={testID}
|
|
26
|
+
variant={feedback === checkoutQuestion.id ? BUTTON_VARIANT.PRIMARY : BUTTON_VARIANT.SECONDARY}
|
|
31
27
|
onPress={handleOnPress}
|
|
32
28
|
>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</Text>
|
|
36
|
-
</TouchableOpacity>
|
|
29
|
+
{optionText}
|
|
30
|
+
</Button>
|
|
37
31
|
);
|
|
38
32
|
};
|
|
39
33
|
|