@lookiero/checkout 9.14.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/Expo.js +0 -2
- 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 +9 -9
- package/src/Expo.tsx +0 -3
- 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
|
@@ -7,8 +7,8 @@ import { Locale } from "@lookiero/sty-psp-locale";
|
|
|
7
7
|
import { SentryEnvironment, SentryLoggerFunctionArgs } from "@lookiero/sty-psp-logging";
|
|
8
8
|
import { Layout } from "@lookiero/sty-psp-ui";
|
|
9
9
|
import { Customer } from "../../projection/customer/customer";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { OrderProjection } from "../../projection/order/order";
|
|
11
|
+
import { SubscriptionProjection } from "../../projection/subscription/subscription";
|
|
12
12
|
import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
|
|
13
13
|
interface RootFunctionArgs {
|
|
14
14
|
readonly Messaging: MessagingRoot;
|
|
@@ -24,13 +24,13 @@ interface RootFunction {
|
|
|
24
24
|
}
|
|
25
25
|
interface RootProps {
|
|
26
26
|
readonly basePath: string;
|
|
27
|
-
readonly locale
|
|
27
|
+
readonly locale: Locale;
|
|
28
28
|
readonly customer: Customer;
|
|
29
|
-
readonly order:
|
|
30
|
-
readonly subscription:
|
|
29
|
+
readonly order: OrderProjection;
|
|
30
|
+
readonly subscription: SubscriptionProjection;
|
|
31
31
|
readonly layout: Layout;
|
|
32
32
|
readonly onNotAccessible: () => void;
|
|
33
|
-
readonly
|
|
33
|
+
readonly onCheckoutFlowSuccess: () => void;
|
|
34
34
|
readonly useRedirect: () => Record<string, string>;
|
|
35
35
|
readonly useRoutes?: typeof reactRouterUseRoutes;
|
|
36
36
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
4
|
import { useRoutes as reactRouterUseRoutes } from "react-router-native";
|
|
5
|
-
import { Locale } from "@lookiero/sty-psp-locale";
|
|
6
5
|
import { sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
|
|
7
6
|
import { QueryBusProvider } from "./hooks/useQueryBus";
|
|
8
7
|
import { Routing } from "./routing/Routing";
|
|
@@ -10,11 +9,11 @@ const root = ({ Messaging, I18n, queryBus, getAuthToken, development, sentry, ka
|
|
|
10
9
|
const logger = sentryLogger(sentry);
|
|
11
10
|
const kameleoon = kameleoonConfig();
|
|
12
11
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
13
|
-
const Root = ({ basePath, locale
|
|
12
|
+
const Root = ({ basePath, locale, customer, order, subscription, layout, onNotAccessible, onCheckoutFlowSuccess, useRedirect, useRoutes = reactRouterUseRoutes, }) => {
|
|
14
13
|
const handleOnI18nError = useCallback((error) => logger.captureException(error), []);
|
|
15
14
|
return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
16
15
|
React.createElement(QueryBusProvider, { queryBus: queryBus },
|
|
17
|
-
React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, kameleoon: kameleoon, layout: layout, locale: locale, order: order, subscription: subscription, useRedirect: useRedirect, useRoutes: useRoutes,
|
|
16
|
+
React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, kameleoon: kameleoon, layout: layout, locale: locale, order: order, subscription: subscription, useRedirect: useRedirect, useRoutes: useRoutes, onCheckoutFlowSuccess: onCheckoutFlowSuccess, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible }))));
|
|
18
17
|
};
|
|
19
18
|
const hoc = sentryLoggerHOC({ logger });
|
|
20
19
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React 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
|
const FiveItemsDiscountBanner = ({ fiveItemsDiscount }) => {
|
|
7
7
|
const bannerText = useI18nMessage({
|
|
8
|
-
domain: DOMAIN,
|
|
9
8
|
id: I18nMessages.BANNER_DISCOUNT_TEXT,
|
|
10
9
|
values: {
|
|
11
10
|
discount: fiveItemsDiscount.toString(),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
|
|
3
|
-
const { fontMap } = theme();
|
|
2
|
+
// TODO: get the font family from Aurora
|
|
4
3
|
const style = StyleSheet.create({
|
|
5
4
|
textBold: {
|
|
6
|
-
fontFamily:
|
|
5
|
+
fontFamily: "AreaNormal-Extrabold",
|
|
7
6
|
},
|
|
8
7
|
});
|
|
9
8
|
export { style };
|
|
@@ -2,7 +2,6 @@ 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_VARIANT = {
|
|
8
7
|
default: { detail: true, level: 1 },
|
|
@@ -13,13 +12,11 @@ const PRICE_VARIANT = {
|
|
|
13
12
|
const Price = ({ price, variant = "default", withPercentage = false }) => {
|
|
14
13
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
15
14
|
const productPrice = useI18nNumber({
|
|
16
|
-
domain: DOMAIN,
|
|
17
15
|
value: price.amount / 100,
|
|
18
16
|
style: "currency",
|
|
19
17
|
currency: price.currency,
|
|
20
18
|
});
|
|
21
19
|
const productDiscountedPrice = useI18nNumber({
|
|
22
|
-
domain: DOMAIN,
|
|
23
20
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
24
21
|
style: "currency",
|
|
25
22
|
currency: price.currency,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, ReactNode, RefObject } from "react";
|
|
2
|
+
import { LayoutChangeEvent, ScrollView, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
interface LayoutStyle {
|
|
5
|
+
readonly safeAreaView: StyleProp<ViewStyle>;
|
|
6
|
+
readonly scrollView: StyleProp<ViewStyle>;
|
|
7
|
+
readonly header: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
interface LayoutProps {
|
|
10
|
+
readonly children: ReactNode;
|
|
11
|
+
readonly header?: JSX.Element | null;
|
|
12
|
+
readonly footer?: JSX.Element | null;
|
|
13
|
+
readonly panel?: JSX.Element | null;
|
|
14
|
+
readonly stickyHeader?: boolean;
|
|
15
|
+
readonly stickyHeaderHiddenOnScroll?: boolean;
|
|
16
|
+
readonly scrollRef?: RefObject<ScrollView>;
|
|
17
|
+
readonly scrollEnabled?: boolean;
|
|
18
|
+
readonly style?: Partial<LayoutStyle>;
|
|
19
|
+
readonly onLayout?: (event: LayoutChangeEvent) => void;
|
|
20
|
+
}
|
|
21
|
+
type Layout = FC<LayoutProps>;
|
|
22
|
+
export type { Layout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from "react-native";
|
|
2
|
+
import { HEADER_HEIGHT } from "../../../../templates/header/Header.style";
|
|
3
|
+
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
header: {
|
|
6
|
+
...Platform.select({
|
|
7
|
+
web: {
|
|
8
|
+
position: "sticky",
|
|
9
|
+
top: 0,
|
|
10
|
+
zIndex: 10,
|
|
11
|
+
height: HEADER_HEIGHT,
|
|
12
|
+
},
|
|
13
|
+
native: {
|
|
14
|
+
position: "relative",
|
|
15
|
+
height: HEADER_HEIGHT,
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export { style };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { GestureHandlerRootView, ScrollView as RNGHScrollView } from "react-native-gesture-handler";
|
|
5
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
|
+
import { Footer as DefaultFooter } from "../../../templates/footer/Footer";
|
|
7
|
+
import { DefaultHeader } from "../../../templates/header/defaultHeader/DefaultHeader";
|
|
8
|
+
import { Footer } from "../components/footer/Footer";
|
|
9
|
+
import { Header } from "../components/header/Header";
|
|
10
|
+
import { style } from "./DummyLayout.style";
|
|
11
|
+
|
|
12
|
+
const DummyLayout = ({
|
|
13
|
+
children,
|
|
14
|
+
header = React.createElement(DefaultHeader, null),
|
|
15
|
+
footer = React.createElement(DefaultFooter, null),
|
|
16
|
+
panel,
|
|
17
|
+
style: customStyle,
|
|
18
|
+
scrollEnabled,
|
|
19
|
+
onLayout,
|
|
20
|
+
}) =>
|
|
21
|
+
React.createElement(
|
|
22
|
+
SafeAreaView,
|
|
23
|
+
{ style: [style.safeAreaView, customStyle?.safeAreaView] },
|
|
24
|
+
React.createElement(
|
|
25
|
+
GestureHandlerRootView,
|
|
26
|
+
{ style: { flex: 1 } },
|
|
27
|
+
React.createElement(
|
|
28
|
+
RNGHScrollView,
|
|
29
|
+
{
|
|
30
|
+
contentContainerStyle: [style.scrollView, customStyle?.scrollView],
|
|
31
|
+
scrollEnabled: scrollEnabled,
|
|
32
|
+
scrollEventThrottle: 16,
|
|
33
|
+
showsVerticalScrollIndicator: false,
|
|
34
|
+
stickyHeaderIndices: [0],
|
|
35
|
+
},
|
|
36
|
+
React.createElement(Header, null, header),
|
|
37
|
+
panel,
|
|
38
|
+
React.createElement(View, { style: style.children, onLayout: onLayout }, children),
|
|
39
|
+
),
|
|
40
|
+
),
|
|
41
|
+
React.createElement(Footer, null, footer),
|
|
42
|
+
);
|
|
43
|
+
export { DummyLayout };
|
|
@@ -1,16 +1,12 @@
|
|
|
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 { style } from "./ButtonCheckoutQuestionItem.style";
|
|
8
|
-
const ACTIVE_OPACITY = 0.6;
|
|
9
6
|
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
10
7
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
11
|
-
const optionText = useI18nMessage({
|
|
8
|
+
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
12
9
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
13
|
-
return (React.createElement(
|
|
14
|
-
React.createElement(Text, { align: ALIGN.CENTER, level: 3, style: feedback === checkoutQuestion.id && style.textActive, action: true }, optionText)));
|
|
10
|
+
return (React.createElement(Button, { accessibilityLabel: testID, style: style.button, testID: testID, variant: feedback === checkoutQuestion.id ? BUTTON_VARIANT.PRIMARY : BUTTON_VARIANT.SECONDARY, onPress: handleOnPress }, optionText));
|
|
15
11
|
};
|
|
16
12
|
export { ButtonCheckoutQuestionItem };
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
+
import { ViewStyle } from "react-native";
|
|
1
2
|
declare const style: {
|
|
2
|
-
button:
|
|
3
|
-
alignContent: "center";
|
|
4
|
-
borderColor: string;
|
|
5
|
-
borderRadius: number;
|
|
6
|
-
borderWidth: number;
|
|
7
|
-
flex: number;
|
|
8
|
-
height: number;
|
|
9
|
-
justifyContent: "center";
|
|
10
|
-
marginHorizontal: number;
|
|
11
|
-
paddingLeft: number;
|
|
12
|
-
paddingRight: number;
|
|
13
|
-
};
|
|
14
|
-
buttonActive: {
|
|
15
|
-
backgroundColor: string;
|
|
16
|
-
};
|
|
17
|
-
textActive: {
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
3
|
+
button: ViewStyle;
|
|
20
4
|
};
|
|
21
5
|
export { style };
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
const { colorBorderActionSecondary,
|
|
4
|
-
const HEIGHT = space16;
|
|
3
|
+
const { colorBorderActionSecondary, borderWidth2, borderStyle } = theme();
|
|
5
4
|
const style = StyleSheet.create({
|
|
6
5
|
button: {
|
|
7
|
-
alignContent: "center",
|
|
8
6
|
borderColor: colorBorderActionSecondary,
|
|
9
|
-
|
|
7
|
+
borderStyle: borderStyle,
|
|
10
8
|
borderWidth: borderWidth2,
|
|
11
9
|
flex: 1,
|
|
12
|
-
height: HEIGHT,
|
|
13
|
-
justifyContent: "center",
|
|
14
10
|
marginHorizontal: 12,
|
|
15
|
-
paddingLeft: space6,
|
|
16
|
-
paddingRight: space6,
|
|
17
|
-
},
|
|
18
|
-
buttonActive: {
|
|
19
|
-
backgroundColor: colorBgActionPrimaryActive,
|
|
20
|
-
},
|
|
21
|
-
textActive: {
|
|
22
|
-
color: colorTextActionPrimary,
|
|
23
11
|
},
|
|
24
12
|
});
|
|
25
13
|
export { style };
|
|
@@ -2,10 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
5
|
import { style } from "./HostDefaultCheckoutQuestionItem.style";
|
|
7
6
|
const HostDefaultCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
|
|
8
|
-
const titleText = useI18nMessage({
|
|
7
|
+
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
9
8
|
return (React.createElement(React.Fragment, null,
|
|
10
9
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
11
10
|
React.createElement(View, { style: style.content }, children)));
|
|
@@ -2,10 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
5
|
import { style } from "./HostSelectCheckoutQuestionItem.style";
|
|
7
6
|
const HostSelectCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
|
|
8
|
-
const titleText = useI18nMessage({
|
|
7
|
+
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
9
8
|
return (React.createElement(React.Fragment, null,
|
|
10
9
|
React.createElement(Text, { level: 3, style: style.title }, titleText),
|
|
11
10
|
React.createElement(View, { style: style.content }, children)));
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
3
3
|
import { InputField, TextInput } from "@lookiero/sty-psp-ui";
|
|
4
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
4
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
6
5
|
import { style } from "./TextareaCheckoutQuestionItem.style";
|
|
7
6
|
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
|
|
8
|
-
const { formatMessage } =
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
9
8
|
const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
|
|
10
9
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
11
10
|
const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
|
|
12
|
-
return (React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID,
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
|
|
13
12
|
inputField: style.inputField,
|
|
14
13
|
input: { container: style.inputContainer, input: style.input },
|
|
15
14
|
} }));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Text, View } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
5
5
|
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
|
-
import {
|
|
6
|
+
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
8
8
|
const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
|
|
9
|
-
const { formatMessage } =
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
10
|
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
11
11
|
return (React.createElement(React.Fragment, null,
|
|
12
12
|
returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import {
|
|
6
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
5
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
7
6
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
8
7
|
const HostRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
|
|
9
|
-
const { formatMessage } =
|
|
8
|
+
const { formatMessage } = useIntl();
|
|
10
9
|
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
11
10
|
return (React.createElement(React.Fragment, null,
|
|
12
11
|
React.createElement(View, { style: style.wrapper, testID: testID },
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { TouchableHighlight, View } from "react-native";
|
|
4
4
|
import { ButtonIcon } from "@lookiero/aurora";
|
|
5
|
-
import {
|
|
5
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
6
6
|
import { InputField, Modal, TextInput } from "@lookiero/sty-psp-ui";
|
|
7
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
7
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
8
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
10
9
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
11
10
|
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID, }) => {
|
|
12
|
-
const { formatMessage } =
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
13
12
|
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
14
13
|
const [modalVisible, setModalVisible] = useState(false);
|
|
15
14
|
const handleOnPress = useCallback(() => setModalVisible(true), []);
|
|
16
15
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
17
16
|
const feedback = useReturnQuestionFeedback();
|
|
18
17
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
19
|
-
const
|
|
18
|
+
const intl = useIntl();
|
|
19
|
+
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
20
20
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
21
21
|
const [deepestReturnQuestionWithFeedback, isLeaf] = deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
22
22
|
feedback,
|
|
@@ -3,14 +3,13 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
5
5
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
6
|
-
import {
|
|
6
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
7
7
|
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
8
|
-
import { DOMAIN } from "../../../../../../i18n/i18n";
|
|
9
8
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
10
9
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
11
10
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
12
11
|
const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
13
|
-
const { formatMessage } =
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
14
13
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
15
14
|
const feedbackReturnQuestion = feedback
|
|
16
15
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
7
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
7
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
9
8
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
10
9
|
const ModalOptionReturnQuestionItems = ({ portalHostName, returnQuestion, visible, onClose, }) => {
|
|
11
|
-
const { formatMessage } =
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
12
11
|
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
13
12
|
return (React.createElement(Modal, { portalHostName: portalHostName, visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
14
13
|
React.createElement(View, { style: style.modalContent },
|
|
@@ -3,12 +3,11 @@ import React, { useCallback } from "react";
|
|
|
3
3
|
import { TouchableHighlight } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
6
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
7
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
9
8
|
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
10
9
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
11
|
-
const optionText = useI18nMessage({
|
|
10
|
+
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
12
11
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParent.id]);
|
|
13
12
|
return (React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
14
13
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React, { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
5
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
6
5
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
6
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
8
7
|
import { ModalOptionReturnQuestionItems } from "../modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems";
|
|
9
8
|
import { style } from "./RadioReturnQuestionItem.style";
|
|
10
9
|
const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, portalHostName, }) => {
|
|
11
|
-
const
|
|
10
|
+
const intl = useIntl();
|
|
12
11
|
const [modalVisible, setModalVisible] = useState(false);
|
|
13
12
|
const { feedback: feedbackId, onChange, clear, } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
14
13
|
const feedback = useReturnQuestionFeedback();
|
|
15
|
-
const translate = useCallback((returnQuestionName) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [
|
|
14
|
+
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
16
15
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
17
|
-
const optionText = formatMessage({ id: returnQuestion.translationKey });
|
|
16
|
+
const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
|
|
18
17
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
19
18
|
const handleOnModalClose = useCallback(() => {
|
|
20
19
|
// Uncomment if we want to clear current selection (and update callback's dependencies)
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import { useI18nMessage,
|
|
6
|
-
import {
|
|
5
|
+
import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
|
|
6
|
+
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
7
7
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
8
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
9
9
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
10
10
|
const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
|
|
11
|
-
const titleText = useI18nMessage({
|
|
12
|
-
const unansweredText = useI18nMessage({
|
|
11
|
+
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
12
|
+
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
13
13
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
14
|
-
const
|
|
15
|
-
const translate = useCallback((returnQuestionName) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [
|
|
14
|
+
const intl = useIntl();
|
|
15
|
+
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
16
16
|
const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
|
|
17
17
|
return (React.createElement(View, { style: style.container },
|
|
18
18
|
React.createElement(Text, { level: 2, style: style.title, detailBold: true }, titleText),
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React, { useCallback, useMemo } from "react";
|
|
3
3
|
import { View } from "@lookiero/aurora";
|
|
4
|
-
import {
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
5
5
|
import { InputField, TextInput } from "@lookiero/sty-psp-ui";
|
|
6
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
6
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
7
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
9
8
|
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
10
|
-
const { formatMessage } =
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
11
10
|
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
12
11
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
13
12
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
|
|
14
13
|
return (React.createElement(View, { style: style.wrapper, testID: "textarea-return-question-item" },
|
|
15
|
-
React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID,
|
|
14
|
+
React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
|
|
16
15
|
inputField: style.inputField,
|
|
17
16
|
input: { container: style.inputContainer, input: style.input },
|
|
18
17
|
} })));
|