ordering-ui-react-native 0.17.68 → 0.17.69-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 (201) hide show
  1. package/package.json +8 -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 +1 -21
  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 +5 -0
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +270 -245
  15. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  16. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  17. package/themes/business/src/components/Chat/index.tsx +123 -111
  18. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  19. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  20. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  21. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  22. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  23. package/themes/business/src/components/MapView/index.tsx +10 -10
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  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 +191 -6
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -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/OrdersOption/index.tsx +21 -20
  35. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +6 -7
  36. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +2 -2
  37. package/themes/business/src/components/PreviousOrders/index.tsx +266 -154
  38. package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
  39. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  40. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  41. package/themes/business/src/components/StoresList/index.tsx +3 -4
  42. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  43. package/themes/business/src/components/shared/OLink.tsx +11 -3
  44. package/themes/business/src/components/shared/OModal.tsx +16 -9
  45. package/themes/business/src/components/shared/OText.tsx +6 -1
  46. package/themes/business/src/types/index.tsx +24 -13
  47. package/themes/business/src/utils/index.tsx +29 -2
  48. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  52. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  53. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  54. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  55. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  56. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  57. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +2 -0
  60. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  61. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  62. package/themes/original/src/components/AddressList/index.tsx +27 -22
  63. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  64. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  65. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  66. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  68. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  69. package/themes/original/src/components/BusinessController/index.tsx +80 -66
  70. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  71. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  72. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  73. package/themes/original/src/components/BusinessInformation/index.tsx +139 -85
  74. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  75. package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
  76. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  77. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  78. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  79. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  80. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  81. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  82. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -556
  83. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  84. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  88. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  89. package/themes/original/src/components/Cart/index.tsx +77 -79
  90. package/themes/original/src/components/CartContent/index.tsx +117 -20
  91. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  92. package/themes/original/src/components/Checkout/index.tsx +356 -124
  93. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  94. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  95. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  96. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  97. package/themes/original/src/components/Favorite/index.tsx +8 -9
  98. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  99. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  100. package/themes/original/src/components/FloatingButton/index.tsx +11 -14
  101. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  102. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  103. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  104. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  106. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  107. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  108. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  109. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  110. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  111. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  112. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  113. package/themes/original/src/components/Help/index.tsx +8 -8
  114. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  115. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  116. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  117. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  119. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  120. package/themes/original/src/components/Home/index.tsx +13 -4
  121. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  122. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  123. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  124. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  125. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  126. package/themes/original/src/components/Messages/index.tsx +14 -7
  127. package/themes/original/src/components/MomentOption/index.tsx +195 -90
  128. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  129. package/themes/original/src/components/MultiCart/index.tsx +41 -54
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  131. package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
  132. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +40 -29
  137. package/themes/original/src/components/NavBar/index.tsx +20 -17
  138. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  139. package/themes/original/src/components/Notifications/index.tsx +46 -50
  140. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  141. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  142. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  143. package/themes/original/src/components/OrderDetails/index.tsx +191 -363
  144. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  146. package/themes/original/src/components/OrderProgress/index.tsx +30 -56
  147. package/themes/original/src/components/OrderSummary/index.tsx +88 -59
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  150. package/themes/original/src/components/OrdersOption/index.tsx +68 -87
  151. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  152. package/themes/original/src/components/PageBanner/index.tsx +98 -38
  153. package/themes/original/src/components/PageBanner/styles.tsx +0 -10
  154. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  155. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +78 -35
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  159. package/themes/original/src/components/ProductForm/index.tsx +105 -30
  160. package/themes/original/src/components/ProductForm/styles.tsx +5 -5
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -11
  162. package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
  163. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
  164. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  165. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  166. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  167. package/themes/original/src/components/Promotions/index.tsx +5 -4
  168. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  169. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  170. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  171. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  172. package/themes/original/src/components/Sessions/index.tsx +11 -8
  173. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  174. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +101 -62
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  177. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  180. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  184. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  185. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  186. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  187. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  188. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  189. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  190. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  191. package/themes/original/src/components/UserVerification/index.tsx +52 -49
  192. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  193. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  194. package/themes/original/src/components/Wallets/index.tsx +66 -30
  195. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  196. package/themes/original/src/components/shared/OButton.tsx +6 -2
  197. package/themes/original/src/components/shared/OInput.tsx +6 -1
  198. package/themes/original/src/components/shared/OModal.tsx +3 -3
  199. package/themes/original/src/types/index.tsx +41 -11
  200. package/themes/original/src/utils/index.tsx +273 -1
  201. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -154,6 +154,11 @@ export const transformCountryCode = (countryCode : number) => {
154
154
  return code?.countryCode
155
155
  }
156
156
 
157
+ export const verifyCountryCode = (countryCode : string) => {
158
+ const code = CODES.find((code : any) => code.countryCode === (countryCode || '').toUpperCase())
159
+ return code?.countryCode
160
+ }
161
+
157
162
  /**
158
163
  * Function to check if a number is decimal or not
159
164
  * @param {*} value number to check if decimal or not
@@ -41,6 +41,7 @@ import { MapViewUI as MapView } from './src/components/MapView'
41
41
  import { NewOrderNotification } from './src/components/NewOrderNotification';
42
42
  import { DriverSchedule } from './src/components/DriverSchedule';
43
43
  import { ScheduleBlocked } from './src/components/ScheduleBlocked';
44
+ import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
44
45
  //OComponents
45
46
  import {
46
47
  OText,
@@ -110,6 +111,7 @@ export {
110
111
  VerifyPhone,
111
112
  DriverSchedule,
112
113
  ScheduleBlocked,
114
+ OrderDetailsLogistic,
113
115
  //OComponents
114
116
  OAlert,
115
117
  OButton,
@@ -7,23 +7,22 @@ import {
7
7
  View,
8
8
  KeyboardAvoidingView,
9
9
  TextInput,
10
- StyleSheet
10
+ StyleSheet,
11
+ TouchableOpacity
11
12
  } from 'react-native';
12
13
  import { useTheme } from 'styled-components/native';
13
14
  import SelectDropdown from 'react-native-select-dropdown'
14
- import { useLanguage, useSession } from 'ordering-components/native';
15
- import { Content, Timer, TimeField, Header, Action, Comments, CommentsButtonGroup } from './styles';
16
- import { FloatingButton } from '../FloatingButton';
17
- import { OText, OButton, OTextarea, OIconButton } from '../shared';
15
+ import { useLanguage } from 'ordering-components/native';
16
+ import { Content, Timer, TimeField, Header, Comments, CommentsButtonGroup, TopActions } from './styles';
17
+ import { OText, OButton, OTextarea, OIcon } from '../shared';
18
18
  import { AcceptOrRejectOrderParams } from '../../types';
19
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
20
19
 
21
20
  import { orderCommentList } from '../../../../../src/utils'
22
21
 
23
22
  export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
24
23
  const {
24
+ isPage,
25
25
  customerCellphone,
26
- loading,
27
26
  action,
28
27
  handleUpdateOrder,
29
28
  actions,
@@ -35,7 +34,6 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
35
34
  } = props;
36
35
 
37
36
  const [, t] = useLanguage();
38
- const [{ user }] = useSession();
39
37
  const theme = useTheme();
40
38
  const scrollViewRef = useRef<any>(null);
41
39
  const viewRef = useRef<any>(null);
@@ -46,11 +44,9 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
46
44
  const [time, setTime] = useState('');
47
45
  const [comments, setComments] = useState('');
48
46
  const [rejectReason, setRejectReason] = useState(null);
49
- const [isKeyboardShow, setIsKeyboardShow] = useState(false);
50
- const { top, bottom } = useSafeAreaInsets()
47
+ const [keyboardState, setKeyboardState] = useState({ show: false, height: 0 });
51
48
 
52
49
  const isDriverApp = appTitle?.key === 'DELIVERY_APP'
53
-
54
50
  const orderCommentsList = orderCommentList(action)
55
51
 
56
52
  let codeNumberPhone, numberPhone, numberToShow;
@@ -93,6 +89,39 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
93
89
  alignItems: 'center',
94
90
  paddingHorizontal: 10
95
91
  },
92
+ parent: {
93
+ flex: 1,
94
+ backgroundColor: theme.colors.backgroundPage,
95
+ },
96
+ upper: {
97
+ flex: 1,
98
+ zIndex: 1001,
99
+ paddingTop: isPage ? 30 : 40,
100
+ marginBottom: 10,
101
+ backgroundColor: theme.colors.backgroundPage
102
+ },
103
+ bottomParent: {
104
+ justifyContent: "center",
105
+ paddingHorizontal: 30,
106
+ alignItems: "center",
107
+ width: '100%',
108
+ height: 45,
109
+ },
110
+ bottom: {
111
+ textAlignVertical: "center",
112
+ textAlign: "center",
113
+ },
114
+ btnBackArrow: {
115
+ borderWidth: 0,
116
+ width: 32,
117
+ height: 32,
118
+ tintColor: theme.colors.textGray,
119
+ backgroundColor: theme.colors.clear,
120
+ borderColor: theme.colors.clear,
121
+ shadowColor: theme.colors.clear,
122
+ paddingLeft: 0,
123
+ paddingRight: 0
124
+ },
96
125
  })
97
126
 
98
127
  const handleFocus = () => {
@@ -101,25 +130,6 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
101
130
  });
102
131
  };
103
132
 
104
- useEffect(() => {
105
- const keyboardDidShowListener = Keyboard.addListener(
106
- 'keyboardDidShow',
107
- () => {
108
- setIsKeyboardShow(true);
109
- },
110
- );
111
- const keyboardDidHideListener = Keyboard.addListener(
112
- 'keyboardDidHide',
113
- () => {
114
- setIsKeyboardShow(false);
115
- },
116
- );
117
- return () => {
118
- keyboardDidShowListener.remove();
119
- keyboardDidHideListener.remove();
120
- };
121
- }, []);
122
-
123
133
  if (!notShowCustomerPhone) {
124
134
  if (phoneNumber) {
125
135
  codeNumberPhone = phoneNumber.slice(0, 3);
@@ -172,15 +182,15 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
172
182
  };
173
183
 
174
184
  const openTimerIOnput = () => {
175
- const isFocus = timerRef.current.isFocused();
185
+ const isFocus = timerRef.current?.isFocused();
176
186
  if (isFocus) {
177
- timerRef.current.blur();
187
+ timerRef.current?.blur();
178
188
  }
179
189
 
180
190
  };
181
191
 
182
192
  const openTextTareaOInput = () => {
183
- const isFocus = textTareaRef.current.isFocused();
193
+ const isFocus = textTareaRef.current?.isFocused();
184
194
  if (isFocus && textTareaRef?.current) {
185
195
  textTareaRef.current.blur();
186
196
  }
@@ -205,7 +215,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
205
215
  status: 7,
206
216
  },
207
217
  rejectByBusiness: {
208
- comment: comments,
218
+ reasons: comments,
209
219
  status: 5,
210
220
  },
211
221
  acceptByDriver: {
@@ -213,22 +223,22 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
213
223
  status: 8,
214
224
  },
215
225
  rejectByDriver: {
216
- comment: comments,
226
+ reasons: comments,
217
227
  status: 6,
218
228
  reject_reason: rejectReason
219
229
  },
220
230
  pickupFailedByDriver: {
221
- comment: comments,
231
+ reasons: comments,
222
232
  status: 10,
223
233
  reject_reason: rejectReason
224
234
  },
225
235
  deliveryFailedByDriver: {
226
- comment: comments,
236
+ reasons: comments,
227
237
  status: 12,
228
238
  reject_reason: rejectReason
229
239
  },
230
240
  orderNotReady: {
231
- comment: comments,
241
+ reasons: comments,
232
242
  status: 14,
233
243
  reject_reason: rejectReason
234
244
  },
@@ -281,227 +291,242 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
281
291
  }
282
292
  }, [timerRef?.current])
283
293
 
294
+ useEffect(() => {
295
+ const keyboardDidShowListener =
296
+ Keyboard.addListener('keyboardDidShow', (e) => setKeyboardState({
297
+ show: true,
298
+ height: e.endCoordinates.height > 100
299
+ ? Platform.OS == 'ios' ? e.endCoordinates.height : 0 : 0
300
+ }))
301
+ const keyboardDidHideListener =
302
+ Keyboard.addListener('keyboardDidHide', () => setKeyboardState({ show: false, height: 0 }))
303
+ return () => {
304
+ keyboardDidShowListener.remove()
305
+ keyboardDidHideListener.remove()
306
+ }
307
+ }, [])
308
+
284
309
  return (
285
- <KeyboardAvoidingView
286
- enabled
287
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
288
- style={{ flex: 1, paddingHorizontal: 30, paddingVertical: 30, marginTop: top, marginBottom: bottom, justifyContent: 'space-between' }}>
289
- <View>
290
- <OIconButton
291
- icon={theme.images.general.arrow_left}
292
- borderColor={theme.colors.clear}
293
- iconStyle={{ width: 20, height: 20 }}
294
- style={{
295
- maxWidth: 40,
296
- height: 35,
297
- justifyContent: 'flex-end',
298
- marginBottom: 30,
299
- }}
300
- onClick={() => handleArrowBack()}
301
- />
302
- <OText
303
- size={20}
304
- color={theme.colors.textGray}
305
- style={{
306
- fontFamily: 'Poppins',
307
- fontStyle: 'normal',
308
- }}
309
- weight="600">
310
- {titleOrder}
311
- </OText>
312
- </View>
313
- <Content showsVerticalScrollIndicator={false} ref={scrollViewRef}>
314
- <Header>
315
- {action === 'reject' && (
316
- <>
317
- {!notShowCustomerPhone && (
310
+ <KeyboardAvoidingView style={{ flex: 1 }}>
311
+ <View style={styles.parent}>
312
+ <View style={styles.upper}>
313
+ <TopActions>
314
+ <TouchableOpacity onPress={() => handleArrowBack()} style={styles.btnBackArrow}>
315
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
316
+ </TouchableOpacity>
317
+ <OText
318
+ size={20}
319
+ color={theme.colors.textGray}
320
+ style={{
321
+ fontFamily: 'Poppins',
322
+ fontStyle: 'normal',
323
+ marginBottom: 10,
324
+ }}
325
+ weight="600">
326
+ {titleOrder}
327
+ </OText>
328
+ </TopActions>
329
+ <Content showsVerticalScrollIndicator={false} ref={scrollViewRef}>
330
+ <Header>
331
+ {action === 'reject' && (
318
332
  <>
333
+ {!notShowCustomerPhone && (
334
+ <>
335
+ <OText
336
+ size={15}
337
+ color={theme.colors.textGray}
338
+ style={{ marginTop: 10 }}>
339
+ {t(
340
+ 'CALL_YOUR_CUSTOMER_TO_RESOLVE_THE_ISSUE_AS_POLITELY_AS_POSSIBLE',
341
+ 'Call your customer to resolve the issue as politely as possible',
342
+ )}
343
+ </OText>
344
+
345
+ {!!numberToShow ? (
346
+ <OButton
347
+ bgColor="transparent"
348
+ borderColor={theme.colors.primary}
349
+ textStyle={{
350
+ color: theme.colors.primary,
351
+ fontSize: 20,
352
+ }}
353
+ style={{
354
+ borderRadius: 10,
355
+ marginVertical: 20,
356
+ }}
357
+ imgLeftStyle={{
358
+ resizeMode: 'contain',
359
+ left: 20,
360
+ position: 'absolute',
361
+ }}
362
+ imgLeftSrc={theme.images.general.cellphone}
363
+ text={numberToShow}
364
+ onClick={() =>
365
+ Linking.openURL(`tel:${customerCellphone}`)
366
+ }
367
+ />
368
+ ) : (
369
+ <OButton
370
+ bgColor="transparent"
371
+ borderColor={theme.colors.primary}
372
+ textStyle={{
373
+ color: theme.colors.primary,
374
+ fontSize: 15,
375
+ }}
376
+ style={{
377
+ borderRadius: 10,
378
+ marginVertical: 20,
379
+ }}
380
+ imgLeftStyle={{
381
+ resizeMode: 'contain',
382
+ left: 20,
383
+ position: 'absolute',
384
+ }}
385
+ isDisabled={true}
386
+ imgLeftSrc={theme.images.general.cellphone}
387
+ text={t('NOT_NUMBER', "There's not phonenumber.")}
388
+ onClick={() =>
389
+ Linking.openURL(`tel:${customerCellphone}`)
390
+ }
391
+ />
392
+ )}
393
+ </>
394
+ )}
395
+
319
396
  <OText
320
397
  size={15}
321
398
  color={theme.colors.textGray}
322
- style={{ marginTop: 10 }}>
399
+ style={{ marginBottom: 10 }}>
323
400
  {t(
324
- 'CALL_YOUR_CUSTOMER_TO_RESOLVE_THE_ISSUE_AS_POLITELY_AS_POSSIBLE',
325
- 'Call your customer to resolve the issue as politely as possible',
401
+ 'MARK_THE_ORDER_AS_REJECTED',
402
+ 'Mark the order as rejected',
326
403
  )}
327
404
  </OText>
328
405
 
329
- {numberToShow ? (
330
- <OButton
331
- bgColor="transparent"
332
- borderColor={theme.colors.primary}
333
- textStyle={{
334
- color: theme.colors.primary,
335
- fontSize: 20,
336
- }}
337
- style={{
338
- borderRadius: 10,
339
- marginVertical: 20,
340
- }}
341
- imgLeftStyle={{
342
- resizeMode: 'contain',
343
- left: 20,
344
- position: 'absolute',
345
- }}
346
- imgLeftSrc={theme.images.general.cellphone}
347
- text={numberToShow}
348
- onClick={() =>
349
- Linking.openURL(`tel:${customerCellphone}`)
350
- }
351
- />
352
- ) : (
353
- <OButton
354
- bgColor="transparent"
355
- borderColor={theme.colors.primary}
356
- textStyle={{
357
- color: theme.colors.primary,
358
- fontSize: 15,
359
- }}
360
- style={{
361
- borderRadius: 10,
362
- marginVertical: 20,
363
- }}
364
- imgLeftStyle={{
365
- resizeMode: 'contain',
366
- left: 20,
367
- position: 'absolute',
368
- }}
369
- isDisabled={true}
370
- imgLeftSrc={theme.images.general.cellphone}
371
- text={t('NOT_NUMBER', "There's not phonenumber.")}
372
- onClick={() =>
373
- Linking.openURL(`tel:${customerCellphone}`)
374
- }
375
- />
376
- )}
406
+ <OText>
407
+ <OText style={{ fontWeight: '600' }}>
408
+ {t('NOTE', 'Note')}
409
+ {': '}
410
+ </OText>
411
+
412
+ <OText size={15} color={theme.colors.textGray}>
413
+ {t(
414
+ 'YOUR_CUSTOMER_WILL_RECEIVE_A_NOTIFICATION_ABOUT_THIS_ACTIONS',
415
+ 'Your customer will receive a notification about this actions',
416
+ )}
417
+ </OText>
418
+ </OText>
377
419
  </>
378
420
  )}
421
+ </Header>
379
422
 
380
- <OText
381
- size={15}
382
- color={theme.colors.textGray}
383
- style={{ marginBottom: 10 }}>
384
- {t(
385
- 'MARK_THE_ORDER_AS_REJECTED',
386
- 'Mark the order as rejected',
387
- )}
388
- </OText>
389
-
390
- <OText>
391
- <OText style={{ fontWeight: '600' }}>
392
- {t('NOTE', 'Note')}
393
- {': '}
394
- </OText>
395
-
396
- <OText size={15} color={theme.colors.textGray}>
397
- {t(
398
- 'YOUR_CUSTOMER_WILL_RECEIVE_A_NOTIFICATION_ABOUT_THIS_ACTIONS',
399
- 'Your customer will receive a notification about this actions',
400
- )}
401
- </OText>
402
- </OText>
403
- </>
404
- )}
405
- </Header>
406
-
407
- {action === 'accept' && (
408
- <View style={{ height: 400, justifyContent: 'center' }}>
409
- <Timer onPress={() => openTimerIOnput()}>
410
- <OText weight="600" style={{ textAlign: 'center' }} size={55}>
411
- {hour}
412
- </OText>
413
- {hour.length > 0 && <OText size={55}>:</OText>}
414
- <OText weight="600" style={{ textAlign: 'center' }} size={55}>
415
- {min}
416
- </OText>
417
- </Timer>
418
- </View>
419
- )}
420
- <TimeField
421
- ref={timerRef}
422
- keyboardType="numeric"
423
- value={time}
424
- placeholder={'00:00'}
425
- onChangeText={handleTime}
426
- onPressOut={() => handleFixTime()}
427
- editable={true}
428
- selectionColor={theme.colors.primary}
429
- placeholderTextColor={theme.colors.textGray}
430
- color={theme.colors.textGray}
431
- onEndEditing={handleFixTime}
432
- onSubmitEditing={() => handleAcceptOrReject()}
433
- onBlur={() => actions && action === 'accept' && timerRef?.current?.focus?.()}
434
- />
435
-
436
- {orderCommentsList && isDriverApp && (
437
- <CommentsButtonGroup>
438
- <SelectDropdown
439
- defaultButtonText={t('REJECT_REASONS_OPTIONS', 'Reject reasons')}
440
- data={orderCommentsList?.list}
441
- onSelect={(selectedItem) => {
442
- setRejectReason(selectedItem?.value)
443
- }}
444
- buttonTextAfterSelection={(selectedItem) => selectedItem.content}
445
- rowTextForSelection={(item) => item.key}
446
- buttonStyle={styles.selectOption}
447
- buttonTextStyle={styles.buttonTextStyle}
448
- renderDropdownIcon={isOpened => {
449
- return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
450
- }}
451
- dropdownStyle={styles.dropdownStyle}
452
- dropdownOverlayColor='transparent'
453
- rowStyle={styles.rowStyle}
454
- renderCustomizedRowChild={(item) => {
455
- return (
456
- <View
457
- style={{
458
- flexDirection: 'row',
459
- alignItems: 'center'
460
- }}
461
- >
462
- <View>
463
- <OText
464
- size={14}
465
- color={'#748194'}
466
- style={{ textTransform: 'capitalize' }}
467
- >
468
- {item?.content}
469
- </OText>
470
- </View>
471
- </View>
472
- );
473
- }}
474
- />
475
- </CommentsButtonGroup>
476
- )}
477
-
478
- {showTextArea && (
479
- <Comments ref={viewRef}>
480
- <OTextarea
481
- textTareaRef={textTareaRef}
482
- autoFocus
483
- onFocus={handleFocus}
484
- placeholder={t(
485
- 'PLEASE_TYPE_YOUR_COMMENTS_IN_HERE',
486
- 'Please type your comments in here',
487
- )}
488
- value={comments}
489
- onChange={setComments}
423
+ {action === 'accept' && (
424
+ <View style={{ height: 300, justifyContent: 'center' }}>
425
+ <Timer onPress={() => openTimerIOnput()}>
426
+ <OText weight="600" style={{ textAlign: 'center' }} size={55}>
427
+ {hour}
428
+ </OText>
429
+ {hour.length > 0 && <OText size={55}>:</OText>}
430
+ <OText weight="600" style={{ textAlign: 'center' }} size={55}>
431
+ {min}
432
+ </OText>
433
+ </Timer>
434
+ </View>
435
+ )}
436
+ <TimeField
437
+ ref={timerRef}
438
+ keyboardType="numeric"
439
+ value={time}
440
+ placeholder={'00:00'}
441
+ onChangeText={handleTime}
442
+ onPressOut={() => handleFixTime()}
443
+ editable={true}
444
+ selectionColor={theme.colors.primary}
445
+ placeholderTextColor={theme.colors.textGray}
446
+ color={theme.colors.textGray}
447
+ onEndEditing={handleFixTime}
448
+ onSubmitEditing={() => handleAcceptOrReject()}
449
+ onBlur={() => actions && action === 'accept' && timerRef?.current?.focus?.()}
490
450
  />
491
- </Comments>
492
- )}
493
- </Content>
494
-
495
- <Action>
496
- <FloatingButton
497
- firstButtonClick={() => {
498
- handleAcceptOrReject();
451
+
452
+ {orderCommentsList && isDriverApp && (
453
+ <CommentsButtonGroup>
454
+ <SelectDropdown
455
+ defaultButtonText={t('REJECT_REASONS_OPTIONS', 'Reject reasons')}
456
+ data={orderCommentsList?.list}
457
+ onSelect={(selectedItem) => {
458
+ setRejectReason(selectedItem?.value)
459
+ }}
460
+ buttonTextAfterSelection={(selectedItem) => selectedItem.content}
461
+ rowTextForSelection={(item) => item.key}
462
+ buttonStyle={styles.selectOption}
463
+ buttonTextStyle={styles.buttonTextStyle}
464
+ renderDropdownIcon={isOpened => {
465
+ return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
466
+ }}
467
+ dropdownStyle={styles.dropdownStyle}
468
+ dropdownOverlayColor='transparent'
469
+ rowStyle={styles.rowStyle}
470
+ renderCustomizedRowChild={(item) => {
471
+ return (
472
+ <View
473
+ style={{
474
+ flexDirection: 'row',
475
+ alignItems: 'center'
476
+ }}
477
+ >
478
+ <View>
479
+ <OText
480
+ size={14}
481
+ color={'#748194'}
482
+ style={{ textTransform: 'capitalize' }}
483
+ >
484
+ {item?.content}
485
+ </OText>
486
+ </View>
487
+ </View>
488
+ );
489
+ }}
490
+ />
491
+ </CommentsButtonGroup>
492
+ )}
493
+
494
+ {showTextArea && (
495
+ <Comments ref={viewRef}>
496
+ <OTextarea
497
+ textTareaRef={textTareaRef}
498
+ autoFocus
499
+ onFocus={handleFocus}
500
+ placeholder={t(
501
+ 'PLEASE_TYPE_YOUR_COMMENTS_IN_HERE',
502
+ 'Please type your comments in here',
503
+ )}
504
+ value={comments}
505
+ onChange={setComments}
506
+ />
507
+ </Comments>
508
+ )}
509
+ </Content>
510
+ </View>
511
+ <View
512
+ style={{
513
+ ...styles.bottomParent,
514
+ marginBottom: (keyboardState.height === 0) ? isPage ? 0 : 30 : keyboardState.height - (isPage ? 20 : -10)
499
515
  }}
500
- btnText={buttonText}
501
- color={action === 'accept' ? theme.colors.green : theme.colors.red}
502
- widthButton={'100%'}
503
- />
504
- </Action>
516
+ >
517
+ <OButton
518
+ text={buttonText}
519
+ bgColor={action === 'accept' ? theme.colors.green : theme.colors.red}
520
+ borderColor={action === 'accept' ? theme.colors.green : theme.colors.red}
521
+ imgRightSrc={null}
522
+ style={{ borderRadius: 7, height: 45 }}
523
+ parentStyle={{ width: '100%' }}
524
+ textStyle={{ color: '#FFF', fontSize: 18 }}
525
+ isDisabled={showTextArea && !comments}
526
+ onClick={() => handleAcceptOrReject()}
527
+ />
528
+ </View>
529
+ </View>
505
530
  </KeyboardAvoidingView>
506
531
  );
507
532
  };
@@ -1,10 +1,14 @@
1
1
  import styled from 'styled-components/native';
2
2
 
3
3
  export const Content = styled.ScrollView`
4
- background-color: ${(props: any) => props.theme.colors.white};
5
- margin-bottom: 30px;
4
+ padding-horizontal: 30px;
6
5
  `;
7
6
 
7
+ export const TopActions = styled.View`
8
+ padding-horizontal: 30px;
9
+ padding-bottom: 10px;
10
+ `
11
+
8
12
  export const Timer = styled.TouchableOpacity`
9
13
  padding: 40px;
10
14
  justify-content: center;
@@ -29,8 +33,6 @@ export const TimeField = styled.TextInput`
29
33
 
30
34
  export const Header = styled.View``;
31
35
 
32
- export const Action = styled.View``;
33
-
34
36
  export const Comments = styled.View`
35
37
  margin-top: 20px;
36
38
  padding-bottom: 40px;
@@ -97,7 +97,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
97
97
  <Logo style={styles.logo}>
98
98
  <OIcon
99
99
  url={optimizeImage(business?.logo, 'h_300,c_limit')}
100
- src={!business?.logo && theme?.images?.dummies?.businessLogo}
101
100
  style={styles.icon}
102
101
  />
103
102
  </Logo>