ordering-ui-react-native 0.16.73 → 0.16.74-release

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 (216) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +10 -10
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +2 -1
  9. package/src/components/LanguageSelector/index.tsx +21 -16
  10. package/src/components/Messages/index.tsx +2 -2
  11. package/src/components/OrderCreating/index.tsx +2 -2
  12. package/src/components/OrdersOption/index.tsx +54 -56
  13. package/src/components/PaymentOptions/index.tsx +298 -345
  14. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  15. package/src/components/SingleProductReview/index.tsx +7 -4
  16. package/src/components/StripeElementsForm/index.tsx +25 -16
  17. package/src/components/VerifyPhone/styles.tsx +1 -2
  18. package/src/components/shared/OToast.tsx +4 -4
  19. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  20. package/src/utils/index.tsx +2 -1
  21. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  22. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  23. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  24. package/themes/business/src/components/Chat/index.tsx +31 -31
  25. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  26. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  27. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  28. package/themes/business/src/components/LoginForm/index.tsx +332 -140
  29. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  30. package/themes/business/src/components/MapView/index.tsx +14 -3
  31. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  32. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  35. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  36. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  37. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  40. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  44. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  46. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  47. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  48. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  49. package/themes/business/src/components/ProductItemAccordion/index.tsx +24 -5
  50. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  51. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  52. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  53. package/themes/business/src/components/shared/OLink.tsx +33 -13
  54. package/themes/business/src/components/shared/OText.tsx +8 -2
  55. package/themes/business/src/types/index.tsx +29 -3
  56. package/themes/business/src/utils/index.tsx +26 -0
  57. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  59. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  61. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  63. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  64. package/themes/kiosk/src/components/LoginForm/index.tsx +545 -112
  65. package/themes/kiosk/src/components/LoginForm/styles.tsx +18 -0
  66. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  67. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  68. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  69. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  70. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  71. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  72. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  73. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  74. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  75. package/themes/kiosk/src/types/index.d.ts +15 -0
  76. package/themes/kiosk/src/utils/index.tsx +15 -0
  77. package/themes/original/index.tsx +6 -0
  78. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  79. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  80. package/themes/original/src/components/AddressList/index.tsx +18 -18
  81. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  82. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  83. package/themes/original/src/components/BusinessBasicInformation/index.tsx +47 -22
  84. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  85. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  86. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  88. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  89. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +105 -156
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  93. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  94. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
  96. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  97. package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -496
  98. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  99. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +83 -80
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  103. package/themes/original/src/components/BusinessesListing/index.tsx +7 -6
  104. package/themes/original/src/components/Cart/index.tsx +76 -42
  105. package/themes/original/src/components/CartContent/index.tsx +80 -18
  106. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  107. package/themes/original/src/components/Checkout/index.tsx +96 -108
  108. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  109. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  110. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  111. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  112. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  113. package/themes/original/src/components/Favorite/index.tsx +7 -4
  114. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  115. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  116. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  117. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  118. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  119. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  120. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  121. package/themes/original/src/components/Help/index.tsx +8 -8
  122. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  123. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpGuide/index.tsx +13 -12
  125. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  126. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  127. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  128. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  129. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  130. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  131. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  132. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  133. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  134. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  135. package/themes/original/src/components/Messages/index.tsx +42 -26
  136. package/themes/original/src/components/MomentOption/index.tsx +23 -14
  137. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  138. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  139. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  140. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  141. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  142. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  143. package/themes/original/src/components/MyOrders/index.tsx +86 -20
  144. package/themes/original/src/components/NavBar/index.tsx +7 -6
  145. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  146. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  147. package/themes/original/src/components/Notifications/index.tsx +144 -0
  148. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  149. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  150. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  151. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  152. package/themes/original/src/components/OrderProgress/index.tsx +81 -105
  153. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  154. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  155. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  156. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  157. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  158. package/themes/original/src/components/OrdersOption/index.tsx +97 -100
  159. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  162. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  163. package/themes/original/src/components/PlaceSpot/index.tsx +22 -8
  164. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  165. package/themes/original/src/components/ProductForm/index.tsx +240 -254
  166. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  167. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  169. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  170. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  171. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  172. package/themes/original/src/components/ProfessionalProfile/index.tsx +20 -9
  173. package/themes/original/src/components/Promotions/index.tsx +234 -220
  174. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  175. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  176. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  177. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  178. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  179. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  180. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  181. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  182. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  183. package/themes/original/src/components/ServiceForm/index.tsx +337 -265
  184. package/themes/original/src/components/Sessions/index.tsx +11 -8
  185. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  186. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  187. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  188. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  189. package/themes/original/src/components/SingleProductCard/index.tsx +133 -91
  190. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  191. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  192. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  193. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  194. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  195. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  196. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  197. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  198. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  199. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  200. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  201. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  202. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  203. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  204. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  205. package/themes/original/src/components/Wallets/index.tsx +177 -164
  206. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  207. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  208. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  209. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  210. package/themes/original/src/components/shared/OButton.tsx +9 -4
  211. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  212. package/themes/original/src/components/shared/OInput.tsx +10 -1
  213. package/themes/original/src/layouts/Container.tsx +13 -9
  214. package/themes/original/src/types/index.tsx +38 -6
  215. package/themes/original/src/utils/index.tsx +317 -58
  216. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -5,147 +5,146 @@ import WebView from 'react-native-webview';
5
5
  import { ActivityIndicator } from 'react-native-paper';
6
6
 
7
7
  import {
8
- ToastType,
9
- useToast,
10
- useApi,
11
- useLanguage,
12
- useConfig
8
+ ToastType,
9
+ useToast,
10
+ useApi,
11
+ useLanguage,
12
+ useConfig
13
13
  } from 'ordering-components/native';
14
14
 
15
15
  import { OText } from '../shared';
16
16
 
17
17
  interface PaymentOptionsWebViewParams {
18
- onNavigationRedirect?: Function,
19
- uri?: any,
20
- user?: any,
21
- token?: any,
22
- cart?: any,
23
- currency?: any,
24
- webviewPaymethod?: any,
25
- setShowGateway?: any,
26
- setOpenOrderCreating?: any,
27
- locationId?: any
18
+ onNavigationRedirect?: Function,
19
+ uri?: any,
20
+ user?: any,
21
+ token?: any,
22
+ cart?: any,
23
+ currency?: any,
24
+ webviewPaymethod?: any,
25
+ setShowGateway?: any,
26
+ setOpenOrderCreating?: any,
27
+ locationId?: any
28
28
  }
29
29
  export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
30
- const {
31
- onNavigationRedirect,
32
- uri,
33
- user,
34
- token,
35
- cart,
36
- currency,
37
- webviewPaymethod,
38
- setShowGateway,
39
- setOpenOrderCreating,
40
- locationId
41
- } = props
30
+ const {
31
+ onNavigationRedirect,
32
+ uri,
33
+ user,
34
+ token,
35
+ cart,
36
+ currency,
37
+ webviewPaymethod,
38
+ setShowGateway,
39
+ setOpenOrderCreating,
40
+ locationId
41
+ } = props
42
42
 
43
- const webviewRef = useRef<any>(null)
44
- const [, { showToast }] = useToast();
45
- const [ordering] = useApi()
46
- const [{ configs }] = useConfig();
47
- const [, t] = useLanguage();
43
+ const webviewRef = useRef<any>(null)
44
+ const [, { showToast }] = useToast();
45
+ const [ordering] = useApi()
46
+ const [{ configs }] = useConfig();
47
+ const [, t] = useLanguage();
48
48
 
49
+
50
+ const [progClr, setProgClr] = useState('#424242');
51
+ const [prog, setProg] = useState(true);
49
52
 
50
- const [progClr, setProgClr] = useState('#424242');
51
- const [prog, setProg] = useState(true);
52
-
53
- const handleCloseWebview = () => {
53
+ const handleCloseWebview = () => {
54
54
  setProg(true);
55
55
  setShowGateway({ open: false, closedByUser: true })
56
56
  }
57
57
 
58
- const onMessage = (e: any) => {
59
- if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
60
- let payment = JSON.parse(e.nativeEvent.data);
58
+ const onMessage = (e: any) => {
59
+ if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
60
+ let payment = JSON.parse(e.nativeEvent.data);
61
61
 
62
62
  if (payment === 'api error' || payment === 'Cancelled by user') {
63
63
  setShowGateway({ closedByUser: true, open: false })
64
64
  setProg(true);
65
65
  }
66
66
 
67
- if (payment) {
68
- if (payment.error) {
69
- showToast(ToastType.Error, payment.result)
70
- setOpenOrderCreating && setOpenOrderCreating(false)
71
- } else if (payment?.result?.order?.uuid) {
72
- showToast(ToastType.Success, t('ORDER_PLACED_SUCCESSfULLY', 'The order was placed successfully'))
73
- onNavigationRedirect && onNavigationRedirect('OrderDetails', { orderId: payment?.result?.order?.uuid, isFromCheckout: true })
67
+ if (payment) {
68
+ if (payment.error) {
69
+ showToast(ToastType.Error, payment.result)
70
+ setOpenOrderCreating && setOpenOrderCreating(false)
71
+ } else if (payment?.result?.order?.uuid) {
72
+ showToast(ToastType.Success, t('ORDER_PLACED_SUCCESSfULLY', 'The order was placed successfully'))
73
+ onNavigationRedirect && onNavigationRedirect('OrderDetails', { orderId: payment?.result?.order?.uuid, isFromCheckout: true})
74
+ }
75
+ setProg(true);
76
+ setShowGateway({ closedByUser: false, open: false })
77
+ }
74
78
  }
75
- setProg(true);
76
- setShowGateway({ closedByUser: false, open: false })
77
- }
78
- }
79
- }
79
+ }
80
80
 
81
- return (
81
+ return (
82
82
  <View style={{ zIndex: 9999, height: '100%', width: '100%', position: 'absolute', backgroundColor: 'white' }}>
83
- <Icon
84
- name="x"
85
- size={35}
86
- style={{ backgroundColor: 'white', paddingTop: 30, paddingLeft: 10 }}
87
- onPress={handleCloseWebview}
88
- />
89
- <OText
90
- style={{
91
- textAlign: 'center',
92
- fontSize: 16,
93
- fontWeight: 'bold',
94
- color: '#00457C',
95
- marginBottom: 5,
96
- marginTop: 10
97
- }}>
98
- {webviewPaymethod?.gateway === 'paypal' ? (t('PAYPAL_GATEWAY', 'PayPal GateWay')) : (t('SQUARE_PAYMENT', 'Square payment'))}
99
- </OText>
100
- <View style={{ padding: 20, opacity: prog ? 1 : 0, backgroundColor: 'white' }}>
101
- <ActivityIndicator size={24} color={progClr} />
102
- </View>
103
- <WebView
104
- source={{ uri: uri }}
105
- onMessage={onMessage}
106
- ref={webviewRef}
107
- javaScriptEnabled={true}
108
- javaScriptEnabledAndroid={true}
109
- cacheEnabled={false}
110
- cacheMode='LOAD_NO_CACHE'
111
- style={{ flex: 1 }}
112
- onShouldStartLoadWithRequest={() => true}
113
- onLoadStart={() => {
114
- setProg(true);
115
- setProgClr('#424242');
116
- }}
117
- onLoadProgress={() => {
118
- setProg(true);
119
- setProgClr('#00457C');
120
- }}
121
- onLoad={() => {
122
- setProg(true);
123
- setProgClr('#00457C');
124
- }}
125
- onLoadEnd={(e) => {
126
- const messageParams = locationId ? { locationId, clientId: webviewPaymethod?.credentials?.application_id } : {}
127
- const message = {
128
- action: 'init',
129
- data: {
130
- urlPlace: `${ordering.root}/carts/${cart?.uuid}/place`,
131
- urlConfirm: `${ordering.root}/carts/${cart?.uuid}/confirm`,
132
- payData: {
133
- paymethod_id: webviewPaymethod?.id,
134
- amount: cart?.balance ?? cart?.total,
135
- delivery_zone_id: cart?.delivery_zone_id,
136
- user_id: user?.id,
137
- user_name: user?.name
138
- },
139
- currency: configs?.stripe_currency?.value || currency,
140
- userToken: token,
141
- clientId: webviewPaymethod?.credentials?.client_id,
142
- ...messageParams
143
- }
144
- }
145
- setProg(false);
146
- webviewRef?.current?.postMessage?.(JSON.stringify(message))
147
- }}
148
- />
83
+ <Icon
84
+ name="x"
85
+ size={35}
86
+ style={{ backgroundColor: 'white', paddingTop: 30, paddingLeft: 10 }}
87
+ onPress={handleCloseWebview}
88
+ />
89
+ <OText
90
+ style={{
91
+ textAlign: 'center',
92
+ fontSize: 16,
93
+ fontWeight: 'bold',
94
+ color: '#00457C',
95
+ marginBottom: 5,
96
+ marginTop: 10
97
+ }}>
98
+ {webviewPaymethod?.gateway === 'paypal' ? (t('PAYPAL_GATEWAY', 'PayPal GateWay')) : (t('SQUARE_PAYMENT', 'Square payment'))}
99
+ </OText>
100
+ <View style={{ padding: 20, opacity: prog ? 1 : 0, backgroundColor: 'white' }}>
101
+ <ActivityIndicator size={24} color={progClr} />
102
+ </View>
103
+ <WebView
104
+ source={{ uri: uri }}
105
+ onMessage={onMessage}
106
+ ref={webviewRef}
107
+ javaScriptEnabled={true}
108
+ javaScriptEnabledAndroid={true}
109
+ cacheEnabled={false}
110
+ cacheMode='LOAD_NO_CACHE'
111
+ style={{ flex: 1 }}
112
+ onShouldStartLoadWithRequest={() => true}
113
+ onLoadStart={() => {
114
+ setProg(true);
115
+ setProgClr('#424242');
116
+ }}
117
+ onLoadProgress={() => {
118
+ setProg(true);
119
+ setProgClr('#00457C');
120
+ }}
121
+ onLoad={() => {
122
+ setProg(true);
123
+ setProgClr('#00457C');
124
+ }}
125
+ onLoadEnd={(e) => {
126
+ const messageParams = locationId ? { locationId } : {}
127
+ const message = {
128
+ action: 'init',
129
+ data: {
130
+ urlPlace: `${ordering.root}/carts/${cart?.uuid}/place`,
131
+ urlConfirm: `${ordering.root}/carts/${cart?.uuid}/confirm`,
132
+ payData: {
133
+ paymethod_id: webviewPaymethod?.id,
134
+ amount: cart?.balance ?? cart?.total,
135
+ delivery_zone_id: cart?.delivery_zone_id,
136
+ user_id: user?.id,
137
+ user_name: user?.name
138
+ },
139
+ currency: configs?.stripe_currency?.value || currency,
140
+ userToken: token,
141
+ clientId: webviewPaymethod?.credentials?.client_id,
142
+ ...messageParams
143
+ }
144
+ }
145
+ setProg(false);
146
+ webviewRef?.current?.postMessage?.(JSON.stringify(message))
147
+ }}
148
+ />
149
149
  </View>
150
- )
151
- }
150
+ )}
@@ -1,10 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useLanguage } from 'ordering-components/native'
3
- import { OText, OButton, OInput } from '../shared'
2
+ import { useLanguage, useUtils } from 'ordering-components/native'
3
+ import { OText, OButton, OInput, OIcon } from '../shared'
4
4
  import { StyleSheet, TouchableOpacity, View } from 'react-native'
5
5
  import AntDesignIcons from 'react-native-vector-icons/AntDesign'
6
6
  import { useTheme } from 'styled-components/native'
7
7
  import { SingleProductReviewParams } from '../../types'
8
+ import FastImage from 'react-native-fast-image'
8
9
 
9
10
  import {
10
11
  ProductContainer,
@@ -12,6 +13,7 @@ import {
12
13
  LikeHandsActionContainer,
13
14
  LikeHandsButton,
14
15
  CommentsButtonGroup,
16
+ LogoWrapper
15
17
  } from './styles'
16
18
 
17
19
  export const SingleProductReview = (props: SingleProductReviewParams) => {
@@ -23,6 +25,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
23
25
 
24
26
  const [, t] = useLanguage()
25
27
  const theme = useTheme()
28
+ const [{ optimizeImage }] = useUtils()
26
29
 
27
30
  const styles = StyleSheet.create({
28
31
  inputTextArea: {
@@ -37,7 +40,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
37
40
  flexDirection: 'row',
38
41
  justifyContent: 'center',
39
42
  marginVertical: 10,
40
- },
43
+ }
41
44
  })
42
45
 
43
46
  const [comments, setComments] = useState<Array<any>>([])
@@ -129,7 +132,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
129
132
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
130
133
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
131
134
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
132
- onClick={() => handleChangeComment(commentItem) }
135
+ onClick={() => handleChangeComment(commentItem)}
133
136
  />
134
137
  ))}
135
138
  </CommentsButtonGroup>
@@ -7,7 +7,6 @@ import {
7
7
  useConfirmSetupIntent,
8
8
  createPaymentMethod
9
9
  } from '@stripe/stripe-react-native';
10
- import configs from '../../config.json'
11
10
  import { ErrorMessage } from './styles';
12
11
 
13
12
  import { StripeElementsForm as StripeFormController } from './naked';
@@ -26,7 +25,8 @@ const StripeElementsFormUI = (props: any) => {
26
25
  methodsPay,
27
26
  paymethod,
28
27
  onCancel,
29
- cart
28
+ cart,
29
+ merchantId
30
30
  } = props;
31
31
 
32
32
  const theme = useTheme();
@@ -54,17 +54,25 @@ const StripeElementsFormUI = (props: any) => {
54
54
  }
55
55
 
56
56
  if (user?.address) {
57
- billingDetails.addressLine1 = user?.address
58
- }
57
+ billingDetails.address = {
58
+ line1: user?.address
59
+ }
60
+ }
59
61
 
60
62
  const createPayMethod = async () => {
61
- const params: any = { type: 'Card' }
62
- if (Object.keys(billingDetails).length > 0) {
63
- params.billingDetails = billingDetails
64
- }
63
+ const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
64
+ if (Object.keys(billingDetails).length > 0) {
65
+ params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
66
+ }
65
67
  try {
66
68
  setCreatePmLoading(true)
67
- const { paymentMethod } = await createPaymentMethod(params);
69
+ const { paymentMethod, error } = await createPaymentMethod(params);
70
+
71
+ if (error) {
72
+ setErrors(error?.message);
73
+ setCreatePmLoading(false)
74
+ return
75
+ }
68
76
 
69
77
  setCreatePmLoading(false)
70
78
  handleSource && handleSource({
@@ -87,10 +95,10 @@ const StripeElementsFormUI = (props: any) => {
87
95
  createPayMethod();
88
96
  return
89
97
  }
90
- const params: any = { type: 'Card' }
91
- if (Object.keys(billingDetails).length > 0) {
92
- params.billingDetails = billingDetails
93
- }
98
+ const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
99
+ if (Object.keys(billingDetails).length > 0) {
100
+ params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
101
+ }
94
102
  try {
95
103
  const { setupIntent, error } = await confirmSetupIntent(requirements, params);
96
104
 
@@ -126,12 +134,13 @@ const StripeElementsFormUI = (props: any) => {
126
134
  <View style={styles.container}>
127
135
  {publicKey ? (
128
136
  <View style={{ flex: 1 }}>
129
- <StripeProvider
137
+ <StripeProvider
130
138
  publishableKey={publicKey}
131
- merchantIdentifier={`merchant.${configs.apple_app_id}`}
139
+ merchantIdentifier={`merchant.${merchantId}`}
140
+ urlScheme={merchantId}
132
141
  >
133
142
  {methodsPay?.includes(paymethod) ? (
134
- <StripeMethodForm
143
+ <StripeMethodForm
135
144
  handleSource={handleSource}
136
145
  onCancel={onCancel}
137
146
  cart={cart}
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding: 0 43px;
5
+ padding: 0 30px;
6
6
  `
7
7
 
8
8
  export const CountDownContainer = styled.View`
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
20
20
  display: flex;
21
21
  flex-direction: row;
22
22
  justify-content: center;
23
- flex-wrap: wrap;
24
23
  `
25
24
 
26
25
  export const WrappCountdown = styled.View`
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
- import { Animated, StyleSheet, Text, View } from "react-native";
2
+ import { Animated, StyleSheet, Text, View, Platform } from "react-native";
3
3
  import { ToastType, useToast, useLanguage } from "ordering-components/native";
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { getTraduction } from '../../utils'
6
6
 
7
7
  const fadeDuration = 300;
8
- const bottomPosition = 20;
8
+ const topPosition = Platform.OS === 'ios' ? 40 : 20
9
9
 
10
10
  export const Toast = (props: any) => {
11
11
  const [toastConfig, { hideToast }] = useToast();
@@ -54,7 +54,7 @@ export const Toast = (props: any) => {
54
54
  backgroundColor = theme.colors.toastInfo || '#6BA4FF';
55
55
  break;
56
56
  case ToastType.Error:
57
- backgroundColor = theme.colors.toastError || '#D83520' ;
57
+ backgroundColor = theme.colors.toastError || '#D83520';
58
58
  break;
59
59
  case ToastType.Success:
60
60
  backgroundColor = theme.colors.toastSuccess || '#90C68E';
@@ -65,7 +65,7 @@ export const Toast = (props: any) => {
65
65
  <Animated.View
66
66
  style={[
67
67
  styles.container,
68
- { bottom: bottomPosition, opacity },
68
+ { top: topPosition, opacity },
69
69
  ]}
70
70
  >
71
71
  <View style={[styles.toast, { backgroundColor }]}>
@@ -0,0 +1 @@
1
+ declare module '@fatnlazycat/react-native-recaptcha-v3'
@@ -34,7 +34,8 @@ export const getTraduction = (key: string, t: any) => {
34
34
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
35
35
  ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
36
36
  ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
37
- ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
37
+ ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
38
+ ERROR_ADD_PRODUCT_BEFORE_ADDRESS: 'You must have an address'
38
39
  }
39
40
 
40
41
  return keyList[key] ? t(key, keyList[key]) : t(key)