tf-checkout-react-native 1.0.16 → 1.0.19

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 (156) hide show
  1. package/README.md +796 -13
  2. package/lib/api/ApiClient.d.ts +14 -36
  3. package/lib/api/ApiClient.js +85 -30
  4. package/lib/api/ApiClient.js.map +1 -1
  5. package/lib/api/Constants.d.ts +2 -0
  6. package/lib/api/Constants.js +2 -0
  7. package/lib/api/Constants.js.map +1 -1
  8. package/lib/api/types.d.ts +100 -21
  9. package/lib/components/dropdown/styles.js +1 -1
  10. package/lib/components/dropdownMaterial/DropdownMaterial.d.ts +3 -0
  11. package/lib/components/dropdownMaterial/DropdownMaterial.js +53 -0
  12. package/lib/components/dropdownMaterial/DropdownMaterial.js.map +1 -0
  13. package/lib/components/dropdownMaterial/styles.d.ts +79 -0
  14. package/lib/components/dropdownMaterial/styles.js +88 -0
  15. package/lib/components/dropdownMaterial/styles.js.map +1 -0
  16. package/lib/components/dropdownMaterial/types.d.ts +21 -0
  17. package/lib/components/dropdownMaterial/types.js +2 -0
  18. package/lib/components/dropdownMaterial/types.js.map +1 -0
  19. package/lib/components/index.d.ts +3 -0
  20. package/lib/components/index.js +3 -0
  21. package/lib/components/index.js.map +1 -1
  22. package/lib/components/input/Input.js +1 -1
  23. package/lib/components/input/Input.js.map +1 -1
  24. package/lib/components/input/types.d.ts +4 -3
  25. package/lib/components/loggedIn/LoggedIn.js +3 -3
  26. package/lib/components/loggedIn/LoggedIn.js.map +1 -1
  27. package/lib/components/login/Login.d.ts +2 -1
  28. package/lib/components/login/Login.js +25 -63
  29. package/lib/components/login/Login.js.map +1 -1
  30. package/lib/components/login/LoginView.d.ts +2 -1
  31. package/lib/components/login/LoginView.js +18 -7
  32. package/lib/components/login/LoginView.js.map +1 -1
  33. package/lib/components/login/types.d.ts +9 -9
  34. package/lib/components/phoneInput/PhoneInput.d.ts +4 -0
  35. package/lib/components/phoneInput/PhoneInput.js +33 -0
  36. package/lib/components/phoneInput/PhoneInput.js.map +1 -0
  37. package/lib/components/phoneInput/styles.d.ts +28 -0
  38. package/lib/components/phoneInput/styles.js +30 -0
  39. package/lib/components/phoneInput/styles.js.map +1 -0
  40. package/lib/components/phoneInput/types.d.ts +30 -0
  41. package/lib/components/phoneInput/types.js +2 -0
  42. package/lib/components/phoneInput/types.js.map +1 -0
  43. package/lib/components/promoCode/PromoCode.d.ts +2 -1
  44. package/lib/components/promoCode/PromoCode.js +30 -44
  45. package/lib/components/promoCode/PromoCode.js.map +1 -1
  46. package/lib/components/promoCode/styles.d.ts +20 -16
  47. package/lib/components/promoCode/styles.js +21 -17
  48. package/lib/components/promoCode/styles.js.map +1 -1
  49. package/lib/components/promoCode/types.d.ts +9 -7
  50. package/lib/components/stripePayment/StripePayment.d.ts +4 -0
  51. package/lib/components/stripePayment/StripePayment.js +23 -0
  52. package/lib/components/stripePayment/StripePayment.js.map +1 -0
  53. package/lib/components/stripePayment/types.d.ts +12 -0
  54. package/lib/components/stripePayment/types.js +2 -0
  55. package/lib/components/stripePayment/types.js.map +1 -0
  56. package/lib/components/waitingList/WaitingList.d.ts +2 -1
  57. package/lib/components/waitingList/WaitingList.js +32 -29
  58. package/lib/components/waitingList/WaitingList.js.map +1 -1
  59. package/lib/components/waitingList/WaitingListView.d.ts +2 -1
  60. package/lib/components/waitingList/WaitingListView.js.map +1 -1
  61. package/lib/components/waitingList/types.d.ts +0 -1
  62. package/lib/containers/billingInfo/Billing.js +300 -196
  63. package/lib/containers/billingInfo/Billing.js.map +1 -1
  64. package/lib/containers/billingInfo/types.d.ts +12 -6
  65. package/lib/containers/checkout/Checkout.d.ts +2 -1
  66. package/lib/containers/checkout/Checkout.js +58 -65
  67. package/lib/containers/checkout/Checkout.js.map +1 -1
  68. package/lib/containers/checkout/types.d.ts +1 -1
  69. package/lib/containers/myOrderDetails/MyOrderDetailsView.js +4 -3
  70. package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
  71. package/lib/containers/myOrderDetails/types.d.ts +10 -2
  72. package/lib/containers/myOrders/MyOrders.js +26 -4
  73. package/lib/containers/myOrders/MyOrders.js.map +1 -1
  74. package/lib/containers/myOrders/MyOrdersView.d.ts +2 -1
  75. package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
  76. package/lib/containers/myOrders/types.d.ts +2 -2
  77. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +2 -1
  78. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +23 -8
  79. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
  80. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +2 -1
  81. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
  82. package/lib/containers/tickets/Tickets.d.ts +2 -1
  83. package/lib/containers/tickets/Tickets.js +81 -86
  84. package/lib/containers/tickets/Tickets.js.map +1 -1
  85. package/lib/containers/tickets/TicketsView.d.ts +1 -1
  86. package/lib/containers/tickets/TicketsView.js +4 -5
  87. package/lib/containers/tickets/TicketsView.js.map +1 -1
  88. package/lib/containers/tickets/types.d.ts +6 -15
  89. package/lib/core/BillingCore/BillingCore.d.ts +5 -0
  90. package/lib/core/BillingCore/BillingCore.js +28 -0
  91. package/lib/core/BillingCore/BillingCore.js.map +1 -0
  92. package/lib/core/BillingCore/BillingCoreTypes.d.ts +16 -0
  93. package/lib/core/BillingCore/BillingCoreTypes.js +2 -0
  94. package/lib/core/BillingCore/BillingCoreTypes.js.map +1 -0
  95. package/lib/core/CheckoutCore/CheckoutCore.d.ts +5 -0
  96. package/lib/core/CheckoutCore/CheckoutCore.js +25 -0
  97. package/lib/core/CheckoutCore/CheckoutCore.js.map +1 -0
  98. package/lib/core/CheckoutCore/CheckoutCoreTypes.d.ts +8 -0
  99. package/lib/core/CheckoutCore/CheckoutCoreTypes.js +2 -0
  100. package/lib/core/CheckoutCore/CheckoutCoreTypes.js.map +1 -0
  101. package/lib/core/CoreProps.d.ts +4 -0
  102. package/lib/core/CoreProps.js +2 -0
  103. package/lib/core/CoreProps.js.map +1 -0
  104. package/lib/core/LoginCore/LoginCore.d.ts +5 -0
  105. package/lib/core/LoginCore/LoginCore.js +100 -0
  106. package/lib/core/LoginCore/LoginCore.js.map +1 -0
  107. package/lib/core/LoginCore/LoginCoreTypes.d.ts +10 -0
  108. package/lib/core/LoginCore/LoginCoreTypes.js +2 -0
  109. package/lib/core/LoginCore/LoginCoreTypes.js.map +1 -0
  110. package/lib/core/MyOrdersCore/MyOrdersCore.d.ts +3 -0
  111. package/lib/core/MyOrdersCore/MyOrdersCore.js +16 -0
  112. package/lib/core/MyOrdersCore/MyOrdersCore.js.map +1 -0
  113. package/lib/core/MyOrdersCore/MyOrdersCoreTypes.d.ts +5 -0
  114. package/lib/core/MyOrdersCore/MyOrdersCoreTypes.js +2 -0
  115. package/lib/core/MyOrdersCore/MyOrdersCoreTypes.js.map +1 -0
  116. package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.d.ts +5 -0
  117. package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.js +12 -0
  118. package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.js.map +1 -0
  119. package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.d.ts +4 -0
  120. package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.js +2 -0
  121. package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.js.map +1 -0
  122. package/lib/core/TicketsCore/TicketsCore.d.ts +5 -0
  123. package/lib/core/TicketsCore/TicketsCore.js +59 -0
  124. package/lib/core/TicketsCore/TicketsCore.js.map +1 -0
  125. package/lib/core/TicketsCore/TicketsCoreTypes.d.ts +15 -0
  126. package/lib/core/TicketsCore/TicketsCoreTypes.js +2 -0
  127. package/lib/core/TicketsCore/TicketsCoreTypes.js.map +1 -0
  128. package/lib/core/WaitingListCore/WaitingListCore.d.ts +5 -0
  129. package/lib/core/WaitingListCore/WaitingListCore.js +17 -0
  130. package/lib/core/WaitingListCore/WaitingListCore.js.map +1 -0
  131. package/lib/core/WaitingListCore/WaitingListCoreTypes.d.ts +9 -0
  132. package/lib/core/WaitingListCore/WaitingListCoreTypes.js +2 -0
  133. package/lib/core/WaitingListCore/WaitingListCoreTypes.js.map +1 -0
  134. package/lib/core/index.d.ts +14 -0
  135. package/lib/core/index.js +8 -0
  136. package/lib/core/index.js.map +1 -0
  137. package/lib/helpers/Config.d.ts +2 -1
  138. package/lib/helpers/Config.js +14 -5
  139. package/lib/helpers/Config.js.map +1 -1
  140. package/lib/helpers/CountryCodes.d.ts +15 -0
  141. package/lib/helpers/CountryCodes.js +3382 -0
  142. package/lib/helpers/CountryCodes.js.map +1 -0
  143. package/lib/helpers/LocalStorage.d.ts +1 -0
  144. package/lib/helpers/LocalStorage.js +4 -1
  145. package/lib/helpers/LocalStorage.js.map +1 -1
  146. package/lib/helpers/Validators.d.ts +6 -0
  147. package/lib/helpers/Validators.js +10 -0
  148. package/lib/helpers/Validators.js.map +1 -1
  149. package/lib/index.d.ts +4 -2
  150. package/lib/index.js +3 -1
  151. package/lib/index.js.map +1 -1
  152. package/lib/types/IEvent.d.ts +6 -0
  153. package/lib/types/ITicket.d.ts +10 -1
  154. package/lib/types/IUserProfile.d.ts +15 -11
  155. package/package.json +14 -7
  156. package/src/index.tsx +78 -0
@@ -0,0 +1,53 @@
1
+ //@ts-nocheck
2
+ import React, { useCallback, useEffect, useRef, useState, } from 'react';
3
+ import { FlatList, Image, Modal, TouchableOpacity, TouchableWithoutFeedback, View, } from 'react-native';
4
+ import R from '../../res';
5
+ import DropdownListItem from '../dropdown/DropdownListItem';
6
+ import Input from '../input/Input';
7
+ import Separator from '../separator/Separator';
8
+ import { DropdownMaterialStyles as s } from './styles';
9
+ const DropdownMaterial = ({ items, selectedOption, onSelectItem, styles, materialInputProps, }) => {
10
+ const [isModalVisible, setIsModalVisible] = useState(false);
11
+ const flatListRef = useRef();
12
+ const showModal = () => {
13
+ requestAnimationFrame(() => {
14
+ setIsModalVisible(true);
15
+ });
16
+ };
17
+ const hideModal = () => {
18
+ requestAnimationFrame(() => {
19
+ setIsModalVisible(false);
20
+ });
21
+ };
22
+ const handleOnSelectItem = (item) => {
23
+ onSelectItem(item);
24
+ hideModal();
25
+ };
26
+ useEffect(() => {
27
+ if (flatListRef === null || flatListRef === void 0 ? void 0 : flatListRef.current) {
28
+ flatListRef.current.flashScrollIndicators();
29
+ }
30
+ }, [isModalVisible]);
31
+ const renderItem = useCallback(({ item }) => (React.createElement(DropdownListItem, { item: item, onSelectItem: handleOnSelectItem, selectedOption: selectedOption, styles: styles === null || styles === void 0 ? void 0 : styles.listItem })),
32
+ // eslint-disable-next-line react-hooks/exhaustive-deps
33
+ [handleOnSelectItem, selectedOption]);
34
+ const keyExtractor = useCallback((item) => item.value.toString(), []);
35
+ const renderSeparator = useCallback(() => React.createElement(Separator, null), []);
36
+ const getItemLayout = useCallback((data, index) => ({
37
+ length: 45,
38
+ offset: 45 * index,
39
+ index,
40
+ }), []);
41
+ const RightComponent = useCallback(() => React.createElement(Image, { source: R.icons.dropdown, style: [s.icon, styles === null || styles === void 0 ? void 0 : styles.icon] }), [styles === null || styles === void 0 ? void 0 : styles.icon]);
42
+ return (React.createElement(View, { style: [s.rootContainer, styles === null || styles === void 0 ? void 0 : styles.container] },
43
+ React.createElement(TouchableOpacity, { onPress: showModal, style: s.button },
44
+ React.createElement(Input, { ...materialInputProps, value: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label, styles: styles === null || styles === void 0 ? void 0 : styles.input, disabled: true, pointerEvents: 'box-none', disabledLineWidth: 1, renderRightAccessory: RightComponent })),
45
+ isModalVisible && items.length > 0 && (React.createElement(Modal, { presentationStyle: 'overFullScreen', transparent: true },
46
+ React.createElement(View, { style: s.modalContainer },
47
+ React.createElement(TouchableOpacity, { activeOpacity: 1, onPress: hideModal, style: s.modalBackgroundTouchable },
48
+ React.createElement(TouchableWithoutFeedback, null,
49
+ React.createElement(View, { style: [s.dialog, styles === null || styles === void 0 ? void 0 : styles.dialog] },
50
+ React.createElement(FlatList, { keyExtractor: keyExtractor, ref: flatListRef, indicatorStyle: 'black', data: items, extraData: items, maxToRenderPerBatch: 6, initialNumToRender: 6, renderItem: renderItem, ItemSeparatorComponent: renderSeparator, getItemLayout: getItemLayout, style: [s.flatListContainer, styles === null || styles === void 0 ? void 0 : styles.flatListContainer] })))))))));
51
+ };
52
+ export default DropdownMaterial;
53
+ //# sourceMappingURL=DropdownMaterial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMaterial.js","sourceRoot":"","sources":["../../../src/components/dropdownMaterial/DropdownMaterial.tsx"],"names":[],"mappings":"AAAA,aAAa;AAEb,OAAO,KAAK,EAAE,EAEZ,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,wBAAwB,EACxB,IAAI,GACL,MAAM,cAAc,CAAA;AAErB,OAAO,CAAC,MAAM,WAAW,CAAA;AACzB,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,sBAAsB,IAAI,CAAC,EAAE,MAAM,UAAU,CAAA;AAGtD,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,EACL,cAAc,EACd,YAAY,EACZ,MAAM,EACN,kBAAkB,GACK,EAAE,EAAE;IAC3B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3D,MAAM,WAAW,GAA+B,MAAM,EAAE,CAAA;IAExD,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,qBAAqB,CAAC,GAAG,EAAE;YACzB,iBAAiB,CAAC,IAAI,CAAC,CAAA;QACz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,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,WAAW,EAChB,cAAc,EAAC,OAAO,EACtB,IAAI,EAAE,KAAK,EACX,SAAS,EAAE,KAAK,EAChB,mBAAmB,EAAE,CAAC,EACtB,kBAAkB,EAAE,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,eAAe,EACvC,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,CAAC,GACvD,CACG,CACkB,CACV,CACd,CACD,CACT,CACI,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,79 @@
1
+ export declare const DropdownMaterialStyles: {
2
+ rootContainer: {
3
+ width: string;
4
+ height: number;
5
+ marginBottom: number;
6
+ };
7
+ button: {
8
+ height: string;
9
+ };
10
+ icon: {
11
+ height: number;
12
+ width: number;
13
+ resizeMode: "contain";
14
+ tintColor: string;
15
+ };
16
+ label: {
17
+ color: string;
18
+ fontSize: number;
19
+ };
20
+ modalContainer: {
21
+ flex: number;
22
+ backgroundColor: string;
23
+ };
24
+ modalBackgroundTouchable: {
25
+ width: string;
26
+ height: string;
27
+ justifyContent: "center";
28
+ alignItems: "center";
29
+ };
30
+ dialog: {
31
+ backgroundColor: string;
32
+ paddingVertical: number;
33
+ borderRadius: number;
34
+ alignItems: "center";
35
+ justifyContent: "center";
36
+ width: number;
37
+ maxHeight: number;
38
+ minHeight: number;
39
+ shadowColor: string;
40
+ shadowOffset: {
41
+ width: number;
42
+ height: number;
43
+ };
44
+ shadowOpacity: number;
45
+ shadowRadius: number;
46
+ };
47
+ flatListContainer: {
48
+ width: number;
49
+ };
50
+ };
51
+ export declare const DropdownListItemStyles: {
52
+ rootContainer: {
53
+ paddingVertical: number;
54
+ minWidth: number;
55
+ alignItems: "center";
56
+ };
57
+ button: {
58
+ width: string;
59
+ minHeight: number;
60
+ justifyContent: "center";
61
+ alignItems: "center";
62
+ backgroundColor: string;
63
+ paddingHorizontal: number;
64
+ };
65
+ buttonSelected: {
66
+ width: string;
67
+ minHeight: number;
68
+ justifyContent: "center";
69
+ alignItems: "center";
70
+ backgroundColor: string;
71
+ paddingHorizontal: number;
72
+ };
73
+ text: {
74
+ fontSize: number;
75
+ fontWeight: "600";
76
+ textAlign: "center";
77
+ color: string;
78
+ };
79
+ };
@@ -0,0 +1,88 @@
1
+ import { Dimensions, StyleSheet } from 'react-native';
2
+ import R from '../../res';
3
+ const { width: sWidth, height: sHeight } = Dimensions.get('window');
4
+ const DIALOG = {
5
+ width: sWidth * 0.8,
6
+ maxHeight: sHeight * 0.5,
7
+ minHeight: sHeight * 0.2,
8
+ };
9
+ export const DropdownMaterialStyles = StyleSheet.create({
10
+ rootContainer: {
11
+ width: '100%',
12
+ height: 45,
13
+ marginBottom: 32,
14
+ },
15
+ button: {
16
+ height: '120%',
17
+ },
18
+ icon: {
19
+ height: 14,
20
+ width: 14,
21
+ resizeMode: 'contain',
22
+ tintColor: R.colors.white,
23
+ },
24
+ label: {
25
+ color: R.colors.black,
26
+ fontSize: 16,
27
+ },
28
+ modalContainer: {
29
+ flex: 1,
30
+ backgroundColor: 'rgba(0,0,0,0.8)',
31
+ },
32
+ modalBackgroundTouchable: {
33
+ width: '100%',
34
+ height: '100%',
35
+ justifyContent: 'center',
36
+ alignItems: 'center',
37
+ },
38
+ dialog: {
39
+ backgroundColor: R.colors.white,
40
+ paddingVertical: 16,
41
+ borderRadius: 2,
42
+ alignItems: 'center',
43
+ justifyContent: 'center',
44
+ width: DIALOG.width,
45
+ maxHeight: DIALOG.maxHeight,
46
+ minHeight: DIALOG.minHeight,
47
+ shadowColor: R.colors.black,
48
+ shadowOffset: {
49
+ width: 3,
50
+ height: 2,
51
+ },
52
+ shadowOpacity: 0.3,
53
+ shadowRadius: 3,
54
+ },
55
+ flatListContainer: {
56
+ width: DIALOG.width,
57
+ },
58
+ });
59
+ export const DropdownListItemStyles = StyleSheet.create({
60
+ rootContainer: {
61
+ paddingVertical: 4,
62
+ minWidth: 100,
63
+ alignItems: 'center',
64
+ },
65
+ button: {
66
+ width: '100%',
67
+ minHeight: 35,
68
+ justifyContent: 'center',
69
+ alignItems: 'center',
70
+ backgroundColor: R.colors.white,
71
+ paddingHorizontal: 8,
72
+ },
73
+ buttonSelected: {
74
+ width: '100%',
75
+ minHeight: 35,
76
+ justifyContent: 'center',
77
+ alignItems: 'center',
78
+ backgroundColor: R.colors.tint,
79
+ paddingHorizontal: 8,
80
+ },
81
+ text: {
82
+ fontSize: 18,
83
+ fontWeight: '600',
84
+ textAlign: 'center',
85
+ color: R.colors.black,
86
+ },
87
+ });
88
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/dropdownMaterial/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEnE,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,MAAM,GAAG,GAAG;IACnB,SAAS,EAAE,OAAO,GAAG,GAAG;IACxB,SAAS,EAAE,OAAO,GAAG,GAAG;CACzB,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC,MAAM,CAAC;IACtD,aAAa,EAAE;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,MAAM;KACf;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,CA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AAM;QACb,SAAS,EAAE,EAAE;QACb,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;QAC9B,iBAAiB,EAAE,CAAC;KACrB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK;KACtB;CACF,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native';
2
+ import { IDropdownItem, IDropdownListItemStyles } from '../dropdown/types';
3
+ import { IInputProps, IInputStyles } from '../input/types';
4
+ export interface IDropdownMaterialStyles {
5
+ container?: StyleProp<ViewStyle>;
6
+ button?: StyleProp<ViewStyle>;
7
+ icon?: StyleProp<ImageStyle>;
8
+ label?: StyleProp<TextStyle>;
9
+ dialog?: StyleProp<ViewStyle>;
10
+ flatListContainer?: StyleProp<ViewStyle>;
11
+ listItem?: IDropdownListItemStyles;
12
+ input?: IInputStyles;
13
+ }
14
+ export interface IDropdownMaterialProps {
15
+ items: IDropdownItem[];
16
+ selectedOption?: IDropdownItem;
17
+ onSelectItem: (item: IDropdownItem) => void;
18
+ styles?: IDropdownMaterialStyles;
19
+ isMaterial?: boolean;
20
+ materialInputProps?: IInputProps;
21
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/dropdownMaterial/types.ts"],"names":[],"mappings":""}
@@ -2,11 +2,14 @@ export { default as Button } from './button/Button';
2
2
  export { default as Checkbox } from './checkbox/Checkbox';
3
3
  export { default as DatePicker } from './datePicker/DatePicker';
4
4
  export { default as Dropdown } from './dropdown/Dropdown';
5
+ export { default as DropdownMaterial } from './dropdownMaterial/DropdownMaterial';
5
6
  export { default as FormField } from './formField/FormField';
6
7
  export { default as Input } from './input/Input';
7
8
  export { default as Loading } from './loading/Loading';
8
9
  export { default as LoggedIn } from './loggedIn/LoggedIn';
9
10
  export { default as Login } from './login/Login';
11
+ export { default as PhoneInput } from './phoneInput/PhoneInput';
10
12
  export { default as PromoCode } from './promoCode/PromoCode';
11
13
  export { default as Separator } from './separator/Separator';
14
+ export { default as StripePayment } from './stripePayment/StripePayment';
12
15
  export { default as WaitingList } from './waitingList/WaitingList';
@@ -2,12 +2,15 @@ export { default as Button } from './button/Button';
2
2
  export { default as Checkbox } from './checkbox/Checkbox';
3
3
  export { default as DatePicker } from './datePicker/DatePicker';
4
4
  export { default as Dropdown } from './dropdown/Dropdown';
5
+ export { default as DropdownMaterial } from './dropdownMaterial/DropdownMaterial';
5
6
  export { default as FormField } from './formField/FormField';
6
7
  export { default as Input } from './input/Input';
7
8
  export { default as Loading } from './loading/Loading';
8
9
  export { default as LoggedIn } from './loggedIn/LoggedIn';
9
10
  export { default as Login } from './login/Login';
11
+ export { default as PhoneInput } from './phoneInput/PhoneInput';
10
12
  export { default as PromoCode } from './promoCode/PromoCode';
11
13
  export { default as Separator } from './separator/Separator';
14
+ export { default as StripePayment } from './stripePayment/StripePayment';
12
15
  export { default as WaitingList } from './waitingList/WaitingList';
13
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,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,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAA"}
@@ -10,7 +10,7 @@ const Input = (props) => {
10
10
  ? styles.baseColor
11
11
  : (styles === null || styles === void 0 ? void 0 : styles.color) || R.colors.black;
12
12
  return (React.createElement(View, { style: [s.container, styles === null || styles === void 0 ? void 0 : styles.container] },
13
- React.createElement(TextField, { inputRef: reference, value: value, onChangeText: (text) => id && onTextChanged ? onTextChanged(id, text) : onChangeText, ...props, label: label, tintColor: mainColor, containerStyle: s.fieldWrapper, baseColor: mainColor, activeLineWidth: (styles === null || styles === void 0 ? void 0 : styles.activeLineWidth) || 2, lineWidth: (styles === null || styles === void 0 ? void 0 : styles.lineWidth) || 1, textContentType: props.isSecure ? 'oneTimeCode' : 'none', autoCorrect: false, style: styles === null || styles === void 0 ? void 0 : styles.input, errorColor: styles === null || styles === void 0 ? void 0 : styles.errorColor })));
13
+ React.createElement(TextField, { inputRef: reference, value: value, onChangeText: (text) => id && onTextChanged ? onTextChanged(id, text) : onChangeText, ...props, label: label, tintColor: mainColor, containerStyle: [s.fieldWrapper, styles === null || styles === void 0 ? void 0 : styles.fieldWrapper], baseColor: mainColor, activeLineWidth: (styles === null || styles === void 0 ? void 0 : styles.activeLineWidth) || 2, lineWidth: (styles === null || styles === void 0 ? void 0 : styles.lineWidth) || 1, textContentType: props.isSecure ? 'oneTimeCode' : 'none', autoCorrect: false, style: styles === null || styles === void 0 ? void 0 : styles.input, errorColor: styles === null || styles === void 0 ? void 0 : styles.errorColor })));
14
14
  };
15
15
  export default Input;
16
16
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/input/Input.tsx"],"names":[],"mappings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IAAY,EAAE,EAAE,CAC7B,EAAE,IAAI,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,KAE1D,KAAK,EACT,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC,EACtD,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,eAAe,KAAI,CAAC,EAC7C,SAAS,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,CAAC,EACjC,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EACxD,WAAW,EAAE,KAAK,EAClB,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EACpB,UAAU,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,GAC9B,CACG,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { LegacyRef } from 'react';
2
- import { ColorValue, StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
3
- import { TextField } from 'rn-material-ui-textfield';
2
+ import { ColorValue, StyleProp, TextStyle, ViewStyle } from 'react-native';
3
+ import { TextField, TextFieldProps } from 'rn-material-ui-textfield';
4
4
  export interface IInputStyles {
5
5
  color?: ColorValue;
6
6
  container?: StyleProp<ViewStyle>;
@@ -9,8 +9,9 @@ export interface IInputStyles {
9
9
  activeLineWidth?: number;
10
10
  baseColor?: ColorValue;
11
11
  errorColor?: ColorValue;
12
+ fieldWrapper?: StyleProp<ViewStyle>;
12
13
  }
13
- export interface IInputProps extends TextInputProps {
14
+ export interface IInputProps extends TextFieldProps {
14
15
  isSecure?: boolean;
15
16
  label: string;
16
17
  reference?: LegacyRef<TextField>;
@@ -14,10 +14,10 @@ const LoggedIn = ({ styles, texts, onPressMyOrders, onPressLogout, }) => {
14
14
  };
15
15
  const handleLogOutPress = () => {
16
16
  if (onPressLogout) {
17
- Alert.alert((logoutDialog === null || logoutDialog === void 0 ? void 0 : logoutDialog.title) || 'Do you want to logout?', (logoutDialog === null || logoutDialog === void 0 ? void 0 : logoutDialog.message) ||
18
- 'You will need to enter your credentials again to purchase tickets', [
17
+ Alert.alert((logoutDialog === null || logoutDialog === void 0 ? void 0 : logoutDialog.title) || 'Do you want to log out?', (logoutDialog === null || logoutDialog === void 0 ? void 0 : logoutDialog.message) ||
18
+ 'You will lose your selection and you will need to enter your credentials again.', [
19
19
  {
20
- text: (logoutDialog === null || logoutDialog === void 0 ? void 0 : logoutDialog.confirmButton) || 'Yes, logout',
20
+ text: (logoutDialog === null || logoutDialog === void 0 ? void 0 : logoutDialog.confirmButton) || 'Yes',
21
21
  style: 'destructive',
22
22
  onPress: onPressLogout,
23
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"LoggedIn.js","sourceRoot":"","sources":["../../../src/components/loggedIn/LoggedIn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAA;AAC3B,OAAO,CAAC,MAAM,UAAU,CAAA;AAGxB,MAAM,QAAQ,GAAuB,CAAC,EACpC,MAAM,EACN,KAAK,EACL,eAAe,EACf,aAAa,GACd,EAAE,EAAE;IACH,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG;QACtD,GAAG,MAAM;KACV,CAAA;IACD,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;IAC1E,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iB,EAC1B,MAAM,EAAE,YAAY,GACpB,CACG,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { FC } from 'react';
1
2
  import { ILoginProps } from './types';
2
- declare const Login: ({ onLoginSuccessful, isLoginDialogVisible, showLoginDialog, hideLoginDialog, userFirstName, onLogoutSuccess, texts, styles, onLoginError, onFetchAccessTokenError, onFetchUserProfileError, refs, brandImages, onFetchAccessTokenSuccess, onFetchUserProfileSuccess, }: ILoginProps) => JSX.Element;
3
+ declare const Login: FC<ILoginProps>;
3
4
  export default Login;
@@ -1,84 +1,46 @@
1
- import React, { useState } from 'react';
1
+ import React, { useRef, useState } from 'react';
2
2
  import { Keyboard } from 'react-native';
3
- import { authorize, fetchAccessToken, fetchUserProfile, setAccessTokenHandler, } from '../../api/ApiClient';
4
- import { Config } from '../../helpers/Config';
5
- import { deleteAllData, LocalStorageKeys, storeData, } from '../../helpers/LocalStorage';
3
+ import { LoginCore } from '../../core';
6
4
  import LoginView from './LoginView';
7
- const Login = ({ onLoginSuccessful, isLoginDialogVisible, showLoginDialog, hideLoginDialog, userFirstName, onLogoutSuccess, texts, styles, onLoginError, onFetchAccessTokenError, onFetchUserProfileError, refs, brandImages, onFetchAccessTokenSuccess, onFetchUserProfileSuccess, }) => {
5
+ const Login = ({ onLoginSuccessful, onLoginError, isLoginDialogVisible, showLoginDialog, hideLoginDialog, userFirstName, onLogoutSuccess, onLogoutError, texts, styles, refs, brandImages, }) => {
8
6
  const [isLoading, setIsLoading] = useState(false);
9
7
  const [loginError, setLoginError] = useState('');
10
8
  const [userProfileData, setUserProfileData] = useState();
11
- const handleOnPressLogin = async (email, password) => {
9
+ const loginCoreRef = useRef(null);
10
+ const handleOnPressLogin = async (fields) => {
11
+ var _a;
12
12
  if (loginError) {
13
13
  setLoginError('');
14
14
  }
15
- const bodyFormData = new FormData();
16
- bodyFormData.append('email', email);
17
- bodyFormData.append('password', password);
18
- setIsLoading(true);
19
- const { code, error } = await authorize(bodyFormData);
20
- if (error || !code) {
21
- setIsLoading(false);
22
- if (onLoginError) {
23
- setLoginError((error === null || error === void 0 ? void 0 : error.message) || 'Auth error');
24
- return onLoginError(error);
25
- }
26
- }
27
- const bodyFormDataToken = new FormData();
28
- bodyFormDataToken.append('code', code);
29
- bodyFormDataToken.append('scope', 'profile');
30
- bodyFormDataToken.append('grant_type', 'authorization_code');
31
- bodyFormDataToken.append('client_id', Config.CLIENT_ID);
32
- bodyFormDataToken.append('client_secret', Config.CLIENT_SECRET);
33
- const { error: tokenError, accessToken } = await fetchAccessToken(bodyFormDataToken);
34
- if (tokenError) {
35
- setIsLoading(false);
36
- if (onFetchAccessTokenError) {
37
- return onFetchAccessTokenError(tokenError);
38
- }
39
- }
40
- if (onFetchAccessTokenError) {
41
- setAccessTokenHandler(accessToken);
42
- }
43
- if (onFetchAccessTokenSuccess) {
44
- onFetchAccessTokenSuccess();
15
+ if (!((_a = loginCoreRef.current) === null || _a === void 0 ? void 0 : _a.login)) {
16
+ return onLoginError === null || onLoginError === void 0 ? void 0 : onLoginError({
17
+ message: 'LoginCoreRef is not initialized',
18
+ });
45
19
  }
46
- const { error: userProfileError, userProfile } = await fetchUserProfile(accessToken);
47
- if (userProfileError || !userProfile) {
20
+ setIsLoading(true);
21
+ const { data: authorizationData, error: authorizationError } = await loginCoreRef.current.login(fields);
22
+ if (authorizationError || !authorizationData) {
48
23
  setIsLoading(false);
49
- if (onFetchUserProfileError) {
50
- return onFetchUserProfileError(userProfileError);
51
- }
52
- return;
53
- }
54
- if (onFetchUserProfileSuccess) {
55
- onFetchUserProfileSuccess({
56
- firstName: userProfile.firstName,
57
- lastName: userProfile.lastName,
58
- });
24
+ setLoginError((authorizationError === null || authorizationError === void 0 ? void 0 : authorizationError.message) || 'Auth error');
25
+ return onLoginError === null || onLoginError === void 0 ? void 0 : onLoginError(authorizationError);
59
26
  }
60
- const storedUserData = {
61
- id: userProfile.id,
62
- firstName: userProfile.firstName,
63
- lastName: userProfile.lastName,
64
- email: userProfile.email,
65
- };
66
- await storeData(LocalStorageKeys.USER_DATA, JSON.stringify(storedUserData));
67
- await storeData(LocalStorageKeys.ACCESS_TOKEN, accessToken);
68
27
  Keyboard.dismiss();
69
- setUserProfileData(userProfile);
70
- onLoginSuccessful(userProfile, accessToken);
28
+ setUserProfileData(authorizationData);
29
+ onLoginSuccessful(authorizationData);
71
30
  setIsLoading(false);
72
31
  hideLoginDialog();
73
32
  };
74
33
  const handleOnPressLogout = async () => {
75
- await deleteAllData();
76
- setUserProfileData(undefined);
77
- if (onLogoutSuccess) {
78
- onLogoutSuccess();
34
+ var _a;
35
+ if (!((_a = loginCoreRef.current) === null || _a === void 0 ? void 0 : _a.logout)) {
36
+ return onLogoutError === null || onLogoutError === void 0 ? void 0 : onLogoutError({ message: 'LoginCoreRef is not initialized' });
79
37
  }
38
+ await loginCoreRef.current.logout();
39
+ setUserProfileData(undefined);
40
+ onLogoutSuccess === null || onLogoutSuccess === void 0 ? void 0 : onLogoutSuccess();
80
41
  };
81
- return (React.createElement(LoginView, { showDialog: showLoginDialog, hideDialog: hideLoginDialog, isDialogVisible: isLoginDialogVisible, onPressLogin: handleOnPressLogin, isLoading: isLoading, userProfile: userProfileData, onPressLogout: handleOnPressLogout, texts: texts, styles: styles, userFirstName: userFirstName, loginError: loginError, refs: refs, brandImages: brandImages }));
42
+ return (React.createElement(LoginCore, { ref: loginCoreRef },
43
+ React.createElement(LoginView, { showDialog: showLoginDialog, hideDialog: hideLoginDialog, isDialogVisible: isLoginDialogVisible, onPressLogin: handleOnPressLogin, isLoading: isLoading, userProfile: userProfileData, onPressLogout: handleOnPressLogout, texts: texts, styles: styles, userFirstName: userFirstName, loginError: loginError, refs: refs, brandImages: brandImages })));
82
44
  };
83
45
  export default Login;
84
46
  //# sourceMappingURL=Login.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Login.js","sourceRoot":"","sources":["../../../src/components/login/Login.tsx"],"names":[],"mappings":"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C5B,aAAa,EAAE,mBAAmB,EAClC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,GACxB,CACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { FC } from 'react';
1
2
  import { ILoginViewProps } from './types';
2
- declare const LoginView: ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLoading, onPressLogout, styles, texts, userFirstName, loginError, refs, brandImages, }: ILoginViewProps) => JSX.Element;
3
+ declare const LoginView: FC<ILoginViewProps>;
3
4
  export default LoginView;
@@ -1,4 +1,3 @@
1
- //@ts-nocheck
2
1
  import _map from 'lodash/map';
3
2
  import React, { useCallback, useMemo, useState } from 'react';
4
3
  import { Alert, Image, Modal, Text, TouchableOpacity, TouchableWithoutFeedback, View, } from 'react-native';
@@ -54,6 +53,7 @@ const LoginView = ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLo
54
53
  },
55
54
  ];
56
55
  };
56
+ // eslint-disable-next-line react-hooks/exhaustive-deps
57
57
  const formFields = useMemo(getFormFields, [data, email.value, password.value]);
58
58
  const renderFormFields = useCallback(() => {
59
59
  return _map(formFields, (item, index) => (React.createElement(FormField, { ...item, key: `loginModal.${index}.${item.id}` })));
@@ -62,13 +62,16 @@ const LoginView = ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLo
62
62
  if (email.value.toString().length === 0) {
63
63
  return false;
64
64
  }
65
- if (password.value.toString().length < 5) {
65
+ if (password.value.toString().length < 6) {
66
66
  return false;
67
67
  }
68
68
  return true;
69
69
  };
70
70
  const handleOnPressLogin = () => {
71
- onPressLogin(email.value, password.value);
71
+ onPressLogin({
72
+ email: email.value,
73
+ password: password.value,
74
+ });
72
75
  };
73
76
  const logoutTitle = ((_a = texts === null || texts === void 0 ? void 0 : texts.logoutDialog) === null || _a === void 0 ? void 0 : _a.title)
74
77
  ? texts.logoutDialog.title
@@ -120,9 +123,15 @@ const LoginView = ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLo
120
123
  React.createElement(Text, { style: (_d = styles === null || styles === void 0 ? void 0 : styles.guest) === null || _d === void 0 ? void 0 : _d.line2 }, line2))),
121
124
  React.createElement(Button, { styles: { container: s.button, ...(_e = styles === null || styles === void 0 ? void 0 : styles.guest) === null || _e === void 0 ? void 0 : _e.loginButton }, text: (texts === null || texts === void 0 ? void 0 : texts.loginButton) || 'LOGIN', onPress: showDialog })));
122
125
  };
123
- const BrandImages = () => (React.createElement(View, { style: brandImages === null || brandImages === void 0 ? void 0 : brandImages.containerStyle },
126
+ const BrandImages = useMemo(() => (React.createElement(View, { style: brandImages === null || brandImages === void 0 ? void 0 : brandImages.containerStyle },
124
127
  React.createElement(Image, { source: (brandImages === null || brandImages === void 0 ? void 0 : brandImages.image1) || R.images.brand, style: [s.brand, brandImages === null || brandImages === void 0 ? void 0 : brandImages.image1Style] }),
125
- (brandImages === null || brandImages === void 0 ? void 0 : brandImages.image2) && (React.createElement(Image, { source: brandImages.image2, style: brandImages === null || brandImages === void 0 ? void 0 : brandImages.image2Style }))));
128
+ (brandImages === null || brandImages === void 0 ? void 0 : brandImages.image2) && (React.createElement(Image, { source: brandImages.image2, style: brandImages === null || brandImages === void 0 ? void 0 : brandImages.image2Style })))), [
129
+ brandImages === null || brandImages === void 0 ? void 0 : brandImages.containerStyle,
130
+ brandImages === null || brandImages === void 0 ? void 0 : brandImages.image1,
131
+ brandImages === null || brandImages === void 0 ? void 0 : brandImages.image1Style,
132
+ brandImages === null || brandImages === void 0 ? void 0 : brandImages.image2,
133
+ brandImages === null || brandImages === void 0 ? void 0 : brandImages.image2Style,
134
+ ]);
126
135
  return (React.createElement(View, { style: s.rootContainer },
127
136
  userFirstName ? LoggedComponent() : GuestComponent(),
128
137
  isDialogVisible && (React.createElement(Modal, { transparent: true, presentationStyle: 'overFullScreen' },
@@ -131,7 +140,7 @@ const LoginView = ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLo
131
140
  React.createElement(TouchableWithoutFeedback, null,
132
141
  React.createElement(View, { style: [s.dialog, (_e = styles === null || styles === void 0 ? void 0 : styles.dialog) === null || _e === void 0 ? void 0 : _e.container] },
133
142
  React.createElement(Text, { style: [s.dialogTitle, (_f = styles === null || styles === void 0 ? void 0 : styles.dialog) === null || _f === void 0 ? void 0 : _f.title] }, ((_g = texts === null || texts === void 0 ? void 0 : texts.dialog) === null || _g === void 0 ? void 0 : _g.title) || 'Login'),
134
- React.createElement(BrandImages, null),
143
+ BrandImages,
135
144
  !!((_h = texts === null || texts === void 0 ? void 0 : texts.dialog) === null || _h === void 0 ? void 0 : _h.message) && (React.createElement(Text, { style: [s.message, (_j = styles === null || styles === void 0 ? void 0 : styles.dialog) === null || _j === void 0 ? void 0 : _j.message] }, texts.dialog.message)),
136
145
  renderFormFields(),
137
146
  !!loginError && React.createElement(Text, { style: [s.error] }, loginError),
@@ -140,7 +149,9 @@ const LoginView = ({ showDialog, hideDialog, isDialogVisible, onPressLogin, isLo
140
149
  : {
141
150
  container: [s.loginButton],
142
151
  ...(_l = styles === null || styles === void 0 ? void 0 : styles.dialog) === null || _l === void 0 ? void 0 : _l.loginButton,
143
- }, text: ((_m = texts === null || texts === void 0 ? void 0 : texts.dialog) === null || _m === void 0 ? void 0 : _m.loginButton) || 'LOGIN', onPress: handleOnPressLogin, isLoading: isLoading, isDisabled: !checkIsDataValid(), ref: refs === null || refs === void 0 ? void 0 : refs.button })))))))));
152
+ }, text: ((_m = texts === null || texts === void 0 ? void 0 : texts.dialog) === null || _m === void 0 ? void 0 : _m.loginButton) || 'LOGIN', onPress: handleOnPressLogin, isLoading: isLoading, isDisabled: !checkIsDataValid(),
153
+ //@ts-ignore
154
+ ref: refs === null || refs === void 0 ? void 0 : refs.button })))))))));
144
155
  };
145
156
  export default LoginView;
146
157
  //# sourceMappingURL=LoginView.js.map