@lookiero/checkout 3.8.0-beta.3 → 3.8.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.
Files changed (81) hide show
  1. package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +6 -1
  2. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +1 -1
  3. package/dist/shared/ui/components/layouts/slider/Slider.d.ts +5 -0
  4. package/dist/shared/ui/components/layouts/slider/Slider.js +4 -4
  5. package/package.json +1 -2
  6. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  7. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  8. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  9. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  10. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  11. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  12. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  13. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  14. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +0 -13
  15. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +0 -19
  16. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +0 -6
  17. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.js +0 -7
  18. package/dist/infrastructure/ui/components/templates/header/header/Header.d.ts +0 -3
  19. package/dist/infrastructure/ui/components/templates/header/header/Header.js +0 -10
  20. package/dist/infrastructure/ui/components/templates/header/header/Header.style.d.ts +0 -9
  21. package/dist/infrastructure/ui/components/templates/header/header/Header.style.js +0 -12
  22. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.d.ts +0 -13
  23. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.js +0 -19
  24. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.d.ts +0 -6
  25. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.js +0 -7
  26. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +0 -2
  27. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +0 -28
  28. package/dist/infrastructure/ui/hooks/useToast.d.ts +0 -11
  29. package/dist/infrastructure/ui/hooks/useToast.js +0 -49
  30. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  31. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  32. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  33. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  34. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  35. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  36. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -52
  37. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -55
  38. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
  39. package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
  40. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
  41. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
  42. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
  43. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
  44. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  45. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  46. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  47. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  48. package/dist/infrastructure/ui/views/navigation/Navigation.d.ts +0 -21
  49. package/dist/infrastructure/ui/views/navigation/Navigation.js +0 -45
  50. package/dist/infrastructure/ui/views/navigation/Navigation.style.d.ts +0 -5
  51. package/dist/infrastructure/ui/views/navigation/Navigation.style.js +0 -30
  52. package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +0 -46
  53. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +0 -120
  54. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +0 -31
  55. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +0 -34
  56. package/dist/infrastructure/ui/views/navigation/components/header/Logo.d.ts +0 -7
  57. package/dist/infrastructure/ui/views/navigation/components/header/Logo.js +0 -11
  58. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.d.ts +0 -7
  59. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.js +0 -8
  60. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +0 -12
  61. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +0 -24
  62. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +0 -15
  63. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +0 -18
  64. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  65. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  66. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  67. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  68. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  69. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  70. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  71. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  72. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  73. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  74. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  75. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  76. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
  77. package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
  78. package/dist/shared/ui/components/layouts/slider/Bullets.d.ts +0 -10
  79. package/dist/shared/ui/components/layouts/slider/Bullets.js +0 -29
  80. package/dist/shared/ui/components/layouts/slider/Bullets.style.d.ts +0 -12
  81. package/dist/shared/ui/components/layouts/slider/Bullets.style.js +0 -15
@@ -10,7 +10,12 @@ const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
10
10
  setActive(activeIndex);
11
11
  onChanged?.(activeIndex);
12
12
  }, [onChanged]);
13
- return (React.createElement(Slider, { active: active, onChanged: handleOnActiveChanged }, producVariantMedia.map((media) => (React.createElement(Image, { key: media.perspective, resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
13
+ return (React.createElement(Slider, { active: active, paginationActiveItemStyle: style.paginationActiveItemStyle, paginationItemStyle: style.paginationItemStyle, paginationStyle: style.paginationStyle, paginationRenderItem: (index) => (React.createElement(Image, { key: producVariantMedia[index]?.perspective, resizeMode: "contain", style: style.paginationImage, testID: "product-variant-pagination-image", source: {
14
+ uri: cdnImageUrl({
15
+ url: producVariantMedia[index]?.url,
16
+ width: 80,
17
+ }),
18
+ } })), onChanged: handleOnActiveChanged }, producVariantMedia.map((media) => (React.createElement(Image, { key: media.perspective, resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
14
19
  uri: cdnImageUrl({
15
20
  url: media.url,
16
21
  width: 600,
@@ -31,7 +31,7 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
31
31
  const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
32
32
  const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
33
33
  return (React.createElement(React.Fragment, null,
34
- collapsible && (React.createElement(Pressable, { style: style.iconContainer, testID: "collapsed", onPress: collapsible ? onPress : null }, collapsed ? (React.createElement(ArrowUp, { stroke: colorGrayscaleS, style: style.icon, testID: "arrow-up" })) : (React.createElement(ArrowDown, { stroke: colorGrayscaleS, style: style.icon, testID: "arrow-down" })))),
34
+ collapsible && (React.createElement(Pressable, { style: style.iconContainer, testID: "pricing-collapsed", onPress: onPress }, collapsed ? (React.createElement(ArrowUp, { stroke: colorGrayscaleS, style: style.icon, testID: "arrow-up" })) : (React.createElement(ArrowDown, { stroke: colorGrayscaleS, style: style.icon, testID: "arrow-down" })))),
35
35
  collapsed && collapsible ? (React.createElement(animated.View, { style: [style.collapsed, { opacity: collapsedStyle.opacitiy }] },
36
36
  React.createElement(View, { style: style.collapsedContent },
37
37
  React.createElement(Text, { level: 1, style: style.totalCollapsed, detail: true },
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  interface SliderProps {
3
4
  readonly children: ReactNode[];
4
5
  readonly active?: number;
@@ -7,9 +8,13 @@ interface SliderProps {
7
8
  readonly minDistanceForAction?: number;
8
9
  readonly gesturesEnabled?: boolean;
9
10
  readonly paginationEnabled?: boolean;
11
+ readonly paginationStyle?: StyleProp<ViewStyle>;
12
+ readonly paginationItemStyle?: StyleProp<ViewStyle>;
13
+ readonly paginationActiveItemStyle?: StyleProp<ViewStyle>;
10
14
  readonly onSliderStart?: () => void;
11
15
  readonly onSliderEnd?: () => void;
12
16
  readonly onChanged?: (index: number) => void;
17
+ readonly paginationRenderItem?: (index: number) => ReactNode;
13
18
  }
14
19
  declare const Slider: FC<SliderProps>;
15
20
  export { Slider };
@@ -1,9 +1,9 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from "react";
2
- import { Animated, I18nManager, PanResponder, StyleSheet, View } from "react-native";
3
- import { Bullets } from "./Bullets";
2
+ import { Animated, I18nManager, PanResponder, StyleSheet, View, } from "react-native";
3
+ import { Pagination } from "./Pagination";
4
4
  import { style } from "./Slider.style";
5
5
  const DEFAULT_WIDTH = 200;
6
- const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true, paginationEnabled = true, onSliderStart, onSliderEnd, onChanged, }) => {
6
+ const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true, paginationEnabled = true, paginationStyle, paginationItemStyle, paginationActiveItemStyle, onSliderStart, onSliderEnd, onChanged, paginationRenderItem, }) => {
7
7
  const flatennedChildren = children.flat();
8
8
  const count = flatennedChildren.length;
9
9
  const [width, setWidth] = useState(0);
@@ -127,6 +127,6 @@ const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5,
127
127
  },
128
128
  style.sliderAreaStyle,
129
129
  ]), ...panResponder.panHandlers }, flatennedChildren.map((child, index) => (React.createElement(View, { key: index, style: { width }, testID: "slider-child" }, child)))),
130
- paginationEnabled && (React.createElement(Bullets, { activeIndex: getActiveIndex(), count: count, testID: "slider-bullets", onChange: (index) => goTo(index) }))));
130
+ paginationEnabled && (React.createElement(Pagination, { activeIndex: getActiveIndex(), count: count, paginationActiveItemStyle: paginationActiveItemStyle, paginationItemStyle: paginationItemStyle, paginationStyle: paginationStyle, renderItem: paginationRenderItem, onChange: (index) => goTo(index) }))));
131
131
  };
132
132
  export { Slider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "3.8.0-beta.3",
3
+ "version": "3.8.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -77,7 +77,6 @@
77
77
  "@pact-foundation/pact-node": "^10.17.6",
78
78
  "@react-native-firebase/analytics": "10.5.1",
79
79
  "@react-native-firebase/app": "10.5.0",
80
- "@testing-library/jest-native": "^5.4.2",
81
80
  "@testing-library/react-native": "^11.5.0",
82
81
  "@trivago/prettier-plugin-sort-imports": "^3.3.0",
83
82
  "@types/jest": "^29.2.4",
@@ -1,6 +0,0 @@
1
- import { ProcessManagerFunction } from "@lookiero/messaging";
2
- import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
3
- interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
4
- }
5
- declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
6
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,13 +0,0 @@
1
- import { v4 as uuid } from "uuid";
2
- import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
3
- import { createNotification } from "../../../shared/notifications/domain/notification/command/createNotification";
4
- import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
5
- const createNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
6
- await commandBus(createNotification({
7
- aggregateId: uuid(),
8
- level: NotificationLevel.ERROR,
9
- titleI18nKey: undefined,
10
- bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
11
- }));
12
- };
13
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,10 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface IncrementIntroShownCountFunction {
3
- (): Promise<void>;
4
- }
5
- type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
6
- interface UseIncrementIntroShownCountFunction {
7
- (): UseIncrementIntroShownCount;
8
- }
9
- declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
10
- export { useIncrementIntroShownCount };
@@ -1,11 +0,0 @@
1
- import { useCallback } from "react";
2
- import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
3
- import { UISettings } from "../../../ui/settings/UISettings";
4
- import { useUpdateUiSetting } from "./useUpdateUiSetting";
5
- const useIncrementIntroShownCount = () => {
6
- const [update, status] = useUpdateUiSetting();
7
- const [introShownCount] = useViewIntroShownCount();
8
- const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
9
- return [incrementIntroShownCount, status];
10
- };
11
- export { useIncrementIntroShownCount };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseShouldIntroBeShownFunction {
3
- (): [boolean, QueryStatus];
4
- }
5
- declare const useShouldIntroBeShown: UseShouldIntroBeShownFunction;
6
- export { useShouldIntroBeShown };
@@ -1,7 +0,0 @@
1
- import { useViewIntroShownCount } from "./useViewIntroShownCount";
2
- const MAX_INTRO_SHOWN_COUNT = 2;
3
- const useShouldIntroBeShown = () => {
4
- const [introShownCount, introShownCountStatus] = useViewIntroShownCount();
5
- return [introShownCount < MAX_INTRO_SHOWN_COUNT, introShownCountStatus];
6
- };
7
- export { useShouldIntroBeShown };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseViewIntroShownCountFunction {
3
- (): [number, QueryStatus];
4
- }
5
- declare const useViewIntroShownCount: UseViewIntroShownCountFunction;
6
- export { useViewIntroShownCount };
@@ -1,9 +0,0 @@
1
- import { UISettings } from "../../../ui/settings/UISettings";
2
- import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
3
- const useViewIntroShownCount = () => {
4
- const [introShownCount, introShownCountStatus] = useViewUiSettingByKey({
5
- key: UISettings.INTRO_SHOWN_COUNT,
6
- });
7
- return [introShownCount?.value || 0, introShownCountStatus];
8
- };
9
- export { useViewIntroShownCount };
@@ -1,13 +0,0 @@
1
- import { FC, ReactNode } from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- import { Edge } from "react-native-safe-area-context";
4
- type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
- interface SafeAreaScrollViewProps {
6
- readonly children: ReactNode;
7
- readonly footer?: ReactNode;
8
- readonly scrollerPaddingTop?: number;
9
- readonly edges?: Edge[];
10
- readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
11
- }
12
- declare const SafeAreaScrollView: FC<SafeAreaScrollViewProps>;
13
- export { SafeAreaScrollView };
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { ScrollView } from "react-native";
3
- import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { theme } from "../../theme/theme";
5
- import { style } from "./SafeAreaScrollView.style.ts";
6
- const { spaceXXL } = theme();
7
- const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
8
- const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
9
- return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
10
- React.createElement(ScrollView, { contentContainerStyle: [
11
- {
12
- paddingTop: scrollerPaddingTop,
13
- paddingBottom: safeAreaInsetBottom + spaceXXL,
14
- },
15
- customStyle?.scrollView,
16
- ] }, children),
17
- footer));
18
- };
19
- export { SafeAreaScrollView };
@@ -1,6 +0,0 @@
1
- declare const style: {
2
- safeAreaView: {
3
- flex: number;
4
- };
5
- };
6
- export { style };
@@ -1,7 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- safeAreaView: {
4
- flex: 1,
5
- },
6
- });
7
- export { style };
@@ -1,3 +0,0 @@
1
- import { FC } from "react";
2
- declare const Header: FC;
3
- export { Header };
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { ButtonIcon } from "../../../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
3
- import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
4
- import { Logo } from "../logo/Logo";
5
- import { style } from "./Header.style";
6
- const Header = () => (React.createElement(React.Fragment, null,
7
- React.createElement(Logo, { style: style.logo }),
8
- React.createElement(ButtonIconPlaceholder, null),
9
- React.createElement(ButtonIcon, { name: "menu", testID: "menu-button-icon", onPress: () => void 0 })));
10
- export { Header };
@@ -1,9 +0,0 @@
1
- declare const HEADER_HEIGHT: number;
2
- declare const style: {
3
- logo: {
4
- left: number;
5
- position: "absolute";
6
- top: number;
7
- };
8
- };
9
- export { style, HEADER_HEIGHT };
@@ -1,12 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../theme/theme";
3
- const { spaceXXXL } = theme();
4
- const HEADER_HEIGHT = spaceXXXL;
5
- const style = StyleSheet.create({
6
- logo: {
7
- left: 0,
8
- position: "absolute",
9
- top: 0,
10
- },
11
- });
12
- export { style, HEADER_HEIGHT };
@@ -1,13 +0,0 @@
1
- import { FC, ReactNode } from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- import { Edge } from "react-native-safe-area-context";
4
- type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
- interface SafeAreaScrollViewProps {
6
- readonly children: ReactNode;
7
- readonly footer?: ReactNode;
8
- readonly scrollerPaddingTop?: number;
9
- readonly edges?: Edge[];
10
- readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
11
- }
12
- declare const SafeAreaScrollView: FC<SafeAreaScrollViewProps>;
13
- export { SafeAreaScrollView };
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { ScrollView } from "react-native";
3
- import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { theme } from "../../../theme/theme.js";
5
- import { style } from "./SafeAreaScrollView.style.ts";
6
- const { spaceXXL } = theme();
7
- const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
8
- const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
9
- return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
10
- React.createElement(ScrollView, { contentContainerStyle: [
11
- {
12
- paddingTop: scrollerPaddingTop,
13
- paddingBottom: safeAreaInsetBottom + spaceXXL,
14
- },
15
- customStyle?.scrollView,
16
- ] }, children),
17
- footer));
18
- };
19
- export { SafeAreaScrollView };
@@ -1,6 +0,0 @@
1
- declare const style: {
2
- safeAreaView: {
3
- flex: number;
4
- };
5
- };
6
- export { style };
@@ -1,7 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- safeAreaView: {
4
- flex: 1,
5
- },
6
- });
7
- export { style };
@@ -1,2 +0,0 @@
1
- declare const usePaymentInstrumentUpdateEvents: () => void;
2
- export { usePaymentInstrumentUpdateEvents };
@@ -1,28 +0,0 @@
1
- import { useEvent } from "@lookiero/event";
2
- import { useCallback, useEffect } from "react";
3
- import { useCreateNotification } from "../../../shared/notifications";
4
- import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
5
- import { I18nMessages } from "../i18n/i18n";
6
- import { useToast } from "./useToast";
7
- const PAYMENT_ERROR = "ERROR";
8
- const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
9
- const usePaymentInstrumentUpdateEvents = () => {
10
- const { subscribe, unsubscribe } = useEvent();
11
- const { showError, showSuccess } = useToast();
12
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID });
13
- const onSuccess = useCallback(({ message }) => showSuccess({ message: message.id }), [showSuccess]);
14
- const onError = useCallback(({ error }) => {
15
- if (error.toaster) {
16
- showError({ message: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR });
17
- }
18
- }, [showError]);
19
- useEffect(() => {
20
- subscribe({ event: PAYMENT_ERROR }, onError);
21
- subscribe({ event: PAYMENT_SUCCESS }, onSuccess);
22
- return () => {
23
- unsubscribe({ event: PAYMENT_ERROR }, onError);
24
- unsubscribe({ event: PAYMENT_SUCCESS }, onSuccess);
25
- };
26
- }, [subscribe, unsubscribe, createNotification, onError, onSuccess]);
27
- };
28
- export { usePaymentInstrumentUpdateEvents };
@@ -1,11 +0,0 @@
1
- interface ShowErrorFunctionArgs {
2
- readonly message: string;
3
- }
4
- interface ShowErrorFunction {
5
- (args: ShowErrorFunctionArgs): void;
6
- }
7
- declare const useToast: () => {
8
- showError: ShowErrorFunction;
9
- showSuccess: ShowErrorFunction;
10
- };
11
- export { useToast };
@@ -1,49 +0,0 @@
1
- import { Notification, useStack } from "@lookiero/aurora";
2
- import { useIntl } from "@lookiero/i18n-react";
3
- import { useCallback } from "react";
4
- import { StyleSheet } from "react-native";
5
- import { v4 as uuid } from "uuid";
6
- import { theme } from "../theme/theme";
7
- const { layoutXXS, elevationColor, elevationOffset, elevationOpacityM, elevationRadius } = theme();
8
- const style = StyleSheet.create({
9
- container: {
10
- marginHorizontal: layoutXXS,
11
- marginTop: layoutXXS,
12
- shadowColor: elevationColor,
13
- shadowOffset: elevationOffset,
14
- shadowOpacity: elevationOpacityM,
15
- shadowRadius: elevationRadius,
16
- },
17
- inAppContainer: {
18
- top: 75,
19
- },
20
- });
21
- const NOTIFICATION_DEFAULTS = {
22
- motion: "top",
23
- timeoutClose: 10000,
24
- style: style.container,
25
- };
26
- const IN_APP_NOTIFICATION_DEFAULTS = {
27
- ...NOTIFICATION_DEFAULTS,
28
- style: [style.container, style.inAppContainer],
29
- };
30
- const iOSInAppBrowser = window.screen?.height > 667 && /FBIOS/.test(navigator.userAgent);
31
- const getNotificationDefaults = () => (iOSInAppBrowser ? IN_APP_NOTIFICATION_DEFAULTS : NOTIFICATION_DEFAULTS);
32
- const useToast = () => {
33
- const Stack = useStack();
34
- const intl = useIntl();
35
- const translate = useCallback((message) => intl.formatMessage({ id: message, defaultMessage: message }), [intl]);
36
- const showError = useCallback(({ message }) => Stack.alert(uuid(),
37
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
- // @ts-ignore
39
- Notification, { ...getNotificationDefaults(), text: translate(message) }), [Stack, translate]);
40
- const showSuccess = useCallback(({ message }) => Stack.success(uuid(),
41
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
42
- // @ts-ignore
43
- Notification, { ...getNotificationDefaults(), text: translate(message) }), [Stack, translate]);
44
- return {
45
- showError,
46
- showSuccess,
47
- };
48
- };
49
- export { useToast };
@@ -1,7 +0,0 @@
1
- import { FC } from "react";
2
- interface CheckoutSuccessModalProps {
3
- readonly visible: boolean;
4
- readonly onDismiss: () => void;
5
- }
6
- declare const CheckoutSuccessModal: FC<CheckoutSuccessModalProps>;
7
- export { CheckoutSuccessModal };
@@ -1,25 +0,0 @@
1
- import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
3
- import { useI18nMessage } from "@lookiero/i18n-react";
4
- import React from "react";
5
- import { View } from "react-native";
6
- import { Modal } from "../../../../../../shared/ui/components/layouts/modal/Modal";
7
- import { I18nMessages } from "../../../../i18n/i18n";
8
- import { style } from "./CheckoutSuccessModal.style";
9
- const CheckoutSuccessModal = ({ visible, onDismiss }) => {
10
- const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_TITLE });
11
- const descriptionText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_DESCRIPTION });
12
- const buttonText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_BUTTON });
13
- return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
14
- React.createElement(View, { style: style.modal },
15
- React.createElement(Text, { level: 1, style: style.modalTitle, body: true }, titleText),
16
- React.createElement(Text, { level: 3, style: style.modalDescription, body: true }, descriptionText),
17
- React.createElement(Button
18
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
- // @ts-ignore
20
- , {
21
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22
- // @ts-ignore
23
- style: style.button, onPress: onDismiss }, buttonText))));
24
- };
25
- export { CheckoutSuccessModal };
@@ -1,16 +0,0 @@
1
- declare const style: {
2
- button: {
3
- flex: number;
4
- };
5
- modal: {
6
- padding: number;
7
- };
8
- modalDescription: {
9
- marginVertical: number;
10
- textAlign: "center";
11
- };
12
- modalTitle: {
13
- textAlign: "center";
14
- };
15
- };
16
- export { style };
@@ -1,19 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../theme/theme";
3
- const { spaceXL } = theme();
4
- const style = StyleSheet.create({
5
- button: {
6
- flex: 0,
7
- },
8
- modal: {
9
- padding: spaceXL,
10
- },
11
- modalDescription: {
12
- marginVertical: spaceXL,
13
- textAlign: "center",
14
- },
15
- modalTitle: {
16
- textAlign: "center",
17
- },
18
- });
19
- export { style };
@@ -1,6 +0,0 @@
1
- import { FC } from "react";
2
- type IntroProps = {
3
- readonly customerId: string;
4
- };
5
- declare const Intro: FC<IntroProps>;
6
- export { Intro };
@@ -1,52 +0,0 @@
1
- import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
- import { Icon } from "@lookiero/aurora-next/build/components/primitives/Icon/Icon";
3
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
4
- import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
6
- import React from "react";
7
- import { Platform, View } from "react-native";
8
- import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
9
- import { useIncrementIntroShownCount } from "../../../domain/uiSetting/react/useIncrementIntroShownCount";
10
- import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
11
- import { Body } from "../../components/layouts/body/Body";
12
- import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
13
- import { I18nMessages } from "../../i18n/i18n";
14
- import { HEADER_HEIGHT } from "../navigation/components/header/Header.style";
15
- import { style } from "./Intro.style";
16
- const Bullet = ({ text }) => (React.createElement(View, { style: style.bullet },
17
- React.createElement(Icon, { name: "rounded-tick", style: style.tickIcon }),
18
- React.createElement(Text, { level: 2, detail: true }, text)));
19
- const Intro = ({ customerId }) => {
20
- const titleText = useI18nMessage({ id: I18nMessages.INTRO_TITLE });
21
- const subTitleText = useI18nMessage({ id: I18nMessages.INTRO_SUBTITLE });
22
- const discountText = useI18nMessage({ id: I18nMessages.INTRO_DISCOUNT });
23
- const bulletOneText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_ONE });
24
- const bulletTwoText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_TWO });
25
- const bulletThreeText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_THREE });
26
- const buttonText = useI18nMessage({ id: I18nMessages.INTRO_BUTTON });
27
- const [fiveItemsDiscount, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({
28
- customerId,
29
- });
30
- const [incrementIntroShownCount, incrementIntroShownCountStatus] = useIncrementIntroShownCount();
31
- if (fiveItemsDiscountStatus === QueryStatus.LOADING)
32
- return React.createElement(Spinner, null);
33
- return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
34
- React.createElement(Body, { style: { column: style.bodyColumn } },
35
- React.createElement(View, { style: style.intro },
36
- React.createElement(View, { style: style.content },
37
- React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
38
- React.createElement(Text, { level: 3, style: style.subtitle, body: true }, subTitleText),
39
- fiveItemsDiscount !== 0 && (React.createElement(View, { style: style.discountContainer },
40
- React.createElement(View, { style: style.discount },
41
- React.createElement(Text, { level: 2, heading: true },
42
- "- ",
43
- fiveItemsDiscount),
44
- React.createElement(Text, { level: 3, style: style.percentage, heading: true }, "%")),
45
- React.createElement(Text, { level: 3, body: true }, discountText))),
46
- React.createElement(View, { style: style.description },
47
- React.createElement(Bullet, { text: bulletOneText }),
48
- React.createElement(Bullet, { text: bulletTwoText }),
49
- React.createElement(Bullet, { text: bulletThreeText }))),
50
- React.createElement(Button, { disabled: incrementIntroShownCountStatus === CommandStatus.LOADING, onPress: incrementIntroShownCount }, buttonText)))));
51
- };
52
- export { Intro };
@@ -1,52 +0,0 @@
1
- declare const style: {
2
- bodyColumn: {
3
- paddingHorizontal: number;
4
- };
5
- bullet: {
6
- alignItems: "center";
7
- flexDirection: "row";
8
- marginVertical: number;
9
- };
10
- content: {
11
- alignItems: "center";
12
- };
13
- description: {
14
- borderWidth: number;
15
- marginBottom: number;
16
- padding: number;
17
- width: string;
18
- };
19
- discount: {
20
- alignItems: "flex-end";
21
- flexDirection: "row";
22
- justifyContent: "center";
23
- marginBottom: number;
24
- };
25
- discountContainer: {
26
- alignItems: "center";
27
- backgroundColor: string;
28
- marginBottom: number;
29
- padding: number;
30
- textAlign: "center";
31
- width: string;
32
- };
33
- intro: {
34
- flex: number;
35
- justifyContent: "space-between";
36
- };
37
- percentage: {
38
- marginLeft: number;
39
- };
40
- subtitle: {
41
- marginBottom: number;
42
- textAlign: "center";
43
- };
44
- tickIcon: {
45
- marginRight: number;
46
- };
47
- title: {
48
- marginBottom: number;
49
- textAlign: "center";
50
- };
51
- };
52
- export { style };