@lookiero/checkout 10.0.0-beta.2 → 10.0.0-beta.3
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/index.js +2 -1
- package/dist/src/ExpoRoot.js +3 -2
- package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +2 -1
- package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +3 -2
- package/dist/src/infrastructure/ui/components/atoms/price/Price.js +3 -0
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +7 -3
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +18 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +14 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +4 -3
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +0 -1
- 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 +3 -2
- 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 +3 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +5 -4
- 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 +4 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +0 -1
- package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
- package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
- package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +2 -2
- package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +9 -9
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +55 -22
- package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -1
- package/dist/src/infrastructure/ui/i18n/i18n.js +2 -1
- package/dist/src/infrastructure/ui/test/render.js +4 -2
- package/dist/src/infrastructure/ui/views/App.js +2 -1
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +3 -3
- 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/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +11 -5
- 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 +1 -0
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +2 -1
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
- package/dist/src/infrastructure/ui/views/return/components/price/Price.js +3 -0
- package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +4 -4
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +1 -0
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -1
- package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
- package/dist/src/infrastructure/ui/views/summary/Summary.js +4 -4
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +3 -2
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +8 -6
- package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +2 -1
- package/jest.config.js +2 -2
- package/package.json +7 -8
- package/src/ExpoRoot.tsx +3 -2
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +3 -2
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +3 -2
- package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
- package/src/infrastructure/ui/components/atoms/price/Price.tsx +3 -0
- 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 +25 -4
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +13 -7
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +0 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +4 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +3 -2
- 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 +3 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +3 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +6 -5
- 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 +0 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +4 -2
- 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 +2 -2
- package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
- package/src/infrastructure/ui/hooks/useCheckoutFlow.test.tsx +302 -0
- package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +9 -9
- package/src/infrastructure/ui/i18n/i18n.ts +3 -1
- package/src/infrastructure/ui/test/render.tsx +6 -3
- package/src/infrastructure/ui/views/App.tsx +2 -1
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +51 -40
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -3
- 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/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -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 +11 -5
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +160 -88
- 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 +244 -128
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +2 -1
- 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 +10 -8
- 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 +75 -41
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +105 -102
- package/src/infrastructure/ui/views/return/components/price/Price.tsx +3 -0
- 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 +2 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +4 -4
- 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 +4 -4
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +3 -2
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +154 -82
- package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +8 -6
- 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/dist/pact.config.d.ts +0 -21
- package/dist/pact.config.js +0 -16
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
- package/dist/src/infrastructure/ui/components/templates/footer/Footer.d.ts +0 -3
- package/dist/src/infrastructure/ui/components/templates/footer/Footer.js +0 -13
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
- package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -8
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/customer.d.ts +0 -9
- package/dist/src/projection/shared/customer.js +0 -1
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/projection/shared/order.d.ts +0 -6
- package/dist/src/projection/shared/order.js +0 -1
- package/dist/src/projection/shared/price.d.ts +0 -11
- package/dist/src/projection/shared/price.js +0 -1
- package/dist/src/projection/shared/size.d.ts +0 -21
- package/dist/src/projection/shared/size.js +0 -4
- package/dist/src/projection/shared/subscription.d.ts +0 -2
- package/dist/src/projection/shared/subscription.js +0 -1
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -15
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
- package/dist/src/shared/ui/components/atoms/field/Field.d.ts +0 -14
- package/dist/src/shared/ui/components/atoms/field/Field.js +0 -29
- package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +0 -16
- package/dist/src/shared/ui/components/atoms/field/Field.style.js +0 -19
- package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +0 -24
- package/dist/src/shared/ui/components/molecules/inputField/InputField.js +0 -28
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -29
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +0 -37
- package/src/infrastructure/ui/components/templates/footer/Footer.test.tsx +0 -15
- package/src/infrastructure/ui/components/templates/footer/Footer.tsx +0 -19
- package/src/infrastructure/ui/components/templates/footer/__snapshots__/Footer.test.tsx.snap +0 -1127
- package/src/infrastructure/ui/hooks/useCheckoutFlow.test.ts +0 -297
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +0 -126
|
@@ -3,26 +3,28 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
6
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
6
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./Pricing.style";
|
|
8
8
|
const Row = ({ action = false, text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
9
9
|
React.createElement(Text, { action: action, level: level }, text),
|
|
10
10
|
children));
|
|
11
11
|
const Pricing = ({ pricing, totalCheckoutItemsKept }) => {
|
|
12
12
|
const { pendingToPay, subtotal, balanceDiscount, discount, discountPercentage = 0, service } = pricing;
|
|
13
|
-
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL });
|
|
13
|
+
const totalText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_TOTAL });
|
|
14
14
|
const totalCheckoutItemsKeptText = useI18nMessage({
|
|
15
|
+
domain: DOMAIN,
|
|
15
16
|
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
16
17
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
17
18
|
});
|
|
18
|
-
const subtotalText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
19
|
-
const freeText = useI18nMessage({ id: I18nMessages.SUMMARY_FREE });
|
|
19
|
+
const subtotalText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
20
|
+
const freeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_FREE });
|
|
20
21
|
const discountText = useI18nMessage({
|
|
22
|
+
domain: DOMAIN,
|
|
21
23
|
id: I18nMessages.SUMMARY_DISCOUNT,
|
|
22
24
|
values: { discount: discountPercentage?.toString() },
|
|
23
25
|
});
|
|
24
|
-
const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT });
|
|
25
|
-
const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE });
|
|
26
|
+
const creditText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_CREDIT });
|
|
27
|
+
const feeText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_FEE });
|
|
26
28
|
return (React.createElement(View, null,
|
|
27
29
|
React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
|
|
28
30
|
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
@@ -4,17 +4,17 @@ import { Text, useDevice } from "@lookiero/aurora";
|
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
5
|
import { Tabs } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
7
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
|
|
8
8
|
import { ProductVariant } from "../../../shared/components/productVariant/ProductVariant";
|
|
9
9
|
import { style } from "./CheckoutItemsTabs.style";
|
|
10
10
|
const CheckoutItem = ({ checkoutItemStatus, checkoutItemProductVariant, checkoutItemPrice, country, testID, style: customStyle, onPress, }) => (React.createElement(View, { testID: testID },
|
|
11
11
|
React.createElement(ProductVariant, { brand: checkoutItemProductVariant.brand, color: checkoutItemProductVariant.color, country: country, media: checkoutItemProductVariant.media, name: checkoutItemProductVariant.name, price: checkoutItemPrice, size: checkoutItemProductVariant.size, status: checkoutItemStatus, style: customStyle, onPress: onPress })));
|
|
12
12
|
const CheckoutItemsTabs = ({ tabIndex, checkoutItemsKept, checkoutItemsReturned, country, onPressItem, onChanged, }) => {
|
|
13
13
|
const { screen } = useDevice();
|
|
14
|
-
const keepTabText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_TAB });
|
|
15
|
-
const returnTabText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_TAB });
|
|
16
|
-
const keepEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_EMPTY });
|
|
17
|
-
const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
14
|
+
const keepTabText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_KEEP_TAB });
|
|
15
|
+
const returnTabText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_RETURN_TAB });
|
|
16
|
+
const keepEmptyText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_KEEP_EMPTY });
|
|
17
|
+
const returnEmptyText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
18
18
|
const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
|
|
19
19
|
const data = useMemo(() => [{ id: "0" }, { id: "1" }], []);
|
|
20
20
|
const renderItem = useCallback(({ index }) => index === 0 ? (checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (React.createElement(React.Fragment, null, checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, country: country, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "10.0.0-beta.
|
|
1
|
+
export declare const VERSION = "10.0.0-beta.3";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "10.0.0-beta.
|
|
1
|
+
export const VERSION = "10.0.0-beta.3";
|
package/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { CheckoutStatus } from "./src/domain/checkout/model/checkout";
|
|
|
9
9
|
import { KameleoonEnvironment } from "./src/infrastructure/ab-testing/kameleoonEnvironment";
|
|
10
10
|
import { bootstrap as checkoutBootstrap } from "./src/infrastructure/delivery/bootstrap";
|
|
11
11
|
import { root, RootProps } from "./src/infrastructure/ui/Root";
|
|
12
|
+
import { DOMAIN } from "./src/infrastructure/ui/i18n/i18n";
|
|
12
13
|
import { CheckoutProjection } from "./src/projection/checkout/checkout";
|
|
13
14
|
import { viewFirstAvailableCheckoutByCustomerId } from "./src/projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
14
15
|
import { Customer } from "./src/projection/customer/customer";
|
|
@@ -44,7 +45,7 @@ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken, translations, sent
|
|
|
44
45
|
const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
|
|
45
46
|
const I18n = i18n({
|
|
46
47
|
fetchTranslation: fetchTranslations({ translations }),
|
|
47
|
-
|
|
48
|
+
domain: DOMAIN,
|
|
48
49
|
});
|
|
49
50
|
|
|
50
51
|
const firstAvailableCheckoutByCustomerId: FirstAvailableCheckoutByCustomerIdFunction = ({ customerId }) =>
|
package/jest.config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const jestReactNativeConfig = require("@lookiero/sty-psp-jest-config/jest.config.
|
|
1
|
+
const jestReactNativeConfig = require("@lookiero/sty-psp-jest-config/jest.config.expo.js");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
...jestReactNativeConfig,
|
|
5
|
-
setupFiles: ["../../node_modules/react-native-gesture-handler/jestSetup.js"],
|
|
6
5
|
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
|
|
6
|
+
setupFiles: ["../../node_modules/react-native-gesture-handler/jestSetup.js"],
|
|
7
7
|
moduleNameMapper: {
|
|
8
8
|
...(jestReactNativeConfig.moduleNameMapper || {}),
|
|
9
9
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "10.0.0-beta.
|
|
3
|
+
"version": "10.0.0-beta.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@lookiero/sty-psp-ab-testing": "^0.3",
|
|
25
25
|
"@lookiero/sty-psp-expo-config": "^0.2",
|
|
26
26
|
"@lookiero/sty-psp-http": "^2.0",
|
|
27
|
-
"@lookiero/sty-psp-i18n": "^0.
|
|
27
|
+
"@lookiero/sty-psp-i18n": "^0.4",
|
|
28
28
|
"@lookiero/sty-psp-locale": "^0.4",
|
|
29
29
|
"@lookiero/sty-psp-logging": "^0.5",
|
|
30
|
-
"@lookiero/sty-psp-notifications": "^0.
|
|
30
|
+
"@lookiero/sty-psp-notifications": "^0.8",
|
|
31
31
|
"@lookiero/sty-psp-react-native": "^0.3",
|
|
32
32
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
33
33
|
"@lookiero/sty-psp-storage": "^0.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@cypress/webpack-preprocessor": "^6.0.2",
|
|
47
47
|
"@lookiero/eslint-config-sty-psp": "*",
|
|
48
48
|
"@lookiero/event": "^0.3",
|
|
49
|
-
"@lookiero/payments-front": "7.0.0-
|
|
49
|
+
"@lookiero/payments-front": "7.0.0-alpha.2",
|
|
50
50
|
"@lookiero/sty-psp-jest-config": "*",
|
|
51
51
|
"@lookiero/sty-psp-prettier-config": "*",
|
|
52
52
|
"@lookiero/sty-psp-scripts": "*",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"expo-crypto": "~13.0.2",
|
|
62
62
|
"jest-mock-extended": ">=3",
|
|
63
63
|
"jest-when": ">=3",
|
|
64
|
-
"react-intl": "^6.5.1",
|
|
65
64
|
"react-native-gesture-handler": "~2.16.1",
|
|
66
65
|
"react-native-get-random-values": "~1.11.0",
|
|
67
66
|
"react-native-reanimated": "~3.10.1",
|
|
@@ -74,9 +73,9 @@
|
|
|
74
73
|
"@lookiero/aurora-fonts": ">=2",
|
|
75
74
|
"@lookiero/aurora-iconfont": ">=3",
|
|
76
75
|
"@lookiero/event": "^0.3",
|
|
77
|
-
"@lookiero/i18n": ">=
|
|
78
|
-
"@lookiero/i18n-react": ">=
|
|
79
|
-
"@lookiero/payments-front": "7.0.0-
|
|
76
|
+
"@lookiero/i18n": ">=2",
|
|
77
|
+
"@lookiero/i18n-react": ">=2",
|
|
78
|
+
"@lookiero/payments-front": "7.0.0-alpha.2",
|
|
80
79
|
"apollo-boost": "0.4.4",
|
|
81
80
|
"expo": ">=51",
|
|
82
81
|
"expo-font": ">=12",
|
package/src/ExpoRoot.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import { KameleoonEnvironment } from "./infrastructure/ab-testing/kameleoonEnvir
|
|
|
18
18
|
import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
|
|
19
19
|
import { bootstrap as checkoutMockBootstrap } from "./infrastructure/delivery/bootstrap.mock";
|
|
20
20
|
import { root } from "./infrastructure/ui/Root";
|
|
21
|
+
import { DOMAIN } from "./infrastructure/ui/i18n/i18n";
|
|
21
22
|
import { Router } from "./infrastructure/ui/routing/router/Router";
|
|
22
23
|
import { Customer } from "./projection/customer/customer";
|
|
23
24
|
import { OrderProjection } from "./projection/order/order";
|
|
@@ -67,7 +68,7 @@ const translations: EndpointFunction[] = [
|
|
|
67
68
|
(locale) =>
|
|
68
69
|
translationExternalEndpoint({
|
|
69
70
|
translationsUrl: externalTranslationsUrl,
|
|
70
|
-
projects: [["
|
|
71
|
+
projects: [["checkout"]],
|
|
71
72
|
})(locale),
|
|
72
73
|
];
|
|
73
74
|
|
|
@@ -109,7 +110,7 @@ const { Component: Messaging, queryBus } =
|
|
|
109
110
|
: checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
|
|
110
111
|
const I18n = i18n({
|
|
111
112
|
fetchTranslation: fetchTranslations({ translations }),
|
|
112
|
-
|
|
113
|
+
domain: DOMAIN,
|
|
113
114
|
});
|
|
114
115
|
const Root = root({
|
|
115
116
|
Messaging,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const { fontMap } = theme();
|
|
4
5
|
|
|
5
6
|
const style = StyleSheet.create({
|
|
6
7
|
textBold: {
|
|
7
|
-
fontFamily:
|
|
8
|
+
fontFamily: fontMap.Action,
|
|
8
9
|
},
|
|
9
10
|
});
|
|
10
11
|
|
package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
2
|
import { ALIGN, DISPLAY, InfoBox, INFOBOX_TYPE, Text } from "@lookiero/aurora";
|
|
3
3
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
-
import { I18nMessages } from "../../../i18n/i18n";
|
|
4
|
+
import { DOMAIN, I18nMessages } from "../../../i18n/i18n";
|
|
5
5
|
import { style } from "./FiveItemsDiscountBanner.style";
|
|
6
6
|
|
|
7
7
|
interface FiveItemsDiscountBannerProps {
|
|
@@ -9,10 +9,11 @@ interface FiveItemsDiscountBannerProps {
|
|
|
9
9
|
}
|
|
10
10
|
const FiveItemsDiscountBanner: FC<FiveItemsDiscountBannerProps> = ({ fiveItemsDiscount }) => {
|
|
11
11
|
const bannerText = useI18nMessage({
|
|
12
|
+
domain: DOMAIN,
|
|
12
13
|
id: I18nMessages.BANNER_DISCOUNT_TEXT,
|
|
13
14
|
values: {
|
|
14
15
|
discount: fiveItemsDiscount.toString(),
|
|
15
|
-
b: (chunks) => (
|
|
16
|
+
b: (chunks: string[]) => (
|
|
16
17
|
<Text as="span" display={DISPLAY.INLINE} level={2} style={style.textBold}>
|
|
17
18
|
{chunks}
|
|
18
19
|
</Text>
|
|
@@ -3,6 +3,7 @@ import { View } from "react-native";
|
|
|
3
3
|
import { Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nNumber } from "@lookiero/i18n-react";
|
|
5
5
|
import { PriceProjection } from "../../../../../projection/price/price";
|
|
6
|
+
import { DOMAIN } from "../../../i18n/i18n";
|
|
6
7
|
import { style } from "./Price.style";
|
|
7
8
|
|
|
8
9
|
type PriceVariant = "default" | "detail" | "subtotal" | "total";
|
|
@@ -29,11 +30,13 @@ interface PriceProps {
|
|
|
29
30
|
const Price: FC<PriceProps> = ({ price, variant = "default", withPercentage = false }) => {
|
|
30
31
|
const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
|
|
31
32
|
const productPrice = useI18nNumber({
|
|
33
|
+
domain: DOMAIN,
|
|
32
34
|
value: price.amount / 100,
|
|
33
35
|
style: "currency",
|
|
34
36
|
currency: price.currency,
|
|
35
37
|
});
|
|
36
38
|
const productDiscountedPrice = useI18nNumber({
|
|
39
|
+
domain: DOMAIN,
|
|
37
40
|
value: (price.discountedPrice?.amount || 0) / 100,
|
|
38
41
|
style: "currency",
|
|
39
42
|
currency: price.currency,
|
|
@@ -51,7 +51,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
|
|
|
51
51
|
"paddingBottom": 0,
|
|
52
52
|
"paddingLeft": 0,
|
|
53
53
|
"paddingRight": 0,
|
|
54
|
-
"paddingTop":
|
|
54
|
+
"paddingTop": 0,
|
|
55
55
|
},
|
|
56
56
|
]
|
|
57
57
|
}
|
|
@@ -81,7 +81,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
|
|
|
81
81
|
"paddingBottom": 0,
|
|
82
82
|
"paddingLeft": 0,
|
|
83
83
|
"paddingRight": 0,
|
|
84
|
-
"paddingTop":
|
|
84
|
+
"paddingTop": 0,
|
|
85
85
|
"textDecorationLine": "line-through",
|
|
86
86
|
},
|
|
87
87
|
]
|
|
@@ -146,7 +146,7 @@ exports[`Price atom matches the snapshot for a non-discounted price: non-discoun
|
|
|
146
146
|
"paddingBottom": 0,
|
|
147
147
|
"paddingLeft": 0,
|
|
148
148
|
"paddingRight": 0,
|
|
149
|
-
"paddingTop":
|
|
149
|
+
"paddingTop": 0,
|
|
150
150
|
},
|
|
151
151
|
]
|
|
152
152
|
}
|
|
@@ -1,16 +1,37 @@
|
|
|
1
|
-
import { StyleSheet
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
colorBorderActionSecondary,
|
|
6
|
+
colorBgActionPrimaryActive,
|
|
7
|
+
colorTextActionPrimary,
|
|
8
|
+
borderWidth2,
|
|
9
|
+
borderRadiusFull,
|
|
10
|
+
space6,
|
|
11
|
+
space16,
|
|
12
|
+
} = theme();
|
|
13
|
+
|
|
14
|
+
const HEIGHT = space16;
|
|
5
15
|
|
|
6
16
|
const style = StyleSheet.create({
|
|
7
17
|
button: {
|
|
18
|
+
alignContent: "center",
|
|
8
19
|
borderColor: colorBorderActionSecondary,
|
|
9
|
-
|
|
20
|
+
borderRadius: borderRadiusFull,
|
|
10
21
|
borderWidth: borderWidth2,
|
|
11
22
|
flex: 1,
|
|
23
|
+
height: HEIGHT,
|
|
24
|
+
justifyContent: "center",
|
|
12
25
|
marginHorizontal: 12,
|
|
13
|
-
|
|
26
|
+
paddingLeft: space6,
|
|
27
|
+
paddingRight: space6,
|
|
28
|
+
},
|
|
29
|
+
buttonActive: {
|
|
30
|
+
backgroundColor: colorBgActionPrimaryActive,
|
|
31
|
+
},
|
|
32
|
+
textActive: {
|
|
33
|
+
color: colorTextActionPrimary,
|
|
34
|
+
},
|
|
14
35
|
});
|
|
15
36
|
|
|
16
37
|
export { style };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity } from "react-native";
|
|
3
|
+
import { ALIGN, Text } from "@lookiero/aurora";
|
|
3
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
4
6
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
5
7
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
8
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
7
9
|
|
|
10
|
+
const ACTIVE_OPACITY = 0.6;
|
|
11
|
+
|
|
8
12
|
const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
9
13
|
checkoutQuestion,
|
|
10
14
|
checkoutQuestionParentId,
|
|
@@ -12,22 +16,24 @@ const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
12
16
|
}: CheckoutQuestionItemProps) => {
|
|
13
17
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
14
18
|
|
|
15
|
-
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
19
|
+
const optionText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
16
20
|
const handleOnPress = useCallback(
|
|
17
21
|
() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }),
|
|
18
22
|
[onChange, checkoutQuestion.id, checkoutQuestionParentId],
|
|
19
23
|
);
|
|
20
24
|
|
|
21
25
|
return (
|
|
22
|
-
<
|
|
26
|
+
<TouchableOpacity
|
|
23
27
|
accessibilityLabel={testID}
|
|
24
|
-
|
|
28
|
+
activeOpacity={ACTIVE_OPACITY}
|
|
29
|
+
style={[style.button, feedback === checkoutQuestion.id && style.buttonActive]}
|
|
25
30
|
testID={testID}
|
|
26
|
-
variant={feedback === checkoutQuestion.id ? BUTTON_VARIANT.PRIMARY : BUTTON_VARIANT.SECONDARY}
|
|
27
31
|
onPress={handleOnPress}
|
|
28
32
|
>
|
|
29
|
-
{
|
|
30
|
-
|
|
33
|
+
<Text align={ALIGN.CENTER} level={3} style={feedback === checkoutQuestion.id && style.textActive} action>
|
|
34
|
+
{optionText}
|
|
35
|
+
</Text>
|
|
36
|
+
</TouchableOpacity>
|
|
31
37
|
);
|
|
32
38
|
};
|
|
33
39
|
|
|
@@ -2,6 +2,7 @@ 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";
|
|
5
6
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
7
|
import { style } from "./HostDefaultCheckoutQuestionItem.style";
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ const HostDefaultCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
9
10
|
checkoutQuestion,
|
|
10
11
|
children,
|
|
11
12
|
}: CheckoutQuestionItemProps) => {
|
|
12
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
13
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<>
|
|
@@ -2,6 +2,7 @@ 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";
|
|
5
6
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
7
|
import { style } from "./HostSelectCheckoutQuestionItem.style";
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ const HostSelectCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
9
10
|
checkoutQuestion,
|
|
10
11
|
children,
|
|
11
12
|
}: CheckoutQuestionItemProps) => {
|
|
12
|
-
const titleText = useI18nMessage({ id: checkoutQuestion.name });
|
|
13
|
+
const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useI18n } from "@lookiero/i18n-react";
|
|
3
3
|
import { InputField, TextInput } from "@lookiero/sty-psp-ui";
|
|
4
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
4
5
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
5
6
|
import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
|
|
6
7
|
import { style } from "./TextareaCheckoutQuestionItem.style";
|
|
@@ -10,7 +11,7 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
10
11
|
checkoutQuestionParentId,
|
|
11
12
|
testID,
|
|
12
13
|
}: CheckoutQuestionItemProps) => {
|
|
13
|
-
const { formatMessage } =
|
|
14
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
14
15
|
const placeholderText = useMemo(
|
|
15
16
|
() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""),
|
|
16
17
|
[formatMessage, checkoutQuestion.placeholder],
|
|
@@ -32,6 +33,7 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
|
|
|
32
33
|
placeholder={placeholderText}
|
|
33
34
|
style={style}
|
|
34
35
|
testID={testID}
|
|
36
|
+
textAlignVertical="top"
|
|
35
37
|
value={feedback}
|
|
36
38
|
multiline
|
|
37
39
|
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 { useI18n } from "@lookiero/i18n-react";
|
|
5
5
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
6
|
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
7
|
-
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
7
|
+
import { DOMAIN, 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 } = useI18n({ domain: DOMAIN });
|
|
16
16
|
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
17
17
|
|
|
18
18
|
return (
|
|
@@ -2,8 +2,9 @@
|
|
|
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 { useI18n } from "@lookiero/i18n-react";
|
|
6
6
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
7
8
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
8
9
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
9
10
|
|
|
@@ -12,7 +13,7 @@ const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HO
|
|
|
12
13
|
children,
|
|
13
14
|
testID,
|
|
14
15
|
}) => {
|
|
15
|
-
const { formatMessage } =
|
|
16
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
16
17
|
const placeholderText = useMemo(
|
|
17
18
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
18
19
|
[formatMessage, returnQuestion.metadata.placeholder],
|
|
@@ -2,9 +2,10 @@
|
|
|
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 { useI18n } 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";
|
|
8
9
|
import {
|
|
9
10
|
useReturnQuestionFeedback,
|
|
10
11
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -22,7 +23,7 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_S
|
|
|
22
23
|
portalHostName,
|
|
23
24
|
testID,
|
|
24
25
|
}) => {
|
|
25
|
-
const { formatMessage } =
|
|
26
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
26
27
|
const placeholderText = useMemo(
|
|
27
28
|
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
28
29
|
[formatMessage, returnQuestion.metadata.placeholder],
|
|
@@ -34,10 +35,9 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_S
|
|
|
34
35
|
|
|
35
36
|
const feedback = useReturnQuestionFeedback();
|
|
36
37
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
37
|
-
const intl = useIntl();
|
|
38
38
|
const translate = useCallback(
|
|
39
|
-
(returnQuestionName: string) =>
|
|
40
|
-
[
|
|
39
|
+
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
40
|
+
[formatMessage],
|
|
41
41
|
);
|
|
42
42
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
43
43
|
|
|
@@ -3,9 +3,10 @@ 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 { useI18n } 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";
|
|
9
10
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
10
11
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
11
12
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
@@ -16,7 +17,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_ST
|
|
|
16
17
|
children,
|
|
17
18
|
portalHostName,
|
|
18
19
|
}) => {
|
|
19
|
-
const { formatMessage } =
|
|
20
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
20
21
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
21
22
|
const feedbackReturnQuestion = feedback
|
|
22
23
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
@@ -1,10 +1,11 @@
|
|
|
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 { useI18n } 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";
|
|
8
9
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
9
10
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
10
11
|
|
|
@@ -22,7 +23,7 @@ const ModalOptionReturnQuestionItems = ({
|
|
|
22
23
|
visible,
|
|
23
24
|
onClose,
|
|
24
25
|
}: ModalOptionReturnQuestionItemsProps) => {
|
|
25
|
-
const { formatMessage } =
|
|
26
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
26
27
|
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
27
28
|
|
|
28
29
|
return (
|
|
@@ -4,6 +4,7 @@ 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";
|
|
7
8
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
9
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
10
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
@@ -15,7 +16,7 @@ const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> =
|
|
|
15
16
|
}) => {
|
|
16
17
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
17
18
|
|
|
18
|
-
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
19
|
+
const optionText = useI18nMessage({ domain: DOMAIN, id: returnQuestion.translationKey });
|
|
19
20
|
const handleOnPress = useCallback(
|
|
20
21
|
() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }),
|
|
21
22
|
[onChange, returnQuestion.id, returnQuestionParent.id],
|
|
@@ -1,8 +1,9 @@
|
|
|
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 { useI18n } from "@lookiero/i18n-react";
|
|
5
5
|
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
|
+
import { DOMAIN } from "../../../../../i18n/i18n";
|
|
6
7
|
import {
|
|
7
8
|
useReturnQuestionFeedback,
|
|
8
9
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -21,7 +22,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = (
|
|
|
21
22
|
testID,
|
|
22
23
|
portalHostName,
|
|
23
24
|
}) => {
|
|
24
|
-
const
|
|
25
|
+
const { formatMessage } = useI18n({ domain: DOMAIN });
|
|
25
26
|
const [modalVisible, setModalVisible] = useState(false);
|
|
26
27
|
const {
|
|
27
28
|
feedback: feedbackId,
|
|
@@ -30,12 +31,12 @@ const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = (
|
|
|
30
31
|
} = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
31
32
|
const feedback = useReturnQuestionFeedback();
|
|
32
33
|
const translate = useCallback(
|
|
33
|
-
(returnQuestionName: string) =>
|
|
34
|
-
[
|
|
34
|
+
(returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
|
|
35
|
+
[formatMessage],
|
|
35
36
|
);
|
|
36
37
|
|
|
37
38
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
38
|
-
const optionText =
|
|
39
|
+
const optionText = formatMessage({ id: returnQuestion.translationKey });
|
|
39
40
|
|
|
40
41
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
41
42
|
|