@lookiero/checkout 8.13.2 → 8.13.3-beta.1

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.
Files changed (69) hide show
  1. package/dist/public/public/assets/adaptive-icon.png +0 -0
  2. package/dist/public/public/assets/favicon.png +0 -0
  3. package/dist/public/public/assets/icon.png +0 -0
  4. package/dist/public/public/assets/splash.png +0 -0
  5. package/dist/public/public/images/not-found.png +0 -0
  6. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +10 -0
  7. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +17 -0
  8. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +21 -0
  9. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
  10. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +6 -0
  11. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +4 -0
  12. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +6 -0
  13. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +5 -0
  14. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
  15. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +19 -0
  16. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +3 -0
  17. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +18 -0
  18. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
  19. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +13 -0
  20. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +6 -0
  21. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +11 -0
  22. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
  23. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +11 -0
  24. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +11 -0
  25. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +49 -0
  26. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +9 -0
  27. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +9 -0
  28. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +19 -0
  29. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +21 -0
  30. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +9 -0
  31. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +21 -0
  32. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
  33. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +10 -0
  34. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +11 -0
  35. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +40 -0
  36. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
  37. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +15 -0
  38. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
  39. package/dist/src/infrastructure/ui/views/return/Return.style.js +43 -0
  40. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +9 -8
  41. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +6 -2
  42. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +6 -2
  43. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +13 -0
  44. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +9 -0
  45. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
  46. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +10 -0
  47. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +17 -0
  48. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +13 -0
  49. package/dist/src/projection/shared/country.d.ts +14 -0
  50. package/dist/src/projection/shared/country.js +15 -0
  51. package/dist/src/projection/shared/customer.d.ts +8 -0
  52. package/dist/src/projection/shared/customer.js +1 -0
  53. package/dist/src/projection/shared/locale.d.ts +12 -0
  54. package/dist/src/projection/shared/locale.js +13 -0
  55. package/dist/src/projection/shared/order.d.ts +6 -0
  56. package/dist/src/projection/shared/order.js +1 -0
  57. package/dist/src/projection/shared/price.d.ts +10 -0
  58. package/dist/src/projection/shared/price.js +1 -0
  59. package/dist/src/projection/shared/size.d.ts +20 -0
  60. package/dist/src/projection/shared/size.js +3 -0
  61. package/dist/src/projection/shared/subscription.d.ts +2 -0
  62. package/dist/src/projection/shared/subscription.js +1 -0
  63. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +10 -0
  64. package/dist/src/shared/ui/components/atoms/error/Error.js +4 -0
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/version.js +1 -1
  67. package/package.json +1 -1
  68. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +6 -2
  69. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +28 -23
@@ -0,0 +1,10 @@
1
+ import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
+ import { IsCheckoutAccessibleByCustomerIdProjection } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
3
+ interface UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs {
4
+ readonly customerId: string | undefined;
5
+ }
6
+ interface UseViewIsCheckoutAccessibleByCustomerIdFunction {
7
+ (args: UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs): UseQueryFunctionResult<IsCheckoutAccessibleByCustomerIdProjection>;
8
+ }
9
+ declare const useViewIsCheckoutAccessibleByCustomerId: UseViewIsCheckoutAccessibleByCustomerIdFunction;
10
+ export { useViewIsCheckoutAccessibleByCustomerId };
@@ -0,0 +1,17 @@
1
+ import { useQuery } from "@lookiero/messaging-react";
2
+ import { isCheckoutFeedbackGiven } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
3
+ import { viewIsCheckoutAccessibleByCustomerId, } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
4
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
+ const useViewIsCheckoutAccessibleByCustomerId = ({ customerId }) => useQuery({
6
+ query: viewIsCheckoutAccessibleByCustomerId({ customerId }),
7
+ contextId: MESSAGING_CONTEXT_ID,
8
+ invalidation: isCheckoutFeedbackGiven,
9
+ options: {
10
+ refetchOnMount: "always",
11
+ staleTime: Infinity,
12
+ retry: false,
13
+ refetchOnWindowFocus: false,
14
+ cacheTime: 0,
15
+ },
16
+ });
17
+ export { useViewIsCheckoutAccessibleByCustomerId };
@@ -0,0 +1,21 @@
1
+ import { FC, ReactNode, RefObject } from "react";
2
+ import { LayoutChangeEvent, ScrollView, StyleProp, ViewStyle } from "react-native";
3
+ interface LayoutStyle {
4
+ readonly safeAreaView: StyleProp<ViewStyle>;
5
+ readonly scrollView: StyleProp<ViewStyle>;
6
+ readonly header: StyleProp<ViewStyle>;
7
+ }
8
+ interface LayoutProps {
9
+ readonly children: ReactNode;
10
+ readonly header?: JSX.Element | null;
11
+ readonly footer?: JSX.Element | null;
12
+ readonly panel?: JSX.Element | null;
13
+ readonly stickyHeader?: boolean;
14
+ readonly stickyHeaderHiddenOnScroll?: boolean;
15
+ readonly scrollRef?: RefObject<ScrollView>;
16
+ readonly scrollEnabled?: boolean;
17
+ readonly style?: Partial<LayoutStyle>;
18
+ readonly onLayout?: (event: LayoutChangeEvent) => void;
19
+ }
20
+ type Layout = FC<LayoutProps>;
21
+ export type { Layout };
@@ -0,0 +1,6 @@
1
+ import { FC, ReactNode } from "react";
2
+ interface FooterProps {
3
+ readonly children: ReactNode;
4
+ }
5
+ declare const Footer: FC<FooterProps>;
6
+ export { Footer };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { Platform } from "react-native";
3
+ const Footer = ({ children }) => (Platform.OS !== "web" ? React.createElement(React.Fragment, null, children) : null);
4
+ export { Footer };
@@ -0,0 +1,6 @@
1
+ import { FC, ReactNode } from "react";
2
+ interface HeaderProps {
3
+ readonly children: ReactNode;
4
+ }
5
+ declare const Header: FC<HeaderProps>;
6
+ export { Header };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { style } from "./Header.style";
4
+ const Header = ({ children }) => React.createElement(View, { style: style.header }, children);
5
+ export { Header };
@@ -0,0 +1,4 @@
1
+ declare const style: {
2
+ header: {};
3
+ };
4
+ export { style };
@@ -0,0 +1,19 @@
1
+ import { Platform, StyleSheet } from "react-native";
2
+ import { HEADER_HEIGHT } from "../../../../templates/header/Header.style";
3
+ const style = StyleSheet.create({
4
+ header: {
5
+ ...Platform.select({
6
+ web: {
7
+ position: "sticky",
8
+ top: 0,
9
+ zIndex: 10,
10
+ height: HEADER_HEIGHT,
11
+ },
12
+ native: {
13
+ position: "relative",
14
+ height: HEADER_HEIGHT,
15
+ },
16
+ }),
17
+ },
18
+ });
19
+ export { style };
@@ -0,0 +1,3 @@
1
+ import { Layout } from "../Layout";
2
+ declare const DummyLayout: Layout;
3
+ export { DummyLayout };
@@ -0,0 +1,18 @@
1
+ /* eslint-disable react/prop-types */
2
+ import React from "react";
3
+ import { View } from "react-native";
4
+ import { GestureHandlerRootView, ScrollView as RNGHScrollView } from "react-native-gesture-handler";
5
+ import { SafeAreaView } from "react-native-safe-area-context";
6
+ import { Footer as DefaultFooter } from "../../../templates/footer/Footer";
7
+ import { DefaultHeader } from "../../../templates/header/defaultHeader/DefaultHeader";
8
+ import { Footer } from "../components/footer/Footer";
9
+ import { Header } from "../components/header/Header";
10
+ import { style } from "./DummyLayout.style";
11
+ const DummyLayout = ({ children, header = React.createElement(DefaultHeader, null), footer = React.createElement(DefaultFooter, null), panel, style: customStyle, scrollEnabled, onLayout, }) => (React.createElement(SafeAreaView, { style: [style.safeAreaView, customStyle?.safeAreaView] },
12
+ React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
13
+ React.createElement(RNGHScrollView, { contentContainerStyle: [style.scrollView, customStyle?.scrollView], scrollEnabled: scrollEnabled, scrollEventThrottle: 16, showsVerticalScrollIndicator: false, stickyHeaderIndices: [0] },
14
+ React.createElement(Header, null, header),
15
+ panel,
16
+ React.createElement(View, { style: style.children, onLayout: onLayout }, children))),
17
+ React.createElement(Footer, null, footer)));
18
+ export { DummyLayout };
@@ -0,0 +1,12 @@
1
+ declare const style: {
2
+ children: {
3
+ flex: number;
4
+ };
5
+ safeAreaView: {
6
+ flex: number;
7
+ };
8
+ scrollView: {
9
+ flexGrow: number;
10
+ };
11
+ };
12
+ export { style };
@@ -0,0 +1,13 @@
1
+ import { StyleSheet } from "react-native";
2
+ const style = StyleSheet.create({
3
+ children: {
4
+ flex: 1,
5
+ },
6
+ safeAreaView: {
7
+ flex: 1,
8
+ },
9
+ scrollView: {
10
+ flexGrow: 1,
11
+ },
12
+ });
13
+ export { style };
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ interface DefaultHeaderProps {
3
+ readonly onPressMenu?: () => void;
4
+ }
5
+ declare const DefaultHeader: FC<DefaultHeaderProps>;
6
+ export { DefaultHeader };
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { ButtonIcon } from "@lookiero/aurora";
3
+ import { Header } from "../Header";
4
+ import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
5
+ import { Logo } from "../logo/Logo";
6
+ import { style } from "./DefaultHeader.style";
7
+ const DefaultHeader = ({ onPressMenu }) => (React.createElement(Header, { testID: "default-header" },
8
+ React.createElement(Logo, null),
9
+ React.createElement(ButtonIconPlaceholder, null),
10
+ React.createElement(ButtonIcon, { name: "menu", style: style.button, testID: "menu-button-icon", onPress: onPressMenu })));
11
+ export { DefaultHeader };
@@ -0,0 +1,8 @@
1
+ declare const style: {
2
+ button: {
3
+ alignSelf: "auto";
4
+ height: number;
5
+ width: number;
6
+ };
7
+ };
8
+ export { style };
@@ -0,0 +1,11 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
3
+ const { space10 } = theme();
4
+ const style = StyleSheet.create({
5
+ button: {
6
+ alignSelf: "auto",
7
+ height: space10,
8
+ width: space10,
9
+ },
10
+ });
11
+ export { style };
@@ -0,0 +1,11 @@
1
+ import { FC, ReactNode } from "react";
2
+ declare enum NewFeedbackExperimentVariation {
3
+ CONTROL = "control",
4
+ RETURN_PAGE = "return_page"
5
+ }
6
+ interface NewFeedbackExperimentProviderProps {
7
+ readonly children: ReactNode;
8
+ }
9
+ declare const NewFeedbackExperimentProvider: FC<NewFeedbackExperimentProviderProps>;
10
+ declare const useNewFeedbackExperiment: () => NewFeedbackExperimentVariation;
11
+ export { useNewFeedbackExperiment, NewFeedbackExperimentProvider, NewFeedbackExperimentVariation };
@@ -0,0 +1,49 @@
1
+ import React, { createContext, useContext, useEffect, useMemo, useRef } from "react";
2
+ import invariant from "tiny-invariant";
3
+ import { Spinner } from "@lookiero/aurora";
4
+ import { useAssignedVariationByExperimentId } from "@lookiero/sty-psp-ab-testing";
5
+ import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
6
+ import { useTrackAssignedVariationByExperiment } from "../../tracking/useTrackAssignedVariationByExperiment";
7
+ import { useStaticInfo } from "./useStaticInfo";
8
+ var NewFeedbackExperimentVariation;
9
+ (function (NewFeedbackExperimentVariation) {
10
+ NewFeedbackExperimentVariation["CONTROL"] = "control";
11
+ NewFeedbackExperimentVariation["RETURN_PAGE"] = "return_page";
12
+ })(NewFeedbackExperimentVariation || (NewFeedbackExperimentVariation = {}));
13
+ const NewFeedbackExperimentContext = createContext(null);
14
+ const NewFeedbackExperimentProvider = ({ children }) => {
15
+ const { kameleoon: { experiments: { newFeedback: { id: newFeedbackId, variations }, }, }, customer: { customerId, country, segment }, } = useStaticInfo();
16
+ const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
17
+ const { assignedVariation: newFeedbackVariation } = useAssignedVariationByExperimentId({
18
+ experimentId: newFeedbackId,
19
+ });
20
+ const trackAssignedVariation = useTrackAssignedVariationByExperiment({
21
+ checkoutId: checkout?.id,
22
+ country,
23
+ segment,
24
+ experimentId: newFeedbackId,
25
+ });
26
+ const value = useMemo(() => ({
27
+ variation: newFeedbackVariation?.id === Number(variations.v1)
28
+ ? NewFeedbackExperimentVariation.RETURN_PAGE
29
+ : NewFeedbackExperimentVariation.CONTROL,
30
+ }), [newFeedbackVariation?.id, variations.v1]);
31
+ const assignedVariantTracked = useRef(false);
32
+ useEffect(() => {
33
+ if (assignedVariantTracked.current || !newFeedbackVariation || !checkout?.id) {
34
+ return;
35
+ }
36
+ trackAssignedVariation({ assignedVariation: newFeedbackVariation });
37
+ assignedVariantTracked.current = true;
38
+ }, [checkout?.id, newFeedbackVariation, trackAssignedVariation]);
39
+ if (!checkout) {
40
+ return React.createElement(Spinner, null);
41
+ }
42
+ return React.createElement(NewFeedbackExperimentContext.Provider, { value: value }, children);
43
+ };
44
+ const useNewFeedbackExperiment = () => {
45
+ const newFeedbackExperiment = useContext(NewFeedbackExperimentContext);
46
+ invariant(newFeedbackExperiment, "Your are trying to use the useNewFeedbackExperiment hook without wrapping your app with the <NewFeedbackExperimentProvider>.");
47
+ return newFeedbackExperiment.variation;
48
+ };
49
+ export { useNewFeedbackExperiment, NewFeedbackExperimentProvider, NewFeedbackExperimentVariation };
@@ -0,0 +1,9 @@
1
+ import { EndpointFunction, FetchTranslationFuction } from "@lookiero/i18n";
2
+ interface FetchTranslationsFuntionArgs {
3
+ readonly translations: EndpointFunction[];
4
+ }
5
+ interface FetchTranslationsFuntion {
6
+ (args: FetchTranslationsFuntionArgs): FetchTranslationFuction;
7
+ }
8
+ declare const fetchTranslations: FetchTranslationsFuntion;
9
+ export { fetchTranslations };
@@ -0,0 +1,9 @@
1
+ import { fetchFetchTranslation } from "@lookiero/i18n";
2
+ const fetchTranslations = ({ translations }) => async ({ locale }) => {
3
+ const translationsMessages = await Promise.all(translations.map((endpoint) => fetchFetchTranslation({ endpoint })({ locale })));
4
+ return translationsMessages.reduce((acc, translationMessages) => ({
5
+ ...acc,
6
+ ...translationMessages,
7
+ }), {});
8
+ };
9
+ export { fetchTranslations };
@@ -0,0 +1,19 @@
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 };
@@ -0,0 +1,21 @@
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 };
@@ -0,0 +1,9 @@
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 };
@@ -0,0 +1,21 @@
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 };
@@ -0,0 +1,7 @@
1
+ declare const style: {
2
+ buttonContainer: {
3
+ paddingHorizontal: number;
4
+ paddingVertical: number;
5
+ };
6
+ };
7
+ export { style };
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,11 @@
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 };
@@ -0,0 +1,40 @@
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 };
@@ -0,0 +1,12 @@
1
+ declare const style: {
2
+ modalContent: {
3
+ paddingHorizontal: number;
4
+ };
5
+ submit: {
6
+ marginTop: number;
7
+ };
8
+ title: {
9
+ marginBottom: number;
10
+ };
11
+ };
12
+ export { style };
@@ -0,0 +1,15 @@
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 };
@@ -0,0 +1,40 @@
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 };
@@ -0,0 +1,43 @@
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 };
@@ -101,13 +101,14 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
101
101
  } },
102
102
  React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
103
103
  React.createElement(ScrollView, { showsVerticalScrollIndicator: false, testID: "return-questions-form" },
104
- React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
105
- React.createElement(Box, { size: { L: "2/3" } },
106
- React.createElement(View, { style: [style.info, !screen.S && style.desktopInfo] },
107
- React.createElement(Text, { level: 3, heading: true }, titleText),
108
- React.createElement(Text, { level: 1, style: style.description, detail: true }, descriptionText)),
109
- React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
110
- React.createElement(View, { style: style.submit },
111
- React.createElement(Button, { testID: "return-questions-button", onPress: handleOnSubmit }, submitButtonText))))))));
104
+ React.createElement(View, { style: style.background },
105
+ React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
106
+ React.createElement(Box, { size: { L: "2/3" } },
107
+ React.createElement(View, { style: [style.info, !screen.S && style.desktopInfo] },
108
+ React.createElement(Text, { level: 3, heading: true }, titleText),
109
+ React.createElement(Text, { level: 1, style: style.description, detail: true }, descriptionText)),
110
+ React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
111
+ React.createElement(View, { style: [style.submit, !screen.S && style.submitDesktop] },
112
+ React.createElement(Button, { testID: "return-questions-button", onPress: handleOnSubmit }, submitButtonText)))))))));
112
113
  };
113
114
  export { ReturnQuestionsForm };
@@ -1,4 +1,7 @@
1
1
  declare const style: {
2
+ background: {
3
+ backgroundColor: string;
4
+ };
2
5
  description: {
3
6
  color: string;
4
7
  };
@@ -27,7 +30,6 @@ declare const style: {
27
30
  justifyContent: "center";
28
31
  };
29
32
  safeAreaView: {
30
- backgroundColor: string;
31
33
  flex: number;
32
34
  };
33
35
  scrollView: {
@@ -35,9 +37,11 @@ declare const style: {
35
37
  };
36
38
  submit: {
37
39
  backgroundColor: string;
40
+ padding: number;
41
+ };
42
+ submitDesktop: {
38
43
  borderBottomLeftRadius: number;
39
44
  borderBottomRightRadius: number;
40
- padding: number;
41
45
  };
42
46
  };
43
47
  export { style };
@@ -3,6 +3,9 @@ import { theme } from "@lookiero/sty-psp-ui";
3
3
  import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.style";
4
4
  const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
5
5
  const style = StyleSheet.create({
6
+ background: {
7
+ backgroundColor: colorBgPrimaryLight,
8
+ },
6
9
  description: {
7
10
  color: colorTextMedium,
8
11
  },
@@ -31,7 +34,6 @@ const style = StyleSheet.create({
31
34
  justifyContent: "center",
32
35
  },
33
36
  safeAreaView: {
34
- backgroundColor: colorBgPrimaryLight,
35
37
  flex: 1,
36
38
  },
37
39
  scrollView: {
@@ -39,9 +41,11 @@ const style = StyleSheet.create({
39
41
  },
40
42
  submit: {
41
43
  backgroundColor: colorBgBase,
44
+ padding: space6,
45
+ },
46
+ submitDesktop: {
42
47
  borderBottomLeftRadius: borderRadius5,
43
48
  borderBottomRightRadius: borderRadius5,
44
- padding: space6,
45
49
  },
46
50
  });
47
51
  export { style };
@@ -0,0 +1,13 @@
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 };
@@ -0,0 +1,9 @@
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 };
@@ -0,0 +1,7 @@
1
+ declare const style: {
2
+ sticky: {
3
+ paddingBottom: number;
4
+ paddingTop: number;
5
+ };
6
+ };
7
+ export { style };
@@ -0,0 +1,10 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
3
+ const { space3, space4 } = theme();
4
+ const style = StyleSheet.create({
5
+ sticky: {
6
+ paddingBottom: space4,
7
+ paddingTop: space3,
8
+ },
9
+ });
10
+ export { style };
@@ -0,0 +1,17 @@
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, };
@@ -0,0 +1,13 @@
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, };
@@ -0,0 +1,14 @@
1
+ declare enum Country {
2
+ ES = "ES",
3
+ FR = "FR",
4
+ GB = "GB",
5
+ BE = "BE",
6
+ LU = "LU",
7
+ IT = "IT",
8
+ PT = "PT",
9
+ DE = "DE",
10
+ AT = "AT",
11
+ NL = "NL",
12
+ SE = "SE"
13
+ }
14
+ export { Country };
@@ -0,0 +1,15 @@
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 };
@@ -0,0 +1,8 @@
1
+ import { Country } from "@lookiero/sty-psp-locale";
2
+ import { Segment } from "@lookiero/sty-psp-segment";
3
+ interface Customer {
4
+ readonly customerId: string;
5
+ readonly country: Country;
6
+ readonly segment: Segment;
7
+ }
8
+ export type { Customer };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ declare enum Locale {
2
+ ES = "es",
3
+ FR = "fr",
4
+ EN = "en",
5
+ IT = "it",
6
+ PT = "pt",
7
+ DE = "de",
8
+ AT = "at",
9
+ NL = "nl",
10
+ SE = "sv"
11
+ }
12
+ export { Locale };
@@ -0,0 +1,13 @@
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 };
@@ -0,0 +1,6 @@
1
+ interface Order {
2
+ readonly orderNumber: number;
3
+ readonly isFirstOrder: boolean;
4
+ readonly coupon: string | null;
5
+ }
6
+ export type { Order };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Currency } from "../../domain/checkoutItem/model/currency";
2
+ interface PriceProjection {
3
+ readonly amount: number;
4
+ readonly currency: Currency;
5
+ readonly discountedPrice?: {
6
+ readonly amount: number;
7
+ readonly percentage: number;
8
+ };
9
+ }
10
+ export type { PriceProjection };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Country } from "./country";
2
+ interface SizeProjection {
3
+ readonly id: string;
4
+ readonly lookiero: string;
5
+ readonly uk: string;
6
+ readonly it: string;
7
+ readonly europe: string;
8
+ readonly unique: boolean;
9
+ readonly visualOrder?: number;
10
+ }
11
+ interface SizeFunctionArgs {
12
+ readonly size: SizeProjection;
13
+ readonly country: Country;
14
+ }
15
+ interface SizeFunction {
16
+ (args: SizeFunctionArgs): string;
17
+ }
18
+ declare const size: SizeFunction;
19
+ export type { SizeProjection };
20
+ export { size };
@@ -0,0 +1,3 @@
1
+ import { Country } from "./country";
2
+ const size = ({ size, country }) => (country === Country.GB ? size.uk : size.lookiero);
3
+ export { size };
@@ -0,0 +1,2 @@
1
+ type Subscription = "o" | "m" | "b" | "q";
2
+ export type { Subscription };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { COLOR, Text } from "@lookiero/aurora";
3
+ const Error = ({ error, style: customStyle }) => (React.createElement(Text, { color: COLOR.TEXT_ERROR, level: 2, style: customStyle, detail: true }, error));
4
+ export { Error };
@@ -1 +1 @@
1
- export declare const VERSION = "8.13.2";
1
+ export declare const VERSION = "8.13.3-beta.1";
@@ -1 +1 @@
1
- export const VERSION = "8.13.2";
1
+ export const VERSION = "8.13.3-beta.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "8.13.2",
3
+ "version": "8.13.3-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -5,6 +5,9 @@ import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.st
5
5
  const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
6
6
 
7
7
  const style = StyleSheet.create({
8
+ background: {
9
+ backgroundColor: colorBgPrimaryLight,
10
+ },
8
11
  description: {
9
12
  color: colorTextMedium,
10
13
  },
@@ -33,7 +36,6 @@ const style = StyleSheet.create({
33
36
  justifyContent: "center",
34
37
  },
35
38
  safeAreaView: {
36
- backgroundColor: colorBgPrimaryLight,
37
39
  flex: 1,
38
40
  },
39
41
  scrollView: {
@@ -41,9 +43,11 @@ const style = StyleSheet.create({
41
43
  },
42
44
  submit: {
43
45
  backgroundColor: colorBgBase,
46
+ padding: space6,
47
+ },
48
+ submitDesktop: {
44
49
  borderBottomLeftRadius: borderRadius5,
45
50
  borderBottomRightRadius: borderRadius5,
46
- padding: space6,
47
51
  },
48
52
  });
49
53
 
@@ -154,29 +154,34 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
154
154
  <ProductVariantPreview country={country} item={checkoutItem} />
155
155
 
156
156
  <ScrollView showsVerticalScrollIndicator={false} testID="return-questions-form">
157
- <AuroraLayout fullWidth={!screen.L} style={[style.layout, screen.L ? style.desktopLayoutSpacing : undefined]}>
158
- <Box size={{ L: "2/3" }}>
159
- <View style={[style.info, !screen.S && style.desktopInfo]}>
160
- <Text level={3} heading>
161
- {titleText}
162
- </Text>
163
- <Text level={1} style={style.description} detail>
164
- {descriptionText}
165
- </Text>
166
- </View>
167
-
168
- <ReturnQuestions
169
- portalHostName={RETURN_QUESTION_FORM_PORTAL_HOST_NAME}
170
- returnQuestions={returnQuestions}
171
- />
172
-
173
- <View style={style.submit}>
174
- <Button testID="return-questions-button" onPress={handleOnSubmit}>
175
- {submitButtonText}
176
- </Button>
177
- </View>
178
- </Box>
179
- </AuroraLayout>
157
+ <View style={style.background}>
158
+ <AuroraLayout
159
+ fullWidth={!screen.L}
160
+ style={[style.layout, screen.L ? style.desktopLayoutSpacing : undefined]}
161
+ >
162
+ <Box size={{ L: "2/3" }}>
163
+ <View style={[style.info, !screen.S && style.desktopInfo]}>
164
+ <Text level={3} heading>
165
+ {titleText}
166
+ </Text>
167
+ <Text level={1} style={style.description} detail>
168
+ {descriptionText}
169
+ </Text>
170
+ </View>
171
+
172
+ <ReturnQuestions
173
+ portalHostName={RETURN_QUESTION_FORM_PORTAL_HOST_NAME}
174
+ returnQuestions={returnQuestions}
175
+ />
176
+
177
+ <View style={[style.submit, !screen.S && style.submitDesktop]}>
178
+ <Button testID="return-questions-button" onPress={handleOnSubmit}>
179
+ {submitButtonText}
180
+ </Button>
181
+ </View>
182
+ </Box>
183
+ </AuroraLayout>
184
+ </View>
180
185
  </ScrollView>
181
186
  </Layout>
182
187
  </ReturnQuestionItemProvider>