@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
|
@@ -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
|
|
|
@@ -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 { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
5
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
7
6
|
import { style } from "./HostDefaultCheckoutQuestionItem.style";
|
|
8
7
|
|
|
@@ -10,7 +9,7 @@ const HostDefaultCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
10
9
|
checkoutQuestion,
|
|
11
10
|
children,
|
|
12
11
|
}: CheckoutQuestionItemProps) => {
|
|
13
|
-
const titleText = useI18nMessage({
|
|
12
|
+
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
15
|
<>
|
|
@@ -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 { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
5
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
7
6
|
import { style } from "./HostSelectCheckoutQuestionItem.style";
|
|
8
7
|
|
|
@@ -10,7 +9,7 @@ const HostSelectCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
10
9
|
checkoutQuestion,
|
|
11
10
|
children,
|
|
12
11
|
}: CheckoutQuestionItemProps) => {
|
|
13
|
-
const titleText = useI18nMessage({
|
|
12
|
+
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
15
|
<>
|
|
@@ -1,7 +1,6 @@
|
|
|
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 { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
7
6
|
import { style } from "./TextareaCheckoutQuestionItem.style";
|
|
@@ -11,7 +10,7 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
11
10
|
checkoutQuestionParentId,
|
|
12
11
|
testID,
|
|
13
12
|
}: CheckoutQuestionItemProps) => {
|
|
14
|
-
const { formatMessage } =
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
15
14
|
const placeholderText = useMemo(
|
|
16
15
|
() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""),
|
|
17
16
|
[formatMessage, checkoutQuestion.placeholder],
|
|
@@ -33,7 +32,6 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
33
32
|
placeholder={placeholderText}
|
|
34
33
|
style={style}
|
|
35
34
|
testID={testID}
|
|
36
|
-
textAlignVertical="top"
|
|
37
35
|
value={feedback}
|
|
38
36
|
multiline
|
|
39
37
|
onBlur={onBlur}
|
|
@@ -1,10 +1,10 @@
|
|
|
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 { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
6
|
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
7
|
-
import {
|
|
7
|
+
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
8
8
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
9
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ const HostDefaultReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_
|
|
|
12
12
|
returnQuestion,
|
|
13
13
|
children,
|
|
14
14
|
}) => {
|
|
15
|
-
const { formatMessage } =
|
|
15
|
+
const { formatMessage } = useIntl();
|
|
16
16
|
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
17
17
|
|
|
18
18
|
return (
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import {
|
|
5
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
6
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
7
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
8
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
10
9
|
|
|
@@ -13,7 +12,7 @@ const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HO
|
|
|
13
12
|
children,
|
|
14
13
|
testID,
|
|
15
14
|
}) => {
|
|
16
|
-
const { formatMessage } =
|
|
15
|
+
const { formatMessage } = useIntl();
|
|
17
16
|
const placeholderText = useMemo(
|
|
18
17
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
19
18
|
[formatMessage, returnQuestion.metadata.placeholder],
|
|
@@ -2,10 +2,9 @@
|
|
|
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
7
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
8
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
9
8
|
import {
|
|
10
9
|
useReturnQuestionFeedback,
|
|
11
10
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -23,7 +22,7 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_S
|
|
|
23
22
|
portalHostName,
|
|
24
23
|
testID,
|
|
25
24
|
}) => {
|
|
26
|
-
const { formatMessage } =
|
|
25
|
+
const { formatMessage } = useIntl();
|
|
27
26
|
const placeholderText = useMemo(
|
|
28
27
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
29
28
|
[formatMessage, returnQuestion.metadata.placeholder],
|
|
@@ -35,9 +34,10 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_S
|
|
|
35
34
|
|
|
36
35
|
const feedback = useReturnQuestionFeedback();
|
|
37
36
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
37
|
+
const intl = useIntl();
|
|
38
38
|
const translate = useCallback(
|
|
39
|
-
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
40
|
-
[
|
|
39
|
+
(returnQuestionName: string) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
40
|
+
[intl],
|
|
41
41
|
);
|
|
42
42
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
43
43
|
|
|
@@ -3,10 +3,9 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { LayoutChangeEvent, 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 { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
8
8
|
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
9
|
-
import { DOMAIN } from "../../../../../../i18n/i18n";
|
|
10
9
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
11
10
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
12
11
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
@@ -17,7 +16,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_ST
|
|
|
17
16
|
children,
|
|
18
17
|
portalHostName,
|
|
19
18
|
}) => {
|
|
20
|
-
const { formatMessage } =
|
|
19
|
+
const { formatMessage } = useIntl();
|
|
21
20
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
22
21
|
const feedbackReturnQuestion = feedback
|
|
23
22
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
@@ -1,11 +1,10 @@
|
|
|
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 { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
7
7
|
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
8
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
9
8
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
10
9
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
11
10
|
|
|
@@ -23,7 +22,7 @@ const ModalOptionReturnQuestionItems = ({
|
|
|
23
22
|
visible,
|
|
24
23
|
onClose,
|
|
25
24
|
}: ModalOptionReturnQuestionItemsProps) => {
|
|
26
|
-
const { formatMessage } =
|
|
25
|
+
const { formatMessage } = useIntl();
|
|
27
26
|
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
28
27
|
|
|
29
28
|
return (
|
|
@@ -4,7 +4,6 @@ import { TouchableHighlight, ViewStyle } from "react-native";
|
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
8
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
10
9
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
@@ -16,7 +15,7 @@ const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> =
|
|
|
16
15
|
}) => {
|
|
17
16
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
18
17
|
|
|
19
|
-
const optionText = useI18nMessage({
|
|
18
|
+
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
20
19
|
const handleOnPress = useCallback(
|
|
21
20
|
() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }),
|
|
22
21
|
[onChange, returnQuestion.id, returnQuestionParent.id],
|
|
@@ -1,9 +1,8 @@
|
|
|
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 {
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
5
5
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
6
|
import {
|
|
8
7
|
useReturnQuestionFeedback,
|
|
9
8
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -22,7 +21,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = (
|
|
|
22
21
|
testID,
|
|
23
22
|
portalHostName,
|
|
24
23
|
}) => {
|
|
25
|
-
const
|
|
24
|
+
const intl = useIntl();
|
|
26
25
|
const [modalVisible, setModalVisible] = useState(false);
|
|
27
26
|
const {
|
|
28
27
|
feedback: feedbackId,
|
|
@@ -31,12 +30,12 @@ const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = (
|
|
|
31
30
|
} = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
32
31
|
const feedback = useReturnQuestionFeedback();
|
|
33
32
|
const translate = useCallback(
|
|
34
|
-
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
35
|
-
[
|
|
33
|
+
(returnQuestionName: string) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
34
|
+
[intl],
|
|
36
35
|
);
|
|
37
36
|
|
|
38
37
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
39
|
-
const optionText = formatMessage({ id: returnQuestion.translationKey });
|
|
38
|
+
const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
|
|
40
39
|
|
|
41
40
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
42
41
|
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
|
-
import { useI18nMessage,
|
|
5
|
+
import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
|
|
6
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
-
import {
|
|
7
|
+
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
8
8
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
9
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
10
10
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
11
11
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
12
12
|
|
|
13
13
|
const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT> = ({ returnQuestion }) => {
|
|
14
|
-
const titleText = useI18nMessage({
|
|
15
|
-
const unansweredText = useI18nMessage({
|
|
14
|
+
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
15
|
+
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
16
16
|
|
|
17
17
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const intl = useIntl();
|
|
20
20
|
const translate = useCallback(
|
|
21
|
-
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
22
|
-
[
|
|
21
|
+
(returnQuestionName: string) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
22
|
+
[intl],
|
|
23
23
|
);
|
|
24
24
|
const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(
|
|
25
25
|
" / ",
|
|
@@ -1,10 +1,9 @@
|
|
|
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
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
-
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
8
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
9
8
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
10
9
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
@@ -14,7 +13,7 @@ const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA
|
|
|
14
13
|
returnQuestionParent,
|
|
15
14
|
testID,
|
|
16
15
|
}) => {
|
|
17
|
-
const { formatMessage } =
|
|
16
|
+
const { formatMessage } = useIntl();
|
|
18
17
|
|
|
19
18
|
const placeholderText = useMemo(
|
|
20
19
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
@@ -38,7 +37,6 @@ const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA
|
|
|
38
37
|
placeholder={placeholderText}
|
|
39
38
|
style={style}
|
|
40
39
|
testID={testID}
|
|
41
|
-
textAlignVertical="top"
|
|
42
40
|
value={feedback}
|
|
43
41
|
multiline
|
|
44
42
|
onBlur={onBlur}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "../../../test/render";
|
|
3
|
+
import { Footer } from "./Footer";
|
|
4
|
+
|
|
5
|
+
jest.mock("react-router-native", () => ({
|
|
6
|
+
useLocation: () => jest.fn(),
|
|
7
|
+
}));
|
|
8
|
+
|
|
9
|
+
describe("Footer template", () => {
|
|
10
|
+
it("matches the snapshot", async () => {
|
|
11
|
+
const { toJSON } = render(<Footer />);
|
|
12
|
+
|
|
13
|
+
expect(toJSON()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import { useLocation } from "react-router-native";
|
|
3
|
+
import { Footer as AuroraFooter, FooterItem } from "@lookiero/aurora";
|
|
4
|
+
|
|
5
|
+
const Footer: FC = () => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<AuroraFooter value={location.pathname}>
|
|
10
|
+
<FooterItem icon="box" text="Inicio" value="/" />
|
|
11
|
+
<FooterItem icon="heart" text="Look&Like" value="/look-and-like" />
|
|
12
|
+
<FooterItem icon="referrals" text="Amigas" value="/friends" />
|
|
13
|
+
<FooterItem icon="eye_open" text="Inspiración" value="/inspiration" />
|
|
14
|
+
<FooterItem icon="inbox" notification={true} text="Mensajes" value="/messages" />
|
|
15
|
+
</AuroraFooter>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { Footer };
|