@lookiero/checkout 7.2.0-beta.0 → 7.2.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/index.d.ts +4 -4
- package/dist/index.js +1 -2
- package/dist/src/ExpoRoot.js +11 -11
- package/dist/src/infrastructure/projection/pricing/pricing.d.ts +1 -1
- package/dist/src/infrastructure/tracking/tracking.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackChangeFeedback.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +2 -2
- package/dist/src/infrastructure/tracking/useTrackImageView.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackItemPageView.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackKeepItem.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPageView.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPressBack.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPressContinue.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPressItem.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPressNext.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPressPrevious.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackPressPricing.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackReplaceItem.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackResetItem.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackReturnItem.d.ts +1 -1
- package/dist/src/infrastructure/tracking/useTrackTabView.d.ts +1 -1
- package/dist/src/infrastructure/ui/Root.d.ts +5 -4
- package/dist/src/infrastructure/ui/Root.js +1 -1
- package/dist/src/infrastructure/ui/components/atoms/price/Price.d.ts +1 -1
- package/dist/src/infrastructure/ui/hooks/useStaticInfo.d.ts +1 -1
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +5 -4
- package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.d.ts +3 -3
- package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +1 -1
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/return/components/price/Price.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +1 -1
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.d.ts +3 -3
- package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +1 -1
- package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +1 -1
- package/dist/src/projection/bookedProductsVariants/bookedProductsVariants.d.ts +1 -1
- package/dist/src/projection/checkoutItem/checkoutItem.d.ts +2 -2
- package/dist/src/projection/pricing/pricing.d.ts +1 -1
- package/dist/src/projection/{shared → size}/size.d.ts +1 -1
- package/dist/src/projection/{shared → size}/size.js +1 -1
- package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +1 -1
- package/dist/src/shared/ui/components/molecules/inputField/InputField.js +1 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +4 -5
- package/package.json +4 -4
- package/src/ExpoRoot.tsx +15 -13
- package/src/infrastructure/domain/checkoutItem/model/httpCheckoutItems.test.ts +1 -1
- package/src/infrastructure/projection/pricing/pricing.ts +1 -1
- package/src/infrastructure/tracking/tracking.ts +1 -1
- package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.test.ts +1 -1
- package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.ts +1 -1
- package/src/infrastructure/tracking/useTrackChangeFeedback.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackChangeFeedback.ts +1 -1
- package/src/infrastructure/tracking/useTrackCheckout.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackCheckout.ts +2 -2
- package/src/infrastructure/tracking/useTrackImageView.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackImageView.ts +1 -1
- package/src/infrastructure/tracking/useTrackItemPageView.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackItemPageView.ts +1 -1
- package/src/infrastructure/tracking/useTrackKeepItem.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackKeepItem.ts +1 -1
- package/src/infrastructure/tracking/useTrackPageView.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPageView.ts +1 -1
- package/src/infrastructure/tracking/useTrackPressBack.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPressBack.ts +1 -1
- package/src/infrastructure/tracking/useTrackPressContinue.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPressContinue.ts +1 -1
- package/src/infrastructure/tracking/useTrackPressItem.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPressItem.ts +1 -1
- package/src/infrastructure/tracking/useTrackPressNext.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPressNext.ts +1 -1
- package/src/infrastructure/tracking/useTrackPressPrevious.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPressPrevious.ts +1 -1
- package/src/infrastructure/tracking/useTrackPressPricing.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackPressPricing.ts +1 -1
- package/src/infrastructure/tracking/useTrackReplaceItem.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackReplaceItem.ts +1 -1
- package/src/infrastructure/tracking/useTrackResetItem.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackResetItem.ts +1 -1
- package/src/infrastructure/tracking/useTrackReturnItem.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackReturnItem.ts +1 -1
- package/src/infrastructure/tracking/useTrackTabView.test.tsx +1 -1
- package/src/infrastructure/tracking/useTrackTabView.ts +1 -1
- package/src/infrastructure/ui/Root.tsx +6 -5
- package/src/infrastructure/ui/components/atoms/price/Price.test.tsx +1 -1
- package/src/infrastructure/ui/components/atoms/price/Price.tsx +1 -1
- package/src/infrastructure/ui/hooks/useStaticInfo.test.tsx +1 -1
- package/src/infrastructure/ui/hooks/useStaticInfo.tsx +1 -1
- package/src/infrastructure/ui/routing/Routing.tsx +5 -4
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +1 -1
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +1 -1
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +1 -1
- package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/Item.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +2 -2
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.test.tsx +1 -1
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.tsx +1 -1
- package/src/infrastructure/ui/views/return/components/price/Price.test.tsx +1 -1
- package/src/infrastructure/ui/views/return/components/price/Price.tsx +1 -1
- package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +2 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +1 -1
- package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.test.tsx +1 -1
- package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +3 -3
- package/src/infrastructure/ui/views/summary/Summary.test.tsx +1 -1
- package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.test.tsx +1 -1
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.test.tsx +1 -1
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +2 -2
- package/src/projection/bookedProductsVariants/bookedProductsVariants.ts +1 -1
- package/src/projection/checkoutItem/checkoutItem.ts +2 -2
- package/src/projection/pricing/pricing.ts +1 -1
- package/src/projection/{shared → size}/size.test.ts +1 -1
- package/src/projection/{shared → size}/size.ts +1 -1
- package/src/shared/ui/components/molecules/inputField/InputField.tsx +1 -2
- 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/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -10
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -17
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -21
- 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 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -5
- 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 -19
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -3
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -18
- 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 -13
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -11
- 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 -11
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -11
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -49
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -9
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -9
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -19
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -21
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -9
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -21
- 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 -10
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -40
- 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 -15
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -43
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -13
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -9
- 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 -10
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -17
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -13
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -10
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -4
- package/src/infrastructure/ui/i18n/fetchTranslations.test.ts +0 -29
- package/src/infrastructure/ui/i18n/fetchTranslations.ts +0 -27
- package/src/infrastructure/ui/i18n/translationEndpoint.test.ts +0 -13
- package/src/infrastructure/ui/i18n/translationEndpoint.ts +0 -50
- package/src/projection/shared/country.ts +0 -15
- package/src/projection/shared/locale.ts +0 -13
- package/src/shared/ui/components/atoms/error/Error.test.tsx +0 -11
- package/src/shared/ui/components/atoms/error/Error.tsx +0 -18
- package/src/shared/ui/components/atoms/error/__snapshots__/Error.test.tsx.snap +0 -54
- /package/dist/src/projection/{shared → customer}/customer.d.ts +0 -0
- /package/dist/src/projection/{shared → customer}/customer.js +0 -0
- /package/dist/src/projection/{shared → order}/order.d.ts +0 -0
- /package/dist/src/projection/{shared → order}/order.js +0 -0
- /package/dist/src/projection/{shared → price}/price.d.ts +0 -0
- /package/dist/src/projection/{shared → price}/price.js +0 -0
- /package/dist/src/projection/{shared → subscription}/subscription.d.ts +0 -0
- /package/dist/src/projection/{shared → subscription}/subscription.js +0 -0
- /package/src/projection/{shared → customer}/customer.ts +0 -0
- /package/src/projection/{shared → order}/order.ts +0 -0
- /package/src/projection/{shared → price}/price.ts +0 -0
- /package/src/projection/{shared → subscription}/subscription.ts +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EndpointFunction } from "@lookiero/i18n";
|
|
2
|
-
interface TranslationEndpointFunctionArgs {
|
|
3
|
-
readonly translationsUrl: string;
|
|
4
|
-
readonly translationsApiKey: string;
|
|
5
|
-
}
|
|
6
|
-
interface TranslationEndpointFunction {
|
|
7
|
-
(args: TranslationEndpointFunctionArgs): EndpointFunction;
|
|
8
|
-
}
|
|
9
|
-
declare const translationEndpoint: TranslationEndpointFunction;
|
|
10
|
-
type Project = "user-area-front" | "inventory-catalog" | "checkout";
|
|
11
|
-
interface TranslationExternalEndpointFunctionArgs {
|
|
12
|
-
readonly translationsUrl: string;
|
|
13
|
-
readonly projects: [project: Project, filter?: string][];
|
|
14
|
-
}
|
|
15
|
-
interface TranslationExternalEndpointFunction {
|
|
16
|
-
(args: TranslationExternalEndpointFunctionArgs): EndpointFunction;
|
|
17
|
-
}
|
|
18
|
-
declare const translationExternalEndpoint: TranslationExternalEndpointFunction;
|
|
19
|
-
export { translationEndpoint, translationExternalEndpoint };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Country } from "../../../projection/shared/country";
|
|
2
|
-
import { Locale } from "../../../projection/shared/locale";
|
|
3
|
-
const translationEndpoint = ({ translationsUrl, translationsApiKey }) => (locale) => `${translationsUrl}/${locale}?key=${translationsApiKey}&no-folding=true`;
|
|
4
|
-
const COUNTRY = {
|
|
5
|
-
[Locale.ES]: Country.ES,
|
|
6
|
-
[Locale.FR]: Country.FR,
|
|
7
|
-
[Locale.EN]: Country.GB,
|
|
8
|
-
[Locale.IT]: Country.IT,
|
|
9
|
-
[Locale.PT]: Country.PT,
|
|
10
|
-
[Locale.DE]: Country.DE,
|
|
11
|
-
[Locale.AT]: Country.AT,
|
|
12
|
-
[Locale.NL]: Country.NL,
|
|
13
|
-
[Locale.SE]: Country.SE,
|
|
14
|
-
};
|
|
15
|
-
const translationExternalEndpoint = ({ translationsUrl, projects }) => (locale) => {
|
|
16
|
-
const projectsQueryParam = projects
|
|
17
|
-
.map(([project, filter]) => `projectFilter=${project}${filter ? `:${filter}` : ""}`)
|
|
18
|
-
.join("&");
|
|
19
|
-
return `${translationsUrl}/${locale}/${COUNTRY[locale]}?${projectsQueryParam}`;
|
|
20
|
-
};
|
|
21
|
-
export { translationEndpoint, translationExternalEndpoint };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
interface CheckoutAccessibilityMiddlewareProps {
|
|
3
|
-
readonly customerId: string | undefined;
|
|
4
|
-
readonly onNotAccessible: () => void;
|
|
5
|
-
readonly loader?: JSX.Element;
|
|
6
|
-
readonly children: JSX.Element;
|
|
7
|
-
}
|
|
8
|
-
declare const CheckoutAccessibilityMiddleware: FC<CheckoutAccessibilityMiddlewareProps>;
|
|
9
|
-
export { CheckoutAccessibilityMiddleware };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { Spinner } from "@lookiero/aurora";
|
|
3
|
-
import { QueryStatus } from "@lookiero/messaging-react";
|
|
4
|
-
import { useViewIsCheckoutAccessibleByCustomerId } from "../../projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId";
|
|
5
|
-
const CheckoutAccessibilityMiddleware = ({ customerId, onNotAccessible, loader = React.createElement(Spinner, null), children, }) => {
|
|
6
|
-
const [accessible, status] = useViewIsCheckoutAccessibleByCustomerId({ customerId });
|
|
7
|
-
const onNotAccessibleRef = useRef(onNotAccessible);
|
|
8
|
-
onNotAccessibleRef.current = onNotAccessible;
|
|
9
|
-
const notAccessible = accessible === false || status === QueryStatus.ERROR;
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (notAccessible) {
|
|
12
|
-
onNotAccessibleRef.current();
|
|
13
|
-
}
|
|
14
|
-
}, [notAccessible]);
|
|
15
|
-
return accessible === undefined && [QueryStatus.IDLE, QueryStatus.LOADING].includes(status)
|
|
16
|
-
? loader
|
|
17
|
-
: accessible
|
|
18
|
-
? children
|
|
19
|
-
: null;
|
|
20
|
-
};
|
|
21
|
-
export { CheckoutAccessibilityMiddleware };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
const { space6, space8 } = theme();
|
|
4
|
-
const style = StyleSheet.create({
|
|
5
|
-
buttonContainer: {
|
|
6
|
-
paddingHorizontal: space6,
|
|
7
|
-
paddingVertical: space8,
|
|
8
|
-
},
|
|
9
|
-
});
|
|
10
|
-
export { style };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
3
|
-
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
-
interface ReturnQuestionsFormProps {
|
|
5
|
-
readonly visible: boolean;
|
|
6
|
-
readonly returnQuestions: ReturnQuestionProjection[];
|
|
7
|
-
readonly onSubmit: (feedback: FeedbackProjection) => void;
|
|
8
|
-
readonly onClose: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const ReturnQuestionsForm: FC<ReturnQuestionsFormProps>;
|
|
11
|
-
export { ReturnQuestionsForm };
|
package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { PortalHost } from "@gorhom/portal";
|
|
2
|
-
import React, { useCallback } from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
4
|
-
import { Button, Text } from "@lookiero/aurora";
|
|
5
|
-
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
-
import { Modal } from "@lookiero/sty-psp-ui";
|
|
7
|
-
import { ReturnQuestionType, } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
8
|
-
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
9
|
-
import { useReturnQuestionFeedback } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
10
|
-
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
11
|
-
import { HostDefaultReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem";
|
|
12
|
-
import { HostSelectReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem";
|
|
13
|
-
import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem";
|
|
14
|
-
import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
|
|
15
|
-
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
16
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
17
|
-
import { style } from "./ReturnQuestionsForm.style";
|
|
18
|
-
const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
|
|
19
|
-
const returnQuestionItems = {
|
|
20
|
-
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionItem,
|
|
21
|
-
[ReturnQuestionType.HOST_TEXTAREA]: HostDefaultReturnQuestionItem,
|
|
22
|
-
[ReturnQuestionType.HOST_SELECT]: HostSelectReturnQuestionItem,
|
|
23
|
-
[ReturnQuestionType.HOST_STACK]: HostStackReturnQuestionItem,
|
|
24
|
-
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
25
|
-
[ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
|
|
26
|
-
};
|
|
27
|
-
const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) => {
|
|
28
|
-
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
29
|
-
const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
30
|
-
const feedback = useReturnQuestionFeedback();
|
|
31
|
-
const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
32
|
-
return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
33
|
-
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
34
|
-
React.createElement(Modal, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, testID: "return-questions-form-modal", visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
35
|
-
React.createElement(View, { style: style.modalContent },
|
|
36
|
-
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
37
|
-
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
38
|
-
React.createElement(Button, { style: style.submit, testID: "return-questions-button", onPress: handleOnSubmit }, submitButtonText)))));
|
|
39
|
-
};
|
|
40
|
-
export { ReturnQuestionsForm };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
const { space6, space8 } = theme();
|
|
4
|
-
const style = StyleSheet.create({
|
|
5
|
-
modalContent: {
|
|
6
|
-
paddingHorizontal: space6,
|
|
7
|
-
},
|
|
8
|
-
submit: {
|
|
9
|
-
marginTop: space8,
|
|
10
|
-
},
|
|
11
|
-
title: {
|
|
12
|
-
marginBottom: space6,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
export { style };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
declare const style: {
|
|
2
|
-
description: {
|
|
3
|
-
color: string;
|
|
4
|
-
};
|
|
5
|
-
desktopInfo: {
|
|
6
|
-
borderTopLeftRadius: number;
|
|
7
|
-
borderTopRightRadius: number;
|
|
8
|
-
};
|
|
9
|
-
desktopLayoutSpacing: {
|
|
10
|
-
paddingVertical: number;
|
|
11
|
-
};
|
|
12
|
-
headerWrapper: {
|
|
13
|
-
display: "flex";
|
|
14
|
-
flexDirection: "column";
|
|
15
|
-
};
|
|
16
|
-
info: {
|
|
17
|
-
backgroundColor: string;
|
|
18
|
-
paddingBottom: number;
|
|
19
|
-
paddingHorizontal: number;
|
|
20
|
-
paddingTop: number;
|
|
21
|
-
};
|
|
22
|
-
layout: {
|
|
23
|
-
flex: number;
|
|
24
|
-
justifyContent: "center";
|
|
25
|
-
};
|
|
26
|
-
safeAreaView: {
|
|
27
|
-
backgroundColor: string;
|
|
28
|
-
flex: number;
|
|
29
|
-
};
|
|
30
|
-
scrollView: {
|
|
31
|
-
flex: number;
|
|
32
|
-
};
|
|
33
|
-
submit: {
|
|
34
|
-
backgroundColor: string;
|
|
35
|
-
borderBottomLeftRadius: number;
|
|
36
|
-
borderBottomRightRadius: number;
|
|
37
|
-
padding: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export { style };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
4
|
-
const style = StyleSheet.create({
|
|
5
|
-
description: {
|
|
6
|
-
color: colorTextMedium,
|
|
7
|
-
},
|
|
8
|
-
desktopInfo: {
|
|
9
|
-
borderTopLeftRadius: borderRadius5,
|
|
10
|
-
borderTopRightRadius: borderRadius5,
|
|
11
|
-
},
|
|
12
|
-
desktopLayoutSpacing: {
|
|
13
|
-
paddingVertical: space8,
|
|
14
|
-
},
|
|
15
|
-
headerWrapper: {
|
|
16
|
-
display: "flex",
|
|
17
|
-
flexDirection: "column",
|
|
18
|
-
},
|
|
19
|
-
info: {
|
|
20
|
-
backgroundColor: colorBgBase,
|
|
21
|
-
paddingBottom: space4,
|
|
22
|
-
paddingHorizontal: space6,
|
|
23
|
-
paddingTop: space8,
|
|
24
|
-
},
|
|
25
|
-
layout: {
|
|
26
|
-
flex: 1,
|
|
27
|
-
justifyContent: "center",
|
|
28
|
-
},
|
|
29
|
-
safeAreaView: {
|
|
30
|
-
backgroundColor: colorBgPrimaryLight,
|
|
31
|
-
flex: 1,
|
|
32
|
-
},
|
|
33
|
-
scrollView: {
|
|
34
|
-
flex: 1,
|
|
35
|
-
},
|
|
36
|
-
submit: {
|
|
37
|
-
backgroundColor: colorBgBase,
|
|
38
|
-
borderBottomLeftRadius: borderRadius5,
|
|
39
|
-
borderBottomRightRadius: borderRadius5,
|
|
40
|
-
padding: space6,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
export { style };
|
package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { LayoutRectangle } from "react-native";
|
|
3
|
-
import { PricingProjection } from "../../../../../../projection/pricing/pricing";
|
|
4
|
-
interface StickyPricingProps {
|
|
5
|
-
readonly pricing: PricingProjection;
|
|
6
|
-
readonly totalCheckoutItemsKept: number;
|
|
7
|
-
readonly collapsed: boolean;
|
|
8
|
-
readonly onPress: () => void;
|
|
9
|
-
readonly onSubmit: () => void;
|
|
10
|
-
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
11
|
-
}
|
|
12
|
-
declare const StickyPricing: FC<StickyPricingProps>;
|
|
13
|
-
export { StickyPricing };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
3
|
-
import { Body } from "../../../../components/layouts/body/Body";
|
|
4
|
-
import { Pricing } from "../pricing/Pricing";
|
|
5
|
-
import { style } from "./StickyPricing.style";
|
|
6
|
-
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, onPress, onSubmit, onLayout, }) => (React.createElement(Sticky, { style: style.sticky, onLayout: onLayout },
|
|
7
|
-
React.createElement(Body, null,
|
|
8
|
-
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: collapsed, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onPress: onPress, onSubmit: onSubmit }))));
|
|
9
|
-
export { StickyPricing };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
-
type IsCheckoutAccessibleByCustomerIdProjection = boolean;
|
|
3
|
-
declare const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
4
|
-
interface ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
5
|
-
readonly customerId: string | undefined;
|
|
6
|
-
}
|
|
7
|
-
interface ViewIsCheckoutAccessibleByCustomerId extends Query<typeof VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID>, ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
8
|
-
}
|
|
9
|
-
interface ViewIsCheckoutAccessibleByCustomerIdFunction {
|
|
10
|
-
(payload: ViewIsCheckoutAccessibleByCustomerIdPayload): ViewIsCheckoutAccessibleByCustomerId;
|
|
11
|
-
}
|
|
12
|
-
declare const viewIsCheckoutAccessibleByCustomerId: ViewIsCheckoutAccessibleByCustomerIdFunction;
|
|
13
|
-
interface ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
14
|
-
}
|
|
15
|
-
declare const viewIsCheckoutAccessibleByCustomerIdHandler: QueryHandlerFunction<ViewIsCheckoutAccessibleByCustomerId, IsCheckoutAccessibleByCustomerIdProjection, ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs>;
|
|
16
|
-
export type { IsCheckoutAccessibleByCustomerIdProjection };
|
|
17
|
-
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { query } from "@lookiero/messaging";
|
|
2
|
-
import { viewFirstAvailableCheckoutByCustomerId } from "./viewFirstAvailableCheckoutByCustomerId";
|
|
3
|
-
import { viewIsCheckoutEnabledByCustomerId } from "./viewIsCheckoutEnabledByCustomerId";
|
|
4
|
-
const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
5
|
-
const viewIsCheckoutAccessibleByCustomerId = (payload) => ({
|
|
6
|
-
...query({ name: VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID }),
|
|
7
|
-
...payload,
|
|
8
|
-
});
|
|
9
|
-
const isNonEmptyCustomerId = (customerId) => Boolean(customerId);
|
|
10
|
-
const viewIsCheckoutAccessibleByCustomerIdHandler = ({ queryBus }) => async ({ customerId }) => isNonEmptyCustomerId(customerId) &&
|
|
11
|
-
Boolean(await queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId }))) &&
|
|
12
|
-
Boolean(await queryBus(viewIsCheckoutEnabledByCustomerId({ customerId })));
|
|
13
|
-
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var Country;
|
|
2
|
-
(function (Country) {
|
|
3
|
-
Country["ES"] = "ES";
|
|
4
|
-
Country["FR"] = "FR";
|
|
5
|
-
Country["GB"] = "GB";
|
|
6
|
-
Country["BE"] = "BE";
|
|
7
|
-
Country["LU"] = "LU";
|
|
8
|
-
Country["IT"] = "IT";
|
|
9
|
-
Country["PT"] = "PT";
|
|
10
|
-
Country["DE"] = "DE";
|
|
11
|
-
Country["AT"] = "AT";
|
|
12
|
-
Country["NL"] = "NL";
|
|
13
|
-
Country["SE"] = "SE";
|
|
14
|
-
})(Country || (Country = {}));
|
|
15
|
-
export { Country };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var Locale;
|
|
2
|
-
(function (Locale) {
|
|
3
|
-
Locale["ES"] = "es";
|
|
4
|
-
Locale["FR"] = "fr";
|
|
5
|
-
Locale["EN"] = "en";
|
|
6
|
-
Locale["IT"] = "it";
|
|
7
|
-
Locale["PT"] = "pt";
|
|
8
|
-
Locale["DE"] = "de";
|
|
9
|
-
Locale["AT"] = "at";
|
|
10
|
-
Locale["NL"] = "nl";
|
|
11
|
-
Locale["SE"] = "sv";
|
|
12
|
-
})(Locale || (Locale = {}));
|
|
13
|
-
export { Locale };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { StyleProp, TextStyle } from "react-native";
|
|
3
|
-
type ErrorStyle = StyleProp<TextStyle>;
|
|
4
|
-
interface ErrorProps {
|
|
5
|
-
readonly error?: string | null;
|
|
6
|
-
readonly style?: ErrorStyle;
|
|
7
|
-
}
|
|
8
|
-
declare const Error: FC<ErrorProps>;
|
|
9
|
-
export type { ErrorStyle };
|
|
10
|
-
export { Error };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { EndpointFunction } from "@lookiero/i18n";
|
|
2
|
-
import { fetchTranslations } from "./fetchTranslations";
|
|
3
|
-
import { translationEndpoint } from "./translationEndpoint";
|
|
4
|
-
|
|
5
|
-
const translations: EndpointFunction[] = [
|
|
6
|
-
(locale) => translationEndpoint({ translationsUrl: "", translationsApiKey: "" })(locale),
|
|
7
|
-
(locale) => translationEndpoint({ translationsUrl: "", translationsApiKey: "" })(locale),
|
|
8
|
-
];
|
|
9
|
-
const locale = "es";
|
|
10
|
-
|
|
11
|
-
const mockFetchFetchTranslation = jest.fn();
|
|
12
|
-
jest.mock("@lookiero/i18n", () => ({
|
|
13
|
-
fetchFetchTranslation: jest.fn(() => mockFetchFetchTranslation),
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
describe("fetchTranslations", () => {
|
|
17
|
-
test("does fetch translations with the expected response", async () => {
|
|
18
|
-
mockFetchFetchTranslation
|
|
19
|
-
.mockResolvedValueOnce({ test: "test" })
|
|
20
|
-
.mockResolvedValueOnce({ another_test: "another_test" });
|
|
21
|
-
|
|
22
|
-
const results = await fetchTranslations({ translations })({ locale });
|
|
23
|
-
|
|
24
|
-
expect(results).toStrictEqual({
|
|
25
|
-
test: "test",
|
|
26
|
-
another_test: "another_test",
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EndpointFunction, fetchFetchTranslation, FetchTranslationFuction } from "@lookiero/i18n";
|
|
2
|
-
|
|
3
|
-
interface FetchTranslationsFuntionArgs {
|
|
4
|
-
readonly translations: EndpointFunction[];
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface FetchTranslationsFuntion {
|
|
8
|
-
(args: FetchTranslationsFuntionArgs): FetchTranslationFuction;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const fetchTranslations: FetchTranslationsFuntion =
|
|
12
|
-
({ translations }) =>
|
|
13
|
-
async ({ locale }) => {
|
|
14
|
-
const translationsMessages = await Promise.all(
|
|
15
|
-
translations.map((endpoint) => fetchFetchTranslation({ endpoint })({ locale })),
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
return translationsMessages.reduce(
|
|
19
|
-
(acc, translationMessages) => ({
|
|
20
|
-
...acc,
|
|
21
|
-
...translationMessages,
|
|
22
|
-
}),
|
|
23
|
-
{},
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { fetchTranslations };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { translationEndpoint } from "./translationEndpoint";
|
|
2
|
-
|
|
3
|
-
const translationsUrl = "https://translation_url.com";
|
|
4
|
-
const translationsApiKey = "NZpj4kL_BRo0ugLDTgV34s9ZVlopBFyM";
|
|
5
|
-
const locale = "es";
|
|
6
|
-
|
|
7
|
-
describe("translationEndpoint", () => {
|
|
8
|
-
test("create translation endpoint with the expected response", async () => {
|
|
9
|
-
expect(translationEndpoint({ translationsUrl, translationsApiKey })(locale)).toStrictEqual(
|
|
10
|
-
"https://translation_url.com/es?key=NZpj4kL_BRo0ugLDTgV34s9ZVlopBFyM&no-folding=true",
|
|
11
|
-
);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { EndpointFunction } from "@lookiero/i18n";
|
|
2
|
-
import { Country } from "../../../projection/shared/country";
|
|
3
|
-
import { Locale } from "../../../projection/shared/locale";
|
|
4
|
-
|
|
5
|
-
interface TranslationEndpointFunctionArgs {
|
|
6
|
-
readonly translationsUrl: string;
|
|
7
|
-
readonly translationsApiKey: string;
|
|
8
|
-
}
|
|
9
|
-
interface TranslationEndpointFunction {
|
|
10
|
-
(args: TranslationEndpointFunctionArgs): EndpointFunction;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const translationEndpoint: TranslationEndpointFunction =
|
|
14
|
-
({ translationsUrl, translationsApiKey }) =>
|
|
15
|
-
(locale) =>
|
|
16
|
-
`${translationsUrl}/${locale}?key=${translationsApiKey}&no-folding=true`;
|
|
17
|
-
|
|
18
|
-
type Project = "user-area-front" | "inventory-catalog" | "checkout";
|
|
19
|
-
|
|
20
|
-
const COUNTRY: Record<Locale, Country> = {
|
|
21
|
-
[Locale.ES]: Country.ES,
|
|
22
|
-
[Locale.FR]: Country.FR,
|
|
23
|
-
[Locale.EN]: Country.GB,
|
|
24
|
-
[Locale.IT]: Country.IT,
|
|
25
|
-
[Locale.PT]: Country.PT,
|
|
26
|
-
[Locale.DE]: Country.DE,
|
|
27
|
-
[Locale.AT]: Country.AT,
|
|
28
|
-
[Locale.NL]: Country.NL,
|
|
29
|
-
[Locale.SE]: Country.SE,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
interface TranslationExternalEndpointFunctionArgs {
|
|
33
|
-
readonly translationsUrl: string;
|
|
34
|
-
readonly projects: [project: Project, filter?: string][];
|
|
35
|
-
}
|
|
36
|
-
interface TranslationExternalEndpointFunction {
|
|
37
|
-
(args: TranslationExternalEndpointFunctionArgs): EndpointFunction;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const translationExternalEndpoint: TranslationExternalEndpointFunction =
|
|
41
|
-
({ translationsUrl, projects }) =>
|
|
42
|
-
(locale) => {
|
|
43
|
-
const projectsQueryParam = projects
|
|
44
|
-
.map(([project, filter]) => `projectFilter=${project}${filter ? `:${filter}` : ""}`)
|
|
45
|
-
.join("&");
|
|
46
|
-
|
|
47
|
-
return `${translationsUrl}/${locale}/${COUNTRY[locale as Locale]}?${projectsQueryParam}`;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { translationEndpoint, translationExternalEndpoint };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "../../../../../infrastructure/ui/test/render";
|
|
3
|
-
import { Error } from "./Error";
|
|
4
|
-
|
|
5
|
-
describe("Error atom", () => {
|
|
6
|
-
it("matches the snapshot", () => {
|
|
7
|
-
const { toJSON } = render(<Error error="Error" />);
|
|
8
|
-
|
|
9
|
-
expect(toJSON()).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { FC } from "react";
|
|
2
|
-
import { StyleProp, TextStyle } from "react-native";
|
|
3
|
-
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
|
-
|
|
5
|
-
type ErrorStyle = StyleProp<TextStyle>;
|
|
6
|
-
|
|
7
|
-
interface ErrorProps {
|
|
8
|
-
readonly error?: string | null;
|
|
9
|
-
readonly style?: ErrorStyle;
|
|
10
|
-
}
|
|
11
|
-
const Error: FC<ErrorProps> = ({ error, style: customStyle }) => (
|
|
12
|
-
<Text color={COLOR.TEXT_ERROR} level={2} style={customStyle} detail>
|
|
13
|
-
{error}
|
|
14
|
-
</Text>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export type { ErrorStyle };
|
|
18
|
-
export { Error };
|