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