ordering-ui-react-native 0.17.99 → 0.18.0-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 (257) hide show
  1. package/package.json +9 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +0 -20
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +7 -2
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +163 -123
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  21. package/themes/business/src/components/LoginForm/index.tsx +5 -2
  22. package/themes/business/src/components/MapView/index.tsx +14 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
  25. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -15
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +91 -43
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +87 -66
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  32. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  33. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  34. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  35. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  36. package/themes/business/src/components/OrdersOption/index.tsx +60 -47
  37. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  38. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  39. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +21 -29
  40. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  41. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  42. package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
  43. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  44. package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
  45. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  46. package/themes/business/src/components/StoresList/index.tsx +3 -4
  47. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  48. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  49. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  50. package/themes/business/src/components/shared/OModal.tsx +16 -9
  51. package/themes/business/src/types/index.tsx +24 -10
  52. package/themes/business/src/utils/index.tsx +29 -2
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  57. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/original/index.tsx +7 -3
  65. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  66. package/themes/original/src/components/AddressForm/index.tsx +33 -15
  67. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  68. package/themes/original/src/components/AddressList/index.tsx +5 -8
  69. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  70. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  71. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  72. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  73. package/themes/original/src/components/BusinessBasicInformation/index.tsx +74 -38
  74. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +11 -13
  75. package/themes/original/src/components/BusinessController/index.tsx +35 -44
  76. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  77. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  78. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  79. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  80. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  81. package/themes/original/src/components/BusinessItemAccordion/index.tsx +25 -26
  82. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -341
  84. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -19
  85. package/themes/original/src/components/BusinessPreorder/index.tsx +105 -22
  86. package/themes/original/src/components/BusinessPreorder/styles.tsx +14 -0
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  90. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  91. package/themes/original/src/components/BusinessProductsListing/index.tsx +162 -39
  92. package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -5
  93. package/themes/original/src/components/BusinessReviews/index.tsx +4 -2
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  95. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +37 -404
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  101. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  102. package/themes/original/src/components/Cart/index.tsx +49 -47
  103. package/themes/original/src/components/CartContent/index.tsx +99 -38
  104. package/themes/original/src/components/CartContent/styles.tsx +6 -6
  105. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  106. package/themes/original/src/components/Checkout/index.tsx +324 -43
  107. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  108. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  109. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  110. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  111. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  112. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  113. package/themes/original/src/components/DriverTips/index.tsx +12 -4
  114. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  115. package/themes/original/src/components/Favorite/index.tsx +4 -9
  116. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  117. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  118. package/themes/original/src/components/GPSButton/index.tsx +7 -5
  119. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  120. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
  121. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +3 -1
  122. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  123. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  124. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  125. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  126. package/themes/original/src/components/GoogleMap/index.tsx +63 -7
  127. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  128. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  129. package/themes/original/src/components/Home/index.tsx +14 -5
  130. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  131. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  132. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  133. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  134. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  135. package/themes/original/src/components/MessageListing/index.tsx +9 -2
  136. package/themes/original/src/components/Messages/index.tsx +15 -4
  137. package/themes/original/src/components/Messages/styles.tsx +1 -1
  138. package/themes/original/src/components/MomentOption/index.tsx +44 -39
  139. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  140. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  141. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
  142. package/themes/original/src/components/MultiCheckout/index.tsx +348 -70
  143. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  144. package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -2
  145. package/themes/original/src/components/MyOrders/index.tsx +16 -5
  146. package/themes/original/src/components/NavBar/index.tsx +20 -13
  147. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  148. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  149. package/themes/original/src/components/Notifications/index.tsx +2 -4
  150. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  151. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  152. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +22 -6
  153. package/themes/original/src/components/OrderDetails/index.tsx +721 -670
  154. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  155. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  156. package/themes/original/src/components/OrderProgress/index.tsx +34 -25
  157. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  158. package/themes/original/src/components/OrderSummary/index.tsx +62 -57
  159. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  160. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  161. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
  162. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  163. package/themes/original/src/components/OrdersOption/index.tsx +44 -21
  164. package/themes/original/src/components/OrdersOption/styles.tsx +2 -2
  165. package/themes/original/src/components/PageBanner/index.tsx +65 -29
  166. package/themes/original/src/components/PageBanner/styles.tsx +0 -3
  167. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  168. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  169. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  170. package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
  171. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  172. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  173. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  174. package/themes/original/src/components/ProductForm/index.tsx +106 -170
  175. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  176. package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -6
  177. package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
  178. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  179. package/themes/original/src/components/ProfessionalProfile/index.tsx +35 -6
  180. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  181. package/themes/original/src/components/Promotions/index.tsx +6 -6
  182. package/themes/original/src/components/Promotions/styles.tsx +3 -3
  183. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  184. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  185. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  186. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  187. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  188. package/themes/original/src/components/ServiceForm/index.tsx +36 -24
  189. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  190. package/themes/original/src/components/SignupForm/index.tsx +27 -16
  191. package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
  192. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  193. package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
  194. package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
  195. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  196. package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
  197. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  198. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  199. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  200. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  201. package/themes/original/src/components/UpsellingProducts/index.tsx +16 -205
  202. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  203. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  204. package/themes/original/src/components/UserFormDetails/index.tsx +100 -22
  205. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  206. package/themes/original/src/components/UserProfile/index.tsx +8 -26
  207. package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
  208. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  209. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  210. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  211. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  212. package/themes/original/src/components/Wallets/index.tsx +48 -60
  213. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  214. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  215. package/themes/original/src/components/shared/OButton.tsx +3 -3
  216. package/themes/original/src/components/shared/OInput.tsx +4 -5
  217. package/themes/original/src/components/shared/OModal.tsx +15 -17
  218. package/themes/original/src/layouts/Container.tsx +1 -1
  219. package/themes/original/src/types/index.tsx +28 -6
  220. package/themes/original/src/utils/index.tsx +180 -13
  221. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  222. package/src/navigators/BottomNavigator.tsx +0 -117
  223. package/src/navigators/CheckoutNavigator.tsx +0 -66
  224. package/src/navigators/HomeNavigator.tsx +0 -202
  225. package/src/navigators/NavigationRef.tsx +0 -7
  226. package/src/navigators/RootNavigator.tsx +0 -269
  227. package/src/pages/Account.tsx +0 -34
  228. package/src/pages/AddressForm.tsx +0 -62
  229. package/src/pages/AddressList.tsx +0 -24
  230. package/src/pages/BusinessProductsList.tsx +0 -81
  231. package/src/pages/BusinessesListing.tsx +0 -43
  232. package/src/pages/CartList.tsx +0 -49
  233. package/src/pages/Checkout.tsx +0 -101
  234. package/src/pages/ForgotPassword.tsx +0 -24
  235. package/src/pages/Help.tsx +0 -23
  236. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  237. package/src/pages/HelpGuide.tsx +0 -23
  238. package/src/pages/HelpOrder.tsx +0 -23
  239. package/src/pages/Home.tsx +0 -36
  240. package/src/pages/IntroductoryTutorial.tsx +0 -170
  241. package/src/pages/Login.tsx +0 -47
  242. package/src/pages/MomentOption.tsx +0 -30
  243. package/src/pages/MultiCheckout.tsx +0 -31
  244. package/src/pages/MultiOrdersDetails.tsx +0 -27
  245. package/src/pages/MyOrders.tsx +0 -40
  246. package/src/pages/NetworkError.tsx +0 -24
  247. package/src/pages/NotFound.tsx +0 -22
  248. package/src/pages/OrderDetails.tsx +0 -25
  249. package/src/pages/ProductDetails.tsx +0 -55
  250. package/src/pages/Profile.tsx +0 -36
  251. package/src/pages/ReviewDriver.tsx +0 -30
  252. package/src/pages/ReviewOrder.tsx +0 -32
  253. package/src/pages/ReviewProducts.tsx +0 -30
  254. package/src/pages/Sessions.tsx +0 -22
  255. package/src/pages/Signup.tsx +0 -53
  256. package/src/pages/SpinnerLoader.tsx +0 -10
  257. package/src/pages/Splash.tsx +0 -21
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { StyleSheet, Alert, Text } from 'react-native';
3
- import { CouponControl as CouponController, useLanguage } from 'ordering-components/native';
3
+ import { CouponControl as CouponController, useLanguage, useEvent } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import {
6
6
  CContainer,
@@ -18,11 +18,13 @@ const CouponControlUI = (props: any) => {
18
18
  handleRemoveCouponClick,
19
19
  onChangeInputCoupon,
20
20
  confirm,
21
- setConfirm
21
+ setConfirm,
22
+ cart
22
23
  } = props
23
24
 
24
25
  const [, t] = useLanguage()
25
26
  const theme = useTheme();
27
+ const [events] = useEvent()
26
28
 
27
29
  const styles = StyleSheet.create({
28
30
  inputsStyle: {
@@ -45,6 +47,11 @@ const CouponControlUI = (props: any) => {
45
47
  setConfirm({ ...confirm, open: false, error: false })
46
48
  }
47
49
 
50
+ const onButtonApplyClick = () => {
51
+ events.emit('coupon_entered', { ...cart, coupon: couponInput })
52
+ handleButtonApplyClick()
53
+ }
54
+
48
55
  useEffect(() => {
49
56
  if (confirm.content) {
50
57
  Alert.alert(
@@ -94,7 +101,7 @@ const CouponControlUI = (props: any) => {
94
101
  inputStyle={{ fontSize: 12 }}
95
102
  />
96
103
  <OButton
97
- onClick={() => handleButtonApplyClick()}
104
+ onClick={() => onButtonApplyClick()}
98
105
  bgColor={theme.colors.primary}
99
106
  borderColor={theme.colors.primary}
100
107
  textStyle={{ color: 'white', fontSize: 12 }}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import DatePicker from 'react-native-date-picker'
3
+ import { DateContainer } from './styles';
4
+
5
+ export const DatePickerUI = (props: any) => {
6
+ const {
7
+ birthdate,
8
+ handleChangeDate
9
+ } = props;
10
+
11
+ return (
12
+ <DateContainer>
13
+ <DatePicker mode="date" date={birthdate ? new Date(birthdate) : new Date()} onDateChange={handleChangeDate} />
14
+ </DateContainer>
15
+ );
16
+ };
17
+
@@ -0,0 +1,20 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const DateContainer = styled.View`
4
+ display: flex;
5
+ align-items: center;
6
+ margin-bottom: 20px;
7
+
8
+ input {
9
+ border-radius: 20px;
10
+ width: 140px;
11
+ outline: none;
12
+ padding: 10px 15px;
13
+ border: 1px solid #E9ECEF;
14
+ }
15
+
16
+ .react-datepicker__triangle {
17
+ transform: translate(40px, 0px) !important;
18
+ }
19
+
20
+ `
@@ -23,7 +23,9 @@ const DriverTipsUI = (props: any) => {
23
23
  driverTip,
24
24
  driverTipsOptions,
25
25
  isMulti,
26
+ isLoading,
26
27
  cart,
28
+ carts,
27
29
  isDriverTipUseCustom,
28
30
  handlerChangeOption,
29
31
  isFixedPrice
@@ -64,6 +66,10 @@ const DriverTipsUI = (props: any) => {
64
66
  setvalue(val)
65
67
  }
66
68
 
69
+ const multiCartTipsAmmout = carts?.reduce((total: any, cart: any) => {
70
+ return total + parseFloat(cart?.driver_tip || 0)
71
+ }, 0)
72
+
67
73
  return (
68
74
  <DTContainer>
69
75
  <DTLabel>
@@ -74,8 +80,10 @@ const DriverTipsUI = (props: any) => {
74
80
  <TouchableOpacity
75
81
  key={i}
76
82
  onPress={() => {
77
- handlerChangeOption(option)
78
- setCustomTip(false)
83
+ if (!isLoading) {
84
+ handlerChangeOption(option)
85
+ setCustomTip(false)
86
+ }
79
87
  }}
80
88
  >
81
89
  <DTCard
@@ -90,7 +98,7 @@ const DriverTipsUI = (props: any) => {
90
98
  ))}
91
99
  {isDriverTipUseCustom && (
92
100
  <TouchableOpacity
93
- onPress={() => setCustomTip(true)}
101
+ onPress={() => { !isLoading && setCustomTip(true) }}
94
102
  >
95
103
  <DTCard
96
104
  style={style.semicircle}
@@ -138,7 +146,7 @@ const DriverTipsUI = (props: any) => {
138
146
  style={{ marginTop: 10, textAlign: 'center' }}
139
147
  >
140
148
  {t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount')}{!isFixedPrice &&
141
- ` (${driverTip}%)`}: {isFixedPrice ? parsePrice(driverTip) : parsePrice(cart?.driver_tip)}
149
+ ` (${driverTip}%)`}: {isFixedPrice ? parsePrice(multiCartTipsAmmout ?? driverTip) : parsePrice(multiCartTipsAmmout ?? cart?.driver_tip)}
142
150
  </OText>
143
151
  )}
144
152
  </DTContainer>
@@ -1,6 +1,8 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
- export const Container = styled.View``
3
+ export const Container = styled.View`
4
+ margin-bottom: 20px;
5
+ `
4
6
 
5
7
  export const FacebookButton = styled.TouchableOpacity`
6
8
  background-color: #FFFFFF;
@@ -14,8 +14,7 @@ import {
14
14
 
15
15
  export const Favorite = (props: any) => {
16
16
  const {
17
- navigation,
18
- franchiseId
17
+ navigation
19
18
  } = props
20
19
  const [, t] = useLanguage()
21
20
  const theme = useTheme()
@@ -35,15 +34,14 @@ export const Favorite = (props: any) => {
35
34
  }
36
35
 
37
36
  return (
38
- <Container
39
- pdng={Platform.OS === 'ios' ? '10px' : '20px'}
40
- >
37
+ <Container>
41
38
  <NavBar
42
39
  title={t('FAVORITE', 'Favorite')}
43
40
  titleAlign={'center'}
44
41
  onActionLeft={goToBack}
45
42
  showCall={false}
46
- paddingTop={10}
43
+ paddingTop={Platform.OS === 'ios' ? 20 : 10}
44
+ style={{ paddingVertical: 0 }}
47
45
  btnStyle={{ paddingLeft: 0 }}
48
46
  />
49
47
  <TabContainer>
@@ -73,7 +71,6 @@ export const Favorite = (props: any) => {
73
71
  originalURL='business'
74
72
  location={`${orderState.options?.address?.location?.lat},${orderState.options?.address?.location?.lng}`}
75
73
  propsToFetch={['id', 'name', 'header', 'logo', 'location', 'address', 'ribbon', 'timezone', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug']}
76
- franchiseId={franchiseId}
77
74
  />
78
75
  )}
79
76
  {tabSelected === 'products' && (
@@ -82,7 +79,6 @@ export const Favorite = (props: any) => {
82
79
  originalURL='products'
83
80
  onNavigationRedirect={onRedirect}
84
81
  isProduct
85
- franchiseId={franchiseId}
86
82
  />
87
83
  )}
88
84
  {tabSelected === 'orders' && (
@@ -91,7 +87,6 @@ export const Favorite = (props: any) => {
91
87
  favoriteURL='favorite_orders'
92
88
  originalURL='orders'
93
89
  isOrder
94
- franchiseId={franchiseId}
95
90
  />
96
91
  )}
97
92
  </Container>
@@ -16,7 +16,5 @@ export const Tab = styled.TouchableOpacity`
16
16
  `
17
17
 
18
18
  export const Container = styled.View`
19
- padding-horizontal: 40px;
20
19
  padding-bottom: 20px;
21
- padding-top: ${(props: any) => props.pdng};
22
20
  `
@@ -5,7 +5,7 @@ export const Container = styled.View`
5
5
  bottom: 0px;
6
6
  left: 0;
7
7
  right: 0;
8
- padding: 12px 40px;
8
+ padding: 12px 20px;
9
9
  flex-direction: row;
10
10
  border-top-width: 1px;
11
11
  border-color: ${(props: any) => props.theme.colors.border};
@@ -12,7 +12,8 @@ export const GPSButton = (props: any) => {
12
12
  handleGPS,
13
13
  apiKey,
14
14
  IconButton,
15
- IconLoadingButton
15
+ IconLoadingButton,
16
+ isIntGeoCoder
16
17
  } = props
17
18
 
18
19
  const [isLoading, setLoading] = useState(false);
@@ -31,7 +32,7 @@ export const GPSButton = (props: any) => {
31
32
  break
32
33
  }
33
34
  }
34
- let data = null
35
+ let data : any
35
36
  const details = {
36
37
  geometry: { location: { lat: pos.latitude, lng: pos.longitude } }
37
38
  }
@@ -60,7 +61,7 @@ export const GPSButton = (props: any) => {
60
61
  if (trackingStatus === 'not-determined') {
61
62
  trackingStatus = await requestTrackingPermission()
62
63
  }
63
- if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
64
+ if ( trackingStatus === 'authorized' || trackingStatus === 'denied' || trackingStatus === 'unavailable') {
64
65
  setLoading(true)
65
66
  Geolocation.getCurrentPosition((pos) => {
66
67
  geoCodePosition(pos.coords)
@@ -68,14 +69,15 @@ export const GPSButton = (props: any) => {
68
69
  setLoading(false);
69
70
  console.log(`ERROR(${err.code}): ${err.message}`)
70
71
  }, {
71
- enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
72
+ enableHighAccuracy: false, timeout: 30000, maximumAge: 1000
72
73
  })
73
74
  }
74
75
  }
75
76
 
76
77
  useEffect(() => {
78
+ if (isIntGeoCoder) return
77
79
  Geocoder.init(apiKey);
78
- }, [])
80
+ }, [isIntGeoCoder])
79
81
 
80
82
  return (
81
83
  <GpsButtonStyle
@@ -56,7 +56,7 @@ export const GiftCardUI = React.memo((props: any) => {
56
56
  <View style={style.actionWrapper}>
57
57
  <OButton
58
58
  onClick={() => setOpenModal('purchase')}
59
- text={t('PURCHASE_GIFT_CARD', 'Purchase gift card')}
59
+ text={t('PURCHASE', 'Purchase')}
60
60
  bgColor={theme.colors.primary}
61
61
  borderColor={theme.colors.primary}
62
62
  textStyle={{ color: 'white', fontSize: 13 }}
@@ -66,7 +66,7 @@ export const GiftCardUI = React.memo((props: any) => {
66
66
 
67
67
  <OButton
68
68
  onClick={() => setOpenModal('redeem')}
69
- text={t('REDEEM_GIFT_CARD', 'Redeem gift card')}
69
+ text={t('REDEEM', 'Redeem')}
70
70
  bgColor={theme.colors.lightPrimary}
71
71
  borderColor={theme.colors.lightPrimary}
72
72
  textStyle={{ color: theme.colors.primary, fontSize: 13 }}
@@ -79,13 +79,18 @@ export const GiftCardUI = React.memo((props: any) => {
79
79
  open={openModal === 'purchase'}
80
80
  onClose={() => setOpenModal(null)}
81
81
  entireModal
82
+ customClose
82
83
  >
83
- <PurchaseGiftCard handleCustomGoToCheckout={handleCustomGoToCheckout} />
84
+ <PurchaseGiftCard
85
+ handleCustomGoToCheckout={handleCustomGoToCheckout}
86
+ onClose={() => setOpenModal(null)}
87
+ />
84
88
  </OModal>
85
89
  <OModal
86
90
  open={openModal === 'redeem'}
87
91
  onClose={() => setOpenModal(null)}
88
92
  entireModal
93
+ customClose
89
94
  >
90
95
  <RedeemGiftCard
91
96
  onClose={() => setOpenModal(null)}
@@ -3,10 +3,11 @@ import {
3
3
  useLanguage,
4
4
  PurchaseGiftCard as PurchaseGiftCardController
5
5
  } from 'ordering-components/native'
6
- import { StyleSheet, View, TouchableOpacity } from 'react-native'
6
+ import { StyleSheet, View, TouchableOpacity, ScrollView, Platform } from 'react-native'
7
7
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
8
8
  import { useTheme } from 'styled-components/native';
9
9
  import { OText, OButton, OIcon } from '../../shared';
10
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
10
11
 
11
12
  import {
12
13
  Container
@@ -17,7 +18,8 @@ const PurchaseGiftCardUI = (props: any) => {
17
18
  productsListState,
18
19
  selectedProduct,
19
20
  setSelectedProduct,
20
- handleAccept
21
+ handleAccept,
22
+ onClose
21
23
  } = props
22
24
 
23
25
  const theme = useTheme()
@@ -42,9 +44,44 @@ const PurchaseGiftCardUI = (props: any) => {
42
44
 
43
45
  return (
44
46
  <Container>
45
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
47
+ <View style={{
48
+ marginBottom: 40,
49
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
50
+ display: 'flex',
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ }}>
54
+ <OButton
55
+ imgLeftStyle={{ width: 18 }}
56
+ imgRightSrc={null}
57
+ style={{
58
+ borderWidth: 0,
59
+ width: 26,
60
+ height: 26,
61
+ backgroundColor: '#FFF',
62
+ borderColor: '#FFF',
63
+ shadowColor: '#FFF',
64
+ paddingLeft: 0,
65
+ paddingRight: 0,
66
+ }}
67
+ onClick={onClose}
68
+ icon={AntDesignIcon}
69
+ iconProps={{
70
+ name: 'arrowleft',
71
+ size: 26,
72
+ style: {
73
+ color: theme.colors.textNormal
74
+ }
75
+ }}
76
+ />
77
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
78
+ </View>
46
79
  <OText color={theme.colors.textNormal} size={14}>{t('SELECT_ONE_OPTION', 'Select one option')}</OText>
47
- <View>
80
+ <ScrollView
81
+ contentContainerStyle={{
82
+ flexGrow: 1
83
+ }}
84
+ >
48
85
  {productsListState.loading && (
49
86
  [...Array(5).keys()].map(i => (
50
87
  <View key={i} style={style.itemStyle}>
@@ -72,7 +109,7 @@ const PurchaseGiftCardUI = (props: any) => {
72
109
  <OText color={theme.colors.textNormal} size={14}>{product.name}</OText>
73
110
  </TouchableOpacity>
74
111
  ))}
75
- </View>
112
+ </ScrollView>
76
113
  <OButton
77
114
  onClick={() => handleAccept()}
78
115
  text={t('ACCEPT', 'Accept')}
@@ -2,5 +2,7 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding-horizontal: 40px;
5
+ padding-horizontal: 20px;
6
+ flex: 1;
7
+ padding-bottom: 30px;
6
8
  `
@@ -1,11 +1,12 @@
1
- import React, { useEffect } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import {
3
3
  useLanguage, useUtils, RedeemGiftCard as RedeemGiftCardController
4
4
  } from 'ordering-components/native'
5
5
  import { useForm, Controller } from 'react-hook-form'
6
- import { StyleSheet, View, Alert } from 'react-native';
6
+ import { StyleSheet, View, Alert, Platform } from 'react-native';
7
7
  import { useTheme } from 'styled-components/native';
8
8
  import { OText, OButton, OInput } from '../../shared';
9
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
10
 
10
11
  import {
11
12
  Container,
@@ -26,6 +27,8 @@ const RedeemGiftCardUI = (props: any) => {
26
27
  const { handleSubmit, control, errors } = useForm()
27
28
  const [{ parsePrice }] = useUtils()
28
29
 
30
+ const [codeValue, setCodeValue] = useState('')
31
+
29
32
  const style = StyleSheet.create({
30
33
  btnStyle: {
31
34
  borderRadius: 7.6,
@@ -43,6 +46,14 @@ const RedeemGiftCardUI = (props: any) => {
43
46
  handleApply(values)
44
47
  }
45
48
 
49
+ const handleChangeCode = (string: any) => {
50
+ string = string.replace(/-/g, '')
51
+ if (!string) return
52
+ const codeSlices = string.match(/.{1,4}/g)
53
+ string = codeSlices.join('-')
54
+ setCodeValue(string)
55
+ }
56
+
46
57
  useEffect(() => {
47
58
  if (Object.keys(errors).length > 0) {
48
59
  const list = Object.values(errors)
@@ -83,17 +94,51 @@ const RedeemGiftCardUI = (props: any) => {
83
94
  <Container>
84
95
  {!redeemedGiftCard ? (
85
96
  <View>
86
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
97
+ <View style={{
98
+ marginBottom: 40,
99
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
100
+ display: 'flex',
101
+ flexDirection: 'row',
102
+ alignItems: 'center',
103
+ }}>
104
+ <OButton
105
+ imgLeftStyle={{ width: 18 }}
106
+ imgRightSrc={null}
107
+ style={{
108
+ borderWidth: 0,
109
+ width: 26,
110
+ height: 26,
111
+ backgroundColor: '#FFF',
112
+ borderColor: '#FFF',
113
+ shadowColor: '#FFF',
114
+ paddingLeft: 0,
115
+ paddingRight: 0,
116
+ }}
117
+ onClick={onClose}
118
+ icon={AntDesignIcon}
119
+ iconProps={{
120
+ name: 'arrowleft',
121
+ size: 26,
122
+ style: {
123
+ color: theme.colors.textNormal
124
+ }
125
+ }}
126
+ />
127
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
128
+ </View>
87
129
  <FormController>
88
130
  <OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('GIFT_CARD_CODE', 'Gift card code')}</OText>
89
131
  <Controller
90
132
  control={control}
91
133
  render={({ onChange, value }: any) => (
92
134
  <OInput
93
- placeholder='0000 0000'
94
- value={value}
95
- onChange={(val: any) => onChange(val)}
96
- autoCapitalize='none'
135
+ placeholder='XXXX-XXXX-XXXX-XXXX'
136
+ value={codeValue}
137
+ onChange={(val: any) => {
138
+ onChange(val)
139
+ handleChangeCode(val)
140
+ }}
141
+ autoCapitalize='characters'
97
142
  autoCorrect={false}
98
143
  blurOnSubmit={false}
99
144
  style={style.inputStyle}
@@ -143,7 +188,38 @@ const RedeemGiftCardUI = (props: any) => {
143
188
  </View>
144
189
  ) : (
145
190
  <>
146
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('GIFT_CARD', 'Gift card')}</OText>
191
+ <View style={{
192
+ marginBottom: 40,
193
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
194
+ display: 'flex',
195
+ flexDirection: 'row',
196
+ alignItems: 'center',
197
+ }}>
198
+ <OButton
199
+ imgLeftStyle={{ width: 18 }}
200
+ imgRightSrc={null}
201
+ style={{
202
+ borderWidth: 0,
203
+ width: 26,
204
+ height: 26,
205
+ backgroundColor: '#FFF',
206
+ borderColor: '#FFF',
207
+ shadowColor: '#FFF',
208
+ paddingLeft: 0,
209
+ paddingRight: 0,
210
+ }}
211
+ onClick={onClose}
212
+ icon={AntDesignIcon}
213
+ iconProps={{
214
+ name: 'arrowleft',
215
+ size: 26,
216
+ style: {
217
+ color: theme.colors.textNormal
218
+ }
219
+ }}
220
+ />
221
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
222
+ </View>
147
223
  <View>
148
224
  <OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</OText>
149
225
  <OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('AMOUNT', 'Amount')}: {parsePrice(redeemedGiftCard?.amount)}</OText>
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- padding-horizontal: 40px;
4
+ padding-horizontal: 20px;
5
5
  `
6
6
  export const FormController = styled.View`
7
7
  margin-bottom: 25px;
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- padding-horizontal: 40px;
4
+ padding-horizontal: 20px;
5
5
  margin-bottom: 30px;
6
6
  `
7
7
  export const FormController = styled.View`
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- margin-vertical: 20px;
4
+ margin-bottom: 20px;
5
5
  `
6
6
 
7
7
  export const GoogleButton = styled.TouchableOpacity`