ordering-ui-react-native 0.16.85 → 0.16.86-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 (215) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +8 -8
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/LanguageSelector/index.tsx +21 -16
  9. package/src/components/Messages/index.tsx +2 -2
  10. package/src/components/OrderCreating/index.tsx +1 -21
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  13. package/src/components/SingleProductReview/index.tsx +7 -4
  14. package/src/components/VerifyPhone/styles.tsx +1 -2
  15. package/src/components/shared/OToast.tsx +4 -4
  16. package/src/utils/index.tsx +2 -1
  17. package/themes/business/index.tsx +2 -0
  18. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  19. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  20. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  21. package/themes/business/src/components/Chat/index.tsx +31 -31
  22. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  23. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  24. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  25. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  26. package/themes/business/src/components/LoginForm/index.tsx +236 -80
  27. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  28. package/themes/business/src/components/MapView/index.tsx +19 -8
  29. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  30. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  31. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  32. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  34. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  35. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  36. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  37. package/themes/business/src/components/OrdersOption/index.tsx +79 -87
  38. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  39. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  42. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  45. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  46. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  47. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  48. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  49. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  50. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  51. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  52. package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
  53. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  54. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  55. package/themes/business/src/components/shared/OLink.tsx +33 -13
  56. package/themes/business/src/components/shared/OModal.tsx +16 -9
  57. package/themes/business/src/components/shared/OText.tsx +8 -2
  58. package/themes/business/src/types/index.tsx +35 -3
  59. package/themes/business/src/utils/index.tsx +53 -0
  60. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  62. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  64. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  65. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  66. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  67. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  68. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  69. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  70. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  71. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  72. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  73. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  74. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  75. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  76. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  77. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  78. package/themes/kiosk/src/types/index.d.ts +13 -0
  79. package/themes/kiosk/src/utils/index.tsx +15 -0
  80. package/themes/original/index.tsx +8 -0
  81. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  82. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  83. package/themes/original/src/components/AddressList/index.tsx +18 -18
  84. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  85. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  86. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  87. package/themes/original/src/components/BusinessController/index.tsx +100 -47
  88. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  89. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  90. package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -3
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -34
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
  93. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  94. package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
  95. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  98. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  102. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  103. package/themes/original/src/components/Cart/index.tsx +83 -42
  104. package/themes/original/src/components/CartContent/index.tsx +77 -15
  105. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  106. package/themes/original/src/components/Checkout/index.tsx +75 -86
  107. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  108. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  109. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  110. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  111. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  112. package/themes/original/src/components/Favorite/index.tsx +7 -4
  113. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  114. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  115. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  116. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  117. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  118. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  119. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  120. package/themes/original/src/components/Help/index.tsx +8 -8
  121. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  122. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  123. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  124. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  125. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  126. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  127. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  128. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  129. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  130. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  131. package/themes/original/src/components/LoginForm/index.tsx +28 -8
  132. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  133. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  134. package/themes/original/src/components/Messages/index.tsx +26 -10
  135. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  136. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  137. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  138. package/themes/original/src/components/MultiCheckout/index.tsx +179 -77
  139. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  140. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  141. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  142. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  143. package/themes/original/src/components/NavBar/index.tsx +6 -11
  144. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  145. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  146. package/themes/original/src/components/Notifications/index.tsx +144 -0
  147. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  148. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  149. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  150. package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
  151. package/themes/original/src/components/OrderProgress/index.tsx +74 -104
  152. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  153. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  157. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  158. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  159. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  160. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  162. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  164. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  165. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  166. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  167. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  168. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  170. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  171. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  172. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  173. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  174. package/themes/original/src/components/Promotions/index.tsx +234 -220
  175. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  176. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  177. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  178. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  179. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  180. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  181. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  182. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  183. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  184. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  185. package/themes/original/src/components/Sessions/index.tsx +11 -8
  186. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  187. package/themes/original/src/components/SignupForm/index.tsx +78 -66
  188. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  189. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  190. package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  192. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  193. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  194. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  195. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  196. package/themes/original/src/components/UpsellingProducts/index.tsx +243 -218
  197. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  198. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  199. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  200. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  201. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  202. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  203. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  204. package/themes/original/src/components/Wallets/index.tsx +96 -93
  205. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  206. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  207. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  208. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +1 -1
  210. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  211. package/themes/original/src/components/shared/OInput.tsx +10 -1
  212. package/themes/original/src/layouts/Container.tsx +13 -9
  213. package/themes/original/src/types/index.tsx +36 -5
  214. package/themes/original/src/utils/index.tsx +321 -58
  215. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -33,8 +33,7 @@ export const NotificationIcon = styled.View`
33
33
  export const AcceptOrRejectOrder = styled.View`
34
34
  flex-direction: row;
35
35
  justify-content: space-between;
36
- flex: 1;
37
- margin: 10px;
36
+ margin: ${(props: any) => props.m ?? 10}px;
38
37
  `
39
38
  export const Timestatus = styled.View`
40
39
  position: relative;;
@@ -42,4 +41,33 @@ export const Timestatus = styled.View`
42
41
  height: 55px;
43
42
  border-radius: 20px;
44
43
  top: 5px;
45
- `
44
+ `
45
+
46
+ export const AccordionSection = styled.View`
47
+ background: #FFF;
48
+ padding-vertical: 10px;
49
+ `
50
+
51
+ export const Accordion = styled.TouchableOpacity`
52
+ flex-direction: column;
53
+ justify-content: space-between;
54
+ align-items: center;
55
+ paddingVertical: 0;
56
+ marginLeft: 3px;
57
+ `
58
+
59
+ export const ContentInfo = styled.View`
60
+ flex-direction: row;
61
+ justify-content: space-between;
62
+ align-items: flex-start;
63
+ overflow: hidden;
64
+ `
65
+
66
+ export const AccordionContent = styled.View`
67
+ overflow: hidden;
68
+ `
69
+
70
+ export const ProductOptionsList = styled.View`
71
+ margin-top: 20px;
72
+ margin-left: 20px;
73
+ `
@@ -1,8 +1,12 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { View, Animated } from 'react-native';
1
+ import React, { useEffect, useState, useCallback } from 'react';
2
+ import { View, Animated, TouchableOpacity } from 'react-native';
3
3
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
4
4
  import { useUtils, useLanguage } from 'ordering-components/native';
5
5
  import { useTheme } from 'styled-components/native';
6
+ import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
7
+
8
+ const { useDeviceOrientation } = DeviceOrientationMethods
9
+
6
10
  import {
7
11
  Accordion,
8
12
  AccordionSection,
@@ -34,8 +38,12 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
34
38
  const [, t] = useLanguage();
35
39
  const theme = useTheme();
36
40
  const [{ parsePrice }] = useUtils();
41
+ const [orientationState] = useDeviceOrientation();
42
+ const WIDTH_SCREEN = orientationState?.dimensions?.width
37
43
 
38
44
  const [isActive, setActiveState] = useState(false);
45
+ const [isReadMore, setIsReadMore] = useState(false);
46
+ const [lengthMore, setLengthMore] = useState(false);
39
47
 
40
48
  const productInfo = () => {
41
49
  if (isCartProduct) {
@@ -108,6 +116,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
108
116
  }
109
117
  }, []);
110
118
 
119
+ const onTextLayout = useCallback((e: any) => {
120
+ setLengthMore((e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2); //to check the text is more than 2 lines or not
121
+ },[]);
122
+
111
123
  return (
112
124
  <AccordionSection>
113
125
  <Accordion
@@ -288,9 +300,21 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
288
300
  color={theme.colors.unselectText}>
289
301
  {t('COMMENT', 'Comment')}
290
302
  </OText>
291
- <OText size={12} mLeft={10} color={theme.colors.unselectText}>
303
+ <OText
304
+ size={12}
305
+ style={{ width: '100%', paddingLeft: 10 }}
306
+ color={theme.colors.unselectText}
307
+ onTextLayout={onTextLayout}
308
+ numberOfLines={isReadMore ? 15 : 2}
309
+ ellipsizeMode="tail"
310
+ >
292
311
  {product.comment}
293
312
  </OText>
313
+ {lengthMore && (
314
+ <TouchableOpacity onPress={() => setIsReadMore(!isReadMore)} style={{ marginLeft: 10 }}>
315
+ <OText size={10} color={theme.colors.statusOrderBlue}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
316
+ </TouchableOpacity>
317
+ )}
294
318
  </ProductComment>
295
319
  )}
296
320
  </AccordionContent>
@@ -1,4 +1,6 @@
1
- import React, { useState, useEffect } from 'react'
1
+
2
+
3
+ import React, { useState, useEffect, useRef } from 'react'
2
4
  import {
3
5
  useLanguage,
4
6
  useUtils,
@@ -10,7 +12,8 @@ import {
10
12
  View,
11
13
  StyleSheet,
12
14
  I18nManager,
13
- TouchableOpacity
15
+ TouchableOpacity,
16
+ Keyboard
14
17
  } from 'react-native'
15
18
  import { useTheme } from 'styled-components/native'
16
19
  import { ReviewCustomerParams } from '../../types'
@@ -38,7 +41,8 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
38
41
  reviewState,
39
42
  setReviewState,
40
43
  actionState,
41
- handleSendCustomerReview
44
+ handleSendCustomerReview,
45
+ handleCustomCustomerReview
42
46
  } = props
43
47
 
44
48
  const theme = useTheme()
@@ -52,12 +56,12 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
52
56
  const { top, bottom } = useSafeAreaInsets()
53
57
  const [comments, setComments] = useState<Array<any>>([])
54
58
  const [extraComment, setExtraComment] = useState('')
55
-
59
+ const scrollref = useRef<any>()
56
60
  const styles = StyleSheet.create({
57
61
  photoWrapper: {
58
62
  shadowColor: theme.colors.black,
59
63
  shadowRadius: 3,
60
- shadowOffset: {width: 1, height: 4},
64
+ shadowOffset: { width: 1, height: 4 },
61
65
  elevation: 3,
62
66
  borderRadius: 8,
63
67
  shadowOpacity: 0.1,
@@ -84,6 +88,18 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
84
88
  marginBottom: 10,
85
89
  backgroundColor: theme.colors.lightGray
86
90
  },
91
+ btnBackArrow: {
92
+ borderWidth: 0,
93
+ width: 32,
94
+ height: 32,
95
+ tintColor: theme.colors.textGray,
96
+ backgroundColor: theme.colors.clear,
97
+ borderColor: theme.colors.clear,
98
+ shadowColor: theme.colors.clear,
99
+ paddingLeft: 0,
100
+ paddingRight: 0,
101
+ marginBottom: 20
102
+ },
87
103
  inputTextArea: {
88
104
  borderColor: theme.colors.lightGray,
89
105
  borderRadius: 8,
@@ -95,11 +111,11 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
95
111
  })
96
112
 
97
113
  const qualificationList = [
98
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
114
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
99
115
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
100
116
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
101
117
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
102
- { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
118
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
103
119
  ]
104
120
 
105
121
  const commentsList = reviewCommentList('customer')
@@ -142,6 +158,25 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
142
158
 
143
159
  }, [actionState.error])
144
160
 
161
+ useEffect(() => {
162
+ if (scrollref?.current) {
163
+ Keyboard.addListener('keyboardDidShow', () => {
164
+ scrollref.current.scrollToEnd()
165
+ })
166
+ }
167
+ }, [scrollref?.current])
168
+
169
+ const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''}`?.replace(' ', ' ')?.trim() ?? ''
170
+
171
+ const handleReviewClick = () => {
172
+ handleCustomCustomerReview
173
+ ? handleCustomCustomerReview({
174
+ qualification: reviewState?.qualification,
175
+ comment: reviewState?.comment
176
+ })
177
+ : handleSendCustomerReview()
178
+ }
179
+
145
180
  return (
146
181
  <KeyboardAvoidingView
147
182
  enabled
@@ -156,18 +191,9 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
156
191
  }}
157
192
  >
158
193
  <View>
159
- <OIconButton
160
- icon={theme.images.general.arrow_left}
161
- borderColor={theme.colors.clear}
162
- iconStyle={{ width: 20, height: 16 }}
163
- style={{
164
- maxWidth: 40,
165
- height: 20,
166
- justifyContent: 'flex-end',
167
- marginBottom: 20,
168
- }}
169
- onClick={() => closeModal()}
170
- />
194
+ <TouchableOpacity onPress={() => closeModal()} style={styles.btnBackArrow}>
195
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
196
+ </TouchableOpacity>
171
197
  <OText
172
198
  size={20}
173
199
  weight="600"
@@ -179,6 +205,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
179
205
  <Content
180
206
  showsVerticalScrollIndicator={false}
181
207
  contentContainerStyle={{ paddingBottom: 30 }}
208
+ ref={scrollref}
182
209
  >
183
210
  <CustomerInfoContainer>
184
211
  <View
@@ -196,20 +223,20 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
196
223
  style={{ borderRadius: 7.6 }}
197
224
  />
198
225
  </View>
199
- <OText
226
+ {!!customerName && <OText
200
227
  size={14}
201
228
  weight="500"
202
229
  style={{
203
230
  marginTop: 16
204
231
  }}
205
232
  >
206
- {order?.customer?.name} {order?.customer?.middle_name} {order?.customer?.lastname} {order?.customer?.second_lastname}
207
- </OText>
233
+ {customerName}
234
+ </OText>}
208
235
  </CustomerInfoContainer>
209
236
  <OText
210
237
  size={12}
211
238
  >
212
- {t('HOW_WAS_YOUR_CUSTOMER', 'How was your experience with _name_?').replace('_name_', `${order?.customer?.name} ${order?.customer?.middle_name} ${order?.customer?.lastname} ${order?.customer?.second_lastname}`)}
239
+ {customerName ? t('HOW_WAS_YOUR_CUSTOMER', 'How was your experience with _name_?').replace('_name_', customerName) : t('HOW_WAS_YOUR_NO_CUSTOMER', 'How was your experience?')}
213
240
  </OText>
214
241
  <RatingBarContainer>
215
242
  <LinearGradient
@@ -270,8 +297,8 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
270
297
  }}
271
298
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
272
299
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
273
- imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
274
- onClick={() => handleChangeComment(commentItem) }
300
+ imgRightStyle={{ right: 5, margin: 5 }}
301
+ onClick={() => handleChangeComment(commentItem)}
275
302
  />
276
303
  ))}
277
304
  </CommentsButtonGroup>
@@ -291,7 +318,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
291
318
 
292
319
  <ActionButtonWrapper>
293
320
  <FloatingButton
294
- firstButtonClick={() => handleSendCustomerReview()}
321
+ firstButtonClick={() => handleReviewClick()}
295
322
  btnText={actionState.loading ? t('LOADING', 'Loading') : t('SEND_REVIEW', 'Send Review')}
296
323
  color={theme.colors.primary}
297
324
  widthButton={'100%'}
@@ -299,7 +326,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
299
326
  </ActionButtonWrapper>
300
327
  <Alert
301
328
  open={alertState.open}
302
- onAccept={() => setAlertState({ open: false, content: [] })}
329
+ onAccept={() => setAlertState({ open: false, content: [] })}
303
330
  onClose={() => setAlertState({ open: false, content: [] })}
304
331
  content={alertState.content}
305
332
  title={t('ERROR', 'Error')}
@@ -4,6 +4,7 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
4
4
  import { ScrollView as CustomScrollView, TouchableOpacity as CustomTouchableOpacity, View } from 'react-native'
5
5
  import FeatherIcon from 'react-native-vector-icons/Feather';
6
6
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
7
+ import AntDesign from 'react-native-vector-icons/AntDesign';
7
8
  import { Text } from 'react-native-paper';
8
9
 
9
10
  interface Props {
@@ -16,7 +17,11 @@ interface Props {
16
17
  dropViewMaxHeight?: any,
17
18
  isModal?: any,
18
19
  bgcolor?: string,
19
- textcolor?: string
20
+ textcolor?: string,
21
+ handleClear?: any,
22
+ handleOpenSelect?: any,
23
+ openedSelect?: string,
24
+ selectType?: string
20
25
  }
21
26
 
22
27
  const Wrapper = styled.View`
@@ -70,7 +75,11 @@ const ODropDown = (props: Props) => {
70
75
  placeholder,
71
76
  onSelect,
72
77
  dropViewMaxHeight,
73
- isModal
78
+ isModal,
79
+ handleClear,
80
+ handleOpenSelect,
81
+ openedSelect,
82
+ selectType
74
83
  } = props
75
84
 
76
85
  const theme = useTheme();
@@ -82,6 +91,7 @@ const ODropDown = (props: Props) => {
82
91
 
83
92
  const onToggle = () => {
84
93
  setIsOpen(!isOpen)
94
+ if (!isOpen) handleOpenSelect?.()
85
95
  }
86
96
 
87
97
  const onSelectOption = (option: any) => {
@@ -91,12 +101,25 @@ const ODropDown = (props: Props) => {
91
101
  setIsOpen(false)
92
102
  }
93
103
 
104
+ const handleClearSearch = () => {
105
+ handleClear()
106
+ if (isOpen) {
107
+ onToggle()
108
+ }
109
+ }
110
+
94
111
  useEffect(() => {
95
112
  const _defaultOption = options?.find((option: any) => option.value === defaultValue)
96
113
  setSelectedOption(_defaultOption)
97
114
  setValue(defaultValue)
98
115
  }, [defaultValue, options])
99
116
 
117
+ useEffect(() => {
118
+ if (openedSelect !== selectType && typeof openedSelect === 'string') {
119
+ setIsOpen(false)
120
+ }
121
+ }, [openedSelect])
122
+
100
123
  return (
101
124
  <Wrapper style={props.style}>
102
125
  <Selected
@@ -110,11 +133,22 @@ const ODropDown = (props: Props) => {
110
133
  >
111
134
  {selectedOption?.content || selectedOption?.name || placeholder}
112
135
  </SelectedLabel>
113
- <FeatherIcon
114
- name='chevron-down'
115
- color={props.textcolor}
116
- size={24}
117
- />
136
+ {selectedOption && handleClear ? (
137
+ <AntDesign
138
+ name={'close'}
139
+ size={20}
140
+ onPress={() => handleClearSearch()}
141
+ style={{ position: 'absolute', right: 12, top: 13 }}
142
+ />
143
+ ) : (
144
+ <FeatherIcon
145
+ name='chevron-down'
146
+ color={props.textcolor}
147
+ size={24}
148
+ style={{ position: 'absolute', right: 12, top: 13 }}
149
+
150
+ />
151
+ )}
118
152
  </Selected>
119
153
  {isOpen && options && (
120
154
  <DropView
@@ -154,7 +188,7 @@ const ODropDown = (props: Props) => {
154
188
  maxHeight: dropViewMaxHeight || null,
155
189
  paddingBottom: 15
156
190
  }}
157
- nestedScrollEnabled={true}
191
+ nestedScrollEnabled={true}
158
192
  >
159
193
  {options.map((option: any, index: number) => (
160
194
  <CustomTouchableOpacity
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react'
1
+ import React, { useState, useEffect, useRef } from 'react'
2
2
  import styled, { css, useTheme } from 'styled-components/native'
3
3
  import { useLanguage } from 'ordering-components/native';
4
4
  import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
@@ -24,6 +24,10 @@ interface Props {
24
24
  handleChangeDate?: any,
25
25
  rangeDate?: any,
26
26
  isCalendarAlwaysVisible?: boolean
27
+ handleClear?: any;
28
+ handleOpenSelect?: any,
29
+ openedSelect?: string,
30
+ selectType?: string
27
31
  }
28
32
 
29
33
  const Wrapper = styled.View`
@@ -96,7 +100,11 @@ const ODropDownCalendar = (props: Props) => {
96
100
  isCalendar,
97
101
  handleChangeDate,
98
102
  rangeDate,
99
- isCalendarAlwaysVisible
103
+ isCalendarAlwaysVisible,
104
+ handleClear,
105
+ handleOpenSelect,
106
+ openedSelect,
107
+ selectType
100
108
  } = props
101
109
 
102
110
  const theme = useTheme();
@@ -110,6 +118,7 @@ const ODropDownCalendar = (props: Props) => {
110
118
 
111
119
  const onToggle = () => {
112
120
  setIsOpen(!isOpen)
121
+ if (!isOpen) handleOpenSelect?.()
113
122
  }
114
123
 
115
124
  const onSelectOption = (option: any) => {
@@ -122,7 +131,7 @@ const ODropDownCalendar = (props: Props) => {
122
131
  const onDateChange = (date: any, type: any) => {
123
132
  if (!date) return
124
133
  if (type === 'END_DATE') {
125
- handleChangeDate(rangeDate.from, date.format('MM/DD/YY'))
134
+ handleChangeDate(rangeDate.from, new Date(date.format('MM/DD/YY')) === rangeDate.from ? '' : date.format('MM/DD/YY'))
126
135
  } else {
127
136
  handleChangeDate(date.format('MM/DD/YY'), '')
128
137
  }
@@ -142,12 +151,31 @@ const ODropDownCalendar = (props: Props) => {
142
151
  return (from || to) ? (from + (to ? end : '')) : placeholder
143
152
  }
144
153
 
154
+ const handleClearCalendar = () => {
155
+ handleClear && handleClear()
156
+ if (isOpen) {
157
+ onToggle()
158
+ }
159
+ }
160
+
145
161
  useEffect(() => {
146
162
  const _defaultOption = options?.find((option: any) => option.value === defaultValue)
147
163
  setSelectedOption(_defaultOption)
148
164
  setValue(defaultValue)
149
165
  }, [defaultValue, options])
150
166
 
167
+ useEffect(() => {
168
+ if (openedSelect !== selectType && typeof openedSelect === 'string') {
169
+ setIsOpen(false)
170
+ }
171
+ }, [openedSelect])
172
+
173
+ useEffect(() => {
174
+ if (rangeDate.to && rangeDate.from) {
175
+ onSelect('calendar')
176
+ }
177
+ }, [rangeDate.to, rangeDate.from])
178
+
151
179
  return (
152
180
  <Wrapper style={props.style}>
153
181
  <Selected
@@ -165,10 +193,11 @@ const ODropDownCalendar = (props: Props) => {
165
193
  : `${selectedOption?.content || selectedOption?.name || placeholder}`
166
194
  }
167
195
  </SelectedLabel>
168
- <FeatherIcon
169
- name='calendar'
170
- color={theme.colors.backArrow}
171
- size={24}
196
+ <AntDesign
197
+ name={selectedOption && handleClear ? 'close' : 'calendar'}
198
+ size={20}
199
+ onPress={() => handleClearCalendar()}
200
+ style={{ position: 'absolute', right: 12, top: 13 }}
172
201
  />
173
202
  </Selected>
174
203
  {isOpen && options && (
@@ -12,10 +12,12 @@ interface Props {
12
12
  TextStyle?: TextStyle;
13
13
  type?: string;
14
14
  hasButton?: boolean;
15
+ numberOfLines?: number;
16
+ onTextLayout?: (e : any) => void;
15
17
  }
16
18
 
17
19
  const OLink = (props: Props): React.ReactElement => {
18
- const { url, shorcut, color, PressStyle, TextStyle, type, hasButton } = props;
20
+ const { url, shorcut, color, PressStyle, TextStyle, type, hasButton, numberOfLines, onTextLayout } = props;
19
21
  const [, t] = useLanguage();
20
22
 
21
23
  const handleAlert = () =>
@@ -29,8 +31,19 @@ const OLink = (props: Props): React.ReactElement => {
29
31
  ],
30
32
  );
31
33
 
34
+ const handleInvalidNumberAlert = () =>
35
+ Alert.alert(
36
+ t('ERROR_OPENING_THE_LINK', 'Error opening the link'),
37
+ t('INVALID_NUMBER', 'Invalid number'),
38
+ [
39
+ {
40
+ text: t('OK', 'Ok'),
41
+ },
42
+ ],
43
+ );
44
+
32
45
  const handleOpenUrl = async (breakFunction = false) => {
33
- if(breakFunction) {
46
+ if (breakFunction) {
34
47
  return
35
48
  }
36
49
  if (!url) {
@@ -40,8 +53,9 @@ const OLink = (props: Props): React.ReactElement => {
40
53
 
41
54
  try {
42
55
  const supported = await Linking.canOpenURL(url);
43
-
44
- if (supported) {
56
+ if (url && url?.includes('tel:')) {
57
+ url?.includes('invalid') ? handleInvalidNumberAlert() : await Linking.openURL(url)
58
+ } else if (supported) {
45
59
  await Linking.openURL(url);
46
60
  } else {
47
61
  handleAlert();
@@ -57,20 +71,26 @@ const OLink = (props: Props): React.ReactElement => {
57
71
  <OButton
58
72
  onClick={() => handleOpenUrl()}
59
73
  text={shorcut} imgRightSrc=''
60
- textStyle={{color: 'white'}}
61
- style={{width: '100%', alignSelf: 'center', borderRadius: 10}}
74
+ textStyle={{ color: 'white' }}
75
+ style={{ width: '100%', alignSelf: 'center', borderRadius: 10 }}
62
76
  />
63
77
  ) : (
64
- <OText
65
- style={TextStyle}
66
- numberOfLines={1}
67
- ellipsizeMode="tail"
68
- color={color}>
69
- {shorcut}
70
- </OText>
78
+ <OText
79
+ style={TextStyle}
80
+ numberOfLines={numberOfLines ?? 1}
81
+ ellipsizeMode="tail"
82
+ color={color}
83
+ onTextLayout={onTextLayout}
84
+ >
85
+ {shorcut}
86
+ </OText>
71
87
  )}
72
88
  </Pressable>
73
89
  );
74
90
  };
75
91
 
92
+ OLink.defaultProps = {
93
+ onTextLayout: (e: any) => {}
94
+ };
95
+
76
96
  export default OLink;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Modal, StyleSheet, SafeAreaView, View } from 'react-native';
2
+ import { Modal, StyleSheet, SafeAreaView, View, TouchableOpacity } from 'react-native';
3
3
  import Icon from 'react-native-vector-icons/Feather';
4
4
  import OIcon from './OIcon';
5
5
  import OText from './OText';
@@ -158,6 +158,18 @@ const OModal = (props: Props): React.ReactElement => {
158
158
  fontWeight: '600',
159
159
  textAlign: 'center',
160
160
  },
161
+ btnBackArrow: {
162
+ borderWidth: 0,
163
+ width: 32,
164
+ height: 32,
165
+ tintColor: theme.colors.textGray,
166
+ backgroundColor: theme.colors.clear,
167
+ borderColor: theme.colors.clear,
168
+ shadowColor: theme.colors.clear,
169
+ paddingLeft: 0,
170
+ paddingRight: 0,
171
+ marginTop: 10
172
+ },
161
173
  });
162
174
 
163
175
  return (
@@ -205,14 +217,9 @@ const OModal = (props: Props): React.ReactElement => {
205
217
  {!customClose && (
206
218
  <View style={styles.titleSection}>
207
219
  <View style={styles.titleGroups}>
208
- <OIconButton
209
- icon={theme.images.general.arrow_left}
210
- iconStyle={{ width: 20, height: 20 }}
211
- borderColor={theme.colors.clear}
212
- style={styleCloseButton || styles.cancelBtn}
213
- onClick={onClose}
214
- />
215
-
220
+ <TouchableOpacity onPress={() => onClose()} style={styles.btnBackArrow}>
221
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
222
+ </TouchableOpacity>
216
223
  <OText
217
224
  size={16}
218
225
  style={styles.modalText}
@@ -40,16 +40,22 @@ interface Props {
40
40
  numberOfLines?: number;
41
41
  ellipsizeMode?: string;
42
42
  adjustsFontSizeToFit?: boolean;
43
- textDecorationLine?: string
43
+ textDecorationLine?: string;
44
+ lineHeight?: number;
45
+ onTextLayout?: (e : any) => void;
44
46
  }
45
47
 
46
48
  const OText = (props: Props): React.ReactElement => {
47
49
  return (
48
- <SText {...props} style={props.style}>
50
+ <SText {...props} style={[props.style, { lineHeight: props.lineHeight }]} onTextLayout={props.onTextLayout}>
49
51
  {props.children}
50
52
  {props.space && ' '}
51
53
  </SText>
52
54
  );
53
55
  };
54
56
 
57
+ OText.defaultProps = {
58
+ onTextLayout: (e: any) => {}
59
+ };
60
+
55
61
  export default OText;