ordering-ui-react-native 0.16.23 → 0.16.24-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 (198) hide show
  1. package/package.json +7 -4
  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/AddressForm/index.tsx +18 -2
  6. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  7. package/src/components/BusinessController/index.tsx +10 -8
  8. package/src/components/BusinessInformation/index.tsx +33 -4
  9. package/src/components/BusinessInformation/styles.tsx +2 -2
  10. package/src/components/BusinessProductsList/index.tsx +10 -10
  11. package/src/components/BusinessesListing/index.tsx +1 -1
  12. package/src/components/Checkout/index.tsx +2 -1
  13. package/src/components/LanguageSelector/index.tsx +21 -16
  14. package/src/components/LoginForm/index.tsx +118 -30
  15. package/src/components/LoginForm/styles.tsx +6 -0
  16. package/src/components/Messages/index.tsx +2 -2
  17. package/src/components/NotificationSetting/index.tsx +85 -0
  18. package/src/components/OrderDetails/index.tsx +2 -20
  19. package/src/components/OrdersOption/index.tsx +54 -56
  20. package/src/components/PaymentOptions/index.tsx +335 -365
  21. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  22. package/src/components/ReviewDriver/index.tsx +1 -1
  23. package/src/components/ReviewOrder/index.tsx +2 -1
  24. package/src/components/ReviewProducts/index.tsx +11 -0
  25. package/src/components/SignupForm/index.tsx +143 -61
  26. package/src/components/SingleProductReview/index.tsx +8 -5
  27. package/src/components/StripeElementsForm/index.tsx +25 -16
  28. package/src/components/VerifyPhone/styles.tsx +1 -2
  29. package/src/components/shared/OBottomPopup.tsx +6 -2
  30. package/src/index.tsx +2 -0
  31. package/src/pages/BusinessesListing.tsx +7 -6
  32. package/src/pages/OrderDetails.tsx +1 -1
  33. package/src/pages/ReviewDriver.tsx +2 -2
  34. package/src/pages/ReviewOrder.tsx +2 -2
  35. package/src/theme.json +0 -1
  36. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  37. package/src/types/index.tsx +13 -9
  38. package/src/utils/index.tsx +0 -1
  39. package/themes/business/index.tsx +4 -0
  40. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  41. package/themes/business/src/components/Chat/index.tsx +42 -34
  42. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  43. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  44. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  45. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  46. package/themes/business/src/components/MapView/index.tsx +12 -1
  47. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  48. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  49. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  50. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  51. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  52. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  53. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  54. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  55. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  56. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  57. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  58. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  59. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  60. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  61. package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
  62. package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
  63. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  64. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  65. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  66. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  67. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  68. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  69. package/themes/business/src/components/shared/OModal.tsx +40 -37
  70. package/themes/business/src/types/index.tsx +15 -9
  71. package/themes/business/src/utils/index.tsx +10 -0
  72. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  73. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  74. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  75. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  76. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  77. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  78. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  79. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  80. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  81. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  82. package/themes/kiosk/src/types/index.d.ts +2 -0
  83. package/themes/original/index.tsx +12 -0
  84. package/themes/original/src/components/AddressForm/index.tsx +139 -135
  85. package/themes/original/src/components/AddressList/index.tsx +1 -1
  86. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  87. package/themes/original/src/components/BusinessBasicInformation/index.tsx +311 -161
  88. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  89. package/themes/original/src/components/BusinessController/index.tsx +175 -110
  90. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -6
  91. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  92. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  93. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  94. package/themes/original/src/components/BusinessListingSearch/index.tsx +101 -125
  95. package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
  96. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  97. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  98. package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
  99. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  100. package/themes/original/src/components/BusinessProductsListing/index.tsx +287 -175
  101. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -8
  102. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  103. package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
  104. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  105. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
  106. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -10
  107. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
  108. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  109. package/themes/original/src/components/BusinessesListing/index.tsx +105 -519
  110. package/themes/original/src/components/Cart/index.tsx +42 -10
  111. package/themes/original/src/components/Cart/styles.tsx +4 -0
  112. package/themes/original/src/components/CartContent/index.tsx +22 -16
  113. package/themes/original/src/components/Checkout/index.tsx +105 -65
  114. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  115. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  116. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  117. package/themes/original/src/components/Favorite/index.tsx +1 -0
  118. package/themes/original/src/components/FavoriteList/index.tsx +32 -2
  119. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  120. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  121. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  122. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
  123. package/themes/original/src/components/HelpGuide/index.tsx +8 -3
  124. package/themes/original/src/components/HelpOrder/index.tsx +8 -3
  125. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  126. package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
  127. package/themes/original/src/components/LoginForm/index.tsx +82 -44
  128. package/themes/original/src/components/Messages/index.tsx +17 -17
  129. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  130. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  131. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  132. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  133. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  134. package/themes/original/src/components/MyOrders/index.tsx +70 -6
  135. package/themes/original/src/components/NavBar/index.tsx +15 -9
  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 +148 -0
  139. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  140. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  141. package/themes/original/src/components/OrderDetails/index.tsx +190 -35
  142. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  143. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  144. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  145. package/themes/original/src/components/OrderProgress/index.tsx +8 -2
  146. package/themes/original/src/components/OrderSummary/index.tsx +1 -34
  147. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  148. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  149. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +100 -106
  150. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +17 -12
  151. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  152. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  153. package/themes/original/src/components/PaymentOptions/index.tsx +42 -24
  154. package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
  155. package/themes/original/src/components/PlaceSpot/index.tsx +243 -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 +710 -653
  159. package/themes/original/src/components/ProductForm/styles.tsx +9 -7
  160. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  161. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  162. package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
  163. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  164. package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
  165. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  166. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  167. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  168. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  169. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  170. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  171. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  172. package/themes/original/src/components/ServiceForm/index.tsx +631 -0
  173. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  174. package/themes/original/src/components/SignupForm/index.tsx +350 -206
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +214 -179
  176. package/themes/original/src/components/SingleProductCard/index.tsx +198 -104
  177. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  178. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  180. package/themes/original/src/components/StripeElementsForm/index.tsx +15 -7
  181. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  182. package/themes/original/src/components/UserDetails/index.tsx +31 -17
  183. package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
  184. package/themes/original/src/components/UserProfile/index.tsx +54 -29
  185. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  186. package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
  187. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  188. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  189. package/themes/original/src/components/Wallets/index.tsx +174 -162
  190. package/themes/original/src/components/Wallets/styles.tsx +10 -8
  191. package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
  192. package/themes/original/src/components/shared/OButton.tsx +10 -3
  193. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  194. package/themes/original/src/components/shared/OInput.tsx +3 -2
  195. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  196. package/themes/original/src/types/index.tsx +122 -30
  197. package/themes/original/src/utils/index.tsx +77 -0
  198. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,17 +1,16 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
3
- import Geolocation from '@react-native-community/geolocation'
4
2
  import Geocoder from 'react-native-geocoding'
5
- import { GpsButtonStyle } from './styles'
6
- import { View } from 'react-native'
7
- import { OText } from '../shared'
8
3
  import { ActivityIndicator } from 'react-native-paper'
4
+ import Geolocation from '@react-native-community/geolocation'
5
+ import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
6
+
7
+ import { OText } from '../shared'
8
+ import { GpsButtonStyle } from './styles'
9
9
 
10
10
  export const GPSButton = (props: any) => {
11
11
  const {
12
12
  handleGPS,
13
13
  apiKey,
14
- googleReady,
15
14
  IconButton,
16
15
  IconLoadingButton
17
16
  } = props
@@ -56,25 +55,27 @@ export const GPSButton = (props: any) => {
56
55
  })
57
56
  }
58
57
 
59
- const getCurrentPosition = async () => {
58
+ const getCurrentPosition = async () => {
60
59
  let trackingStatus = await getTrackingStatus()
61
- if (trackingStatus === 'not-determined') {
62
- trackingStatus = await requestTrackingPermission()
63
- }
64
- if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
65
- setLoading(true);
60
+ if (trackingStatus === 'not-determined') {
61
+ trackingStatus = await requestTrackingPermission()
62
+ }
63
+ if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
64
+ setLoading(true)
66
65
  Geolocation.getCurrentPosition((pos) => {
67
- geoCodePosition(pos.coords);
66
+ geoCodePosition(pos.coords)
68
67
  }, (err) => {
69
68
  setLoading(false);
70
- console.log(err);
71
- });
69
+ console.log(`ERROR(${err.code}): ${err.message}`)
70
+ }, {
71
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
72
+ })
72
73
  }
73
- }
74
+ }
74
75
 
75
- useEffect(() => {
76
- Geocoder.init(apiKey);
77
- }, [])
76
+ useEffect(() => {
77
+ Geocoder.init(apiKey);
78
+ }, [])
78
79
 
79
80
  return (
80
81
  <GpsButtonStyle
@@ -32,6 +32,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
32
32
  latitudeDelta: 0.0010,
33
33
  longitudeDelta: 0.0010 * ASPECT_RATIO
34
34
  })
35
+ const [MARKERS, SETMARKERS] = useState(locations)
35
36
  let mapRef = useRef<any>(null)
36
37
  const googleMapsApiKey = configState?.configs?.google_maps_api_key?.value
37
38
 
@@ -41,12 +42,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
41
42
  ERROR_NOT_FOUND_ADDRESS: 'Sorry, we couldn\'t find an address',
42
43
  ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
43
44
  }
44
- const MARKERS = locations && locations.map((location: { lat: number, lng: number }) => {
45
- return {
46
- latitude: location.lat,
47
- longitude: location.lng
48
- }
49
- })
45
+
50
46
  const geocodePosition = (pos: { latitude: number, longitude: number }) => {
51
47
  Geocoder.from({
52
48
  latitude: pos.latitude,
@@ -93,7 +89,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
93
89
  return
94
90
  }
95
91
 
96
- if (distance <= maxLimitLocation) {
92
+ const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
93
+
94
+ if (distance <= _maxLimitLocation) {
97
95
  setMarkerPosition(curPos)
98
96
  setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
99
97
  } else {
@@ -147,7 +145,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
147
145
  }
148
146
 
149
147
  const fitAllMarkers = () => {
150
- mapRef.current.fitToCoordinates(MARKERS, {
148
+ mapRef.current.fitToCoordinates(MARKERS?.map(location => ({ latitude: location.lat, longitude: location.lng })), {
151
149
  edgePadding: { top: 80, right: 80, bottom: 80, left: 80 },
152
150
  animated: true,
153
151
  });
@@ -157,6 +155,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
157
155
  Geocoder.init(googleMapsApiKey)
158
156
  }, [])
159
157
 
158
+ useEffect(() => {
159
+ mapRef.current.animateToRegion({
160
+ ...region,
161
+ latitude: location?.lat,
162
+ longitude: location?.lng,
163
+ })
164
+ }, [location])
160
165
 
161
166
  useEffect(() => {
162
167
  if (saveLocation) {
@@ -170,6 +175,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
170
175
  fitAllMarkers()
171
176
  }
172
177
  }, 1000)
178
+ if (locations) {
179
+ SETMARKERS(locations)
180
+ }
173
181
  return () => clearInterval(interval)
174
182
  }, [locations])
175
183
 
@@ -189,16 +197,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
189
197
  >
190
198
  {locations ? (
191
199
  <>
192
- {MARKERS && MARKERS.map((location: { latitude: number, longitude: number }, i: number) => (
200
+ {MARKERS && MARKERS.map((location: { lat: number, lng: number }, i: number) => (
193
201
  <React.Fragment key={i}>
194
202
  {
195
203
  <Marker
196
204
  zIndex={i}
197
- coordinate={location}
198
- title={locations[i]?.title}
205
+ coordinate={{ latitude: location.lat ?? 0, longitude: location.lng ?? 0 }}
206
+ title={MARKERS[i]?.title}
199
207
  >
200
208
  <View>
201
- <OIcon url={locations[i].icon} width={50} height={50} />
209
+ <OIcon url={MARKERS[i].icon} width={50} height={50} />
202
210
  </View>
203
211
  </Marker>
204
212
  }
@@ -3,7 +3,8 @@ import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpAccountAndPaymentParams } from '../../types'
4
4
  import { OText, OButton, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
6
+ import { StyleSheet, TouchableOpacity } from 'react-native'
7
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
7
8
 
8
9
  import {
9
10
  Content
@@ -38,10 +39,14 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
38
39
  return (
39
40
  <>
40
41
  <OButton
41
- imgLeftSrc={theme.images.general.arrow_left}
42
42
  imgRightSrc={null}
43
43
  style={styles.btnBackArrow}
44
44
  onClick={() => goToBack()}
45
+ icon={AntDesignIcon}
46
+ iconProps={{
47
+ name: 'arrowleft',
48
+ size: 26
49
+ }}
45
50
  />
46
51
  <OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
47
52
  <Content>
@@ -65,4 +70,4 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
65
70
  </Content>
66
71
  </>
67
72
  )
68
- }
73
+ }
@@ -3,10 +3,11 @@ import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpGuideParams } from '../../types'
4
4
  import { OText, OButton, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
6
+ import { StyleSheet, TouchableOpacity } from 'react-native'
7
7
  import {
8
8
  Content
9
9
  } from './styles'
10
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
10
11
 
11
12
  export const HelpGuide = (props: HelpGuideParams) => {
12
13
  const {
@@ -37,10 +38,14 @@ export const HelpGuide = (props: HelpGuideParams) => {
37
38
  return (
38
39
  <>
39
40
  <OButton
40
- imgLeftSrc={theme.images.general.arrow_left}
41
41
  imgRightSrc={null}
42
42
  style={styles.btnBackArrow}
43
43
  onClick={() => goToBack()}
44
+ icon={AntDesignIcon}
45
+ iconProps={{
46
+ name: 'arrowleft',
47
+ size: 26
48
+ }}
44
49
  />
45
50
  <OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
46
51
  <Content>
@@ -64,4 +69,4 @@ export const HelpGuide = (props: HelpGuideParams) => {
64
69
  </Content>
65
70
  </>
66
71
  )
67
- }
72
+ }
@@ -3,8 +3,9 @@ import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpOrderParams } from '../../types'
4
4
  import { OText, OButton, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
6
+ import { StyleSheet, TouchableOpacity } from 'react-native'
7
7
  import { WebView } from 'react-native-webview'
8
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8
9
 
9
10
  import {
10
11
  Content
@@ -42,10 +43,14 @@ export const HelpOrder = (props: HelpOrderParams) => {
42
43
  return (
43
44
  <>
44
45
  <OButton
45
- imgLeftSrc={theme.images.general.arrow_left}
46
46
  imgRightSrc={null}
47
47
  style={styles.btnBackArrow}
48
48
  onClick={() => goToBack()}
49
+ icon={AntDesignIcon}
50
+ iconProps={{
51
+ name: 'arrowleft',
52
+ size: 26
53
+ }}
49
54
  />
50
55
  <OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
51
56
  <Content>
@@ -76,4 +81,4 @@ export const HelpOrder = (props: HelpOrderParams) => {
76
81
  </Content>
77
82
  </>
78
83
  )
79
- }
84
+ }
@@ -1,7 +1,7 @@
1
- import React from 'react'
2
- import { LanguageSelector as LanguageSelectorController, useOrder } from 'ordering-components/native'
1
+ import React, { useState } from 'react'
2
+ import { LanguageSelector as LanguageSelectorController, useOrder, useLanguage } from 'ordering-components/native'
3
3
  import { useTheme } from 'styled-components/native';
4
- import { Platform, StyleSheet, View } from 'react-native'
4
+ import { StyleSheet, View } from 'react-native'
5
5
 
6
6
  import RNPickerSelect from 'react-native-picker-select'
7
7
  import { Container, DummyContainer } from './styles'
@@ -9,9 +9,17 @@ import { LanguageSelectorParams } from '../../types'
9
9
  import { OIcon } from '../shared'
10
10
 
11
11
  const LanguageSelectorUI = (props: LanguageSelectorParams) => {
12
+ const {
13
+ languagesState,
14
+ currentLanguage,
15
+ handleChangeLanguage,
16
+ iconColor,
17
+ pickerStyle
18
+ } = props
12
19
 
13
20
  const [orderState] = useOrder()
14
-
21
+ const [state] = useLanguage()
22
+ const [languagePressed, setLanguagePressed] = useState(currentLanguage)
15
23
  const theme = useTheme();
16
24
 
17
25
  const _pickerStyle = StyleSheet.create({
@@ -41,14 +49,11 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
41
49
  color: theme.colors.secundaryContrast
42
50
  }
43
51
  })
44
-
45
- const {
46
- languagesState,
47
- currentLanguage,
48
- handleChangeLanguage,
49
- iconColor,
50
- pickerStyle
51
- } = props
52
+
53
+ const changeLanguage = (lang : string) => {
54
+ setLanguagePressed(lang)
55
+ handleChangeLanguage(lang)
56
+ }
52
57
 
53
58
  const _languages = languagesState?.languages?.map((language: any) => {
54
59
  return {
@@ -67,14 +72,14 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
67
72
  <>
68
73
  {iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
69
74
  <RNPickerSelect
70
- onValueChange={handleChangeLanguage}
75
+ onValueChange={changeLanguage}
71
76
  items={_languages || []}
72
77
  value={currentLanguage}
73
78
  style={pickerStyle ? pickerStyle : _pickerStyle}
74
79
  useNativeAndroidPickerStyle={false}
75
80
  placeholder={{}}
76
81
  Icon={() => <View style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} /></View>}
77
- disabled={orderState.loading}
82
+ disabled={orderState.loading || state.loading || state?.language?.code !== languagePressed}
78
83
  />
79
84
  </>
80
85
  ) : <DummyContainer />}
@@ -15,7 +15,8 @@ export const Otp = (props: otpParams) => {
15
15
  setWillVerifyOtpState,
16
16
  onSubmit,
17
17
  handleLoginOtp,
18
- setAlertState
18
+ setAlertState,
19
+ pinCount
19
20
  } = props
20
21
 
21
22
  const theme = useTheme();
@@ -65,7 +66,7 @@ export const Otp = (props: otpParams) => {
65
66
  </OText>
66
67
  <OTPInputView
67
68
  style={{ width: '100%', height: 150 }}
68
- pinCount={6}
69
+ pinCount={pinCount || 6}
69
70
  codeInputFieldStyle={loginStyle.underlineStyleBase}
70
71
  codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
71
72
  onCodeFilled={(code: string) => handleLoginOtp(code)}
@@ -5,6 +5,7 @@ import { useForm, Controller } from 'react-hook-form';
5
5
  import { PhoneInputNumber } from '../PhoneInputNumber';
6
6
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
7
7
  import Recaptcha from 'react-native-recaptcha-that-works'
8
+ import ReCaptcha from '@fatnlazycat/react-native-recaptcha-v3'
8
9
 
9
10
  import {
10
11
  LoginForm as LoginFormController,
@@ -102,7 +103,7 @@ const LoginFormUI = (props: LoginParams) => {
102
103
 
103
104
  const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
104
105
  const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
105
- const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
106
+ const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
106
107
 
107
108
  const loginStyle = StyleSheet.create({
108
109
  btnOutline: {
@@ -235,7 +236,7 @@ const LoginFormUI = (props: LoginParams) => {
235
236
 
236
237
  const onRecaptchaVerify = (token: any) => {
237
238
  setRecaptchaVerified(true)
238
- handleReCaptcha(token)
239
+ handleReCaptcha({ code: token, version: recaptchaConfig?.version })
239
240
  }
240
241
 
241
242
  const handleChangeOtpType = (type: string) => {
@@ -256,7 +257,7 @@ const LoginFormUI = (props: LoginParams) => {
256
257
  })
257
258
  }
258
259
 
259
- const handleCategoryScroll = (opc : string) => {
260
+ const handleCategoryScroll = (opc: string) => {
260
261
  tabsRef.current.scrollTo({
261
262
  x: tabLayouts?.[opc]?.x - 40,
262
263
  animated: true
@@ -272,15 +273,39 @@ const LoginFormUI = (props: LoginParams) => {
272
273
 
273
274
  useEffect(() => {
274
275
  if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
275
- setRecaptchaConfig({
276
- siteKey: configs?.security_recaptcha_site_key?.value || null,
277
- baseUrl: configs?.security_recaptcha_base_url?.value || null
278
- })
276
+ if (configs?.security_recaptcha_type?.value === 'v3' &&
277
+ configs?.security_recaptcha_score_v3?.value > 0 &&
278
+ configs?.security_recaptcha_site_key_v3?.value
279
+ ) {
280
+ setRecaptchaConfig({
281
+ version: 'v3',
282
+ siteKey: configs?.security_recaptcha_site_key_v3?.value || null,
283
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
284
+ })
285
+ return
286
+ }
287
+ if (configs?.security_recaptcha_site_key?.value) {
288
+ setRecaptchaConfig({
289
+ version: 'v2',
290
+ siteKey: configs?.security_recaptcha_site_key?.value || null,
291
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
292
+ })
293
+ }
279
294
  }
280
295
  }, [configs, enableReCaptcha])
281
296
 
282
297
  useEffect(() => {
283
298
  if (!formState.loading && formState.result?.error) {
299
+ if (formState.result?.result?.[0] === 'ERROR_AUTH_VERIFICATION_CODE') {
300
+ setRecaptchaVerified(false)
301
+ setRecaptchaConfig({
302
+ version: 'v2',
303
+ siteKey: configs?.security_recaptcha_site_key?.value || null,
304
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
305
+ })
306
+ showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
307
+ return
308
+ }
284
309
  formState.result?.result &&
285
310
  showToast(
286
311
  ToastType.Error,
@@ -351,15 +376,15 @@ const LoginFormUI = (props: LoginParams) => {
351
376
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
352
377
  />
353
378
  <FormSide>
354
- {((useLoginByEmail && useLoginByCellphone) || useLoginOtp) && (
379
+ {(Number(useLoginByEmail) + Number(useLoginByCellphone) + Number(useLoginOtpEmail) + Number(useLoginOtpCellphone) > 1) && (
355
380
  <LoginWith>
356
381
  <OTabs
357
- horizontal
382
+ horizontal
358
383
  showsHorizontalScrollIndicator={false}
359
384
  ref={tabsRef}
360
385
  >
361
386
  {useLoginByEmail && (
362
- <TabBtn
387
+ <TabBtn
363
388
  onPress={() => handleChangeTab('email')}
364
389
  onLayout={(event: any) => handleOnLayout(event, 'email')}
365
390
  >
@@ -384,7 +409,7 @@ const LoginFormUI = (props: LoginParams) => {
384
409
  </TabBtn>
385
410
  )}
386
411
  {useLoginByCellphone && (
387
- <TabBtn
412
+ <TabBtn
388
413
  onPress={() => handleChangeTab('cellphone')}
389
414
  onLayout={(event: any) => handleOnLayout(event, 'cellphone')}
390
415
  >
@@ -409,7 +434,7 @@ const LoginFormUI = (props: LoginParams) => {
409
434
  </TabBtn>
410
435
  )}
411
436
  {useLoginOtpEmail && (
412
- <TabBtn
437
+ <TabBtn
413
438
  onPress={() => handleChangeOtpType('email')}
414
439
  onLayout={(event: any) => handleOnLayout(event, 'otp_email')}
415
440
  >
@@ -434,7 +459,7 @@ const LoginFormUI = (props: LoginParams) => {
434
459
  </TabBtn>
435
460
  )}
436
461
  {useLoginOtpCellphone && (
437
- <TabBtn
462
+ <TabBtn
438
463
  onPress={() => handleChangeOtpType('cellphone')}
439
464
  onLayout={(event: any) => handleOnLayout(event, 'otp_cellphone')}
440
465
  >
@@ -596,35 +621,47 @@ const LoginFormUI = (props: LoginParams) => {
596
621
  </TouchableOpacity>
597
622
  )}
598
623
 
599
- {enableReCaptcha && (
624
+ {(enableReCaptcha && recaptchaConfig?.version) && (
600
625
  <>
601
- <TouchableOpacity
602
- onPress={handleOpenRecaptcha}
603
- >
604
- <RecaptchaButton>
605
- {recaptchaVerified ? (
606
- <MaterialCommunityIcons
607
- name="checkbox-marked"
608
- size={26}
609
- color={theme.colors.primary}
610
- />
611
- ) : (
612
- <MaterialCommunityIcons
613
- name="checkbox-blank-outline"
614
- size={26}
615
- color={theme.colors.mediumGray}
616
- />
617
- )}
618
- <OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
619
- </RecaptchaButton>
620
- </TouchableOpacity>
621
- <Recaptcha
622
- ref={recaptchaRef}
623
- siteKey={recaptchaConfig?.siteKey}
624
- baseUrl={recaptchaConfig?.baseUrl}
625
- onVerify={onRecaptchaVerify}
626
- onExpire={() => setRecaptchaVerified(false)}
627
- />
626
+ {recaptchaConfig?.version === 'v3' ? (
627
+ <ReCaptcha
628
+ url={recaptchaConfig?.baseUrl}
629
+ siteKey={recaptchaConfig?.siteKey}
630
+ containerStyle={{ height: 40 }}
631
+ onExecute={onRecaptchaVerify}
632
+ reCaptchaType={1}
633
+ />
634
+ ) : (
635
+ <>
636
+ <TouchableOpacity
637
+ onPress={handleOpenRecaptcha}
638
+ >
639
+ <RecaptchaButton>
640
+ {recaptchaVerified ? (
641
+ <MaterialCommunityIcons
642
+ name="checkbox-marked"
643
+ size={26}
644
+ color={theme.colors.primary}
645
+ />
646
+ ) : (
647
+ <MaterialCommunityIcons
648
+ name="checkbox-blank-outline"
649
+ size={26}
650
+ color={theme.colors.mediumGray}
651
+ />
652
+ )}
653
+ <OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
654
+ </RecaptchaButton>
655
+ </TouchableOpacity>
656
+ <Recaptcha
657
+ ref={recaptchaRef}
658
+ siteKey={recaptchaConfig?.siteKey}
659
+ baseUrl={recaptchaConfig?.baseUrl}
660
+ onVerify={onRecaptchaVerify}
661
+ onExpire={() => setRecaptchaVerified(false)}
662
+ />
663
+ </>)
664
+ }
628
665
  </>
629
666
  )}
630
667
  <OButton
@@ -682,8 +719,9 @@ const LoginFormUI = (props: LoginParams) => {
682
719
  )}
683
720
 
684
721
  {configs && Object.keys(configs).length > 0 ? (
685
- (((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
686
- (configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null)) &&
722
+ (((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
723
+ ((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
724
+ ((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
687
725
  (
688
726
  <>
689
727
  <View
@@ -707,7 +745,7 @@ const LoginFormUI = (props: LoginParams) => {
707
745
  <ButtonsWrapper>
708
746
  <SocialButtons>
709
747
  {(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
710
- configs?.facebook_id?.value &&
748
+ configs?.facebook_id?.value &&
711
749
  facebookLoginEnabled && (
712
750
  <FacebookLogin
713
751
  notificationState={notificationState}
@@ -5,6 +5,7 @@ import { launchImageLibrary } from 'react-native-image-picker'
5
5
  import { GiftedChat, Actions, ActionsProps, InputToolbar, Composer, Send, Bubble, MessageImage, InputToolbarProps, ComposerProps } from 'react-native-gifted-chat'
6
6
  import { USER_TYPE } from '../../config/constants'
7
7
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
8
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8
9
  import { OIcon, OIconButton, OText, OButton } from '../shared'
9
10
  import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard } from 'react-native'
10
11
  import { Header, TitleHeader, Wrapper, QuickMessageContainer, ProfileMessageHeader, MessageTypeItem } from './styles'
@@ -36,7 +37,7 @@ const ORDER_STATUS: any = {
36
37
  20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
37
38
  21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
38
39
  22: 'ORDER_LOOKING_FOR_DRIVER',
39
- 23: 'ORDER_DRIVER_ON_WAY'
40
+ 23: 'ORDER_DRIVER_ON_WAY'
40
41
  }
41
42
 
42
43
  const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
@@ -122,18 +123,17 @@ const MessagesUI = (props: MessagesParams) => {
122
123
 
123
124
  const messageConsole = (message: any) => {
124
125
  return message.change?.attribute !== 'driver_id'
125
- ?
126
- `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
127
- filterSpecialStatus.includes(message.change.attribute) ?
128
- `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
129
- `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
130
- }`
131
- : message.change.new
132
126
  ?
133
- `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
134
- :
135
- `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
136
- }
127
+ `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
128
+ `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
129
+ `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
130
+ }`
131
+ : message.change.new
132
+ ?
133
+ `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
134
+ :
135
+ `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
136
+ }
137
137
 
138
138
  useEffect(() => {
139
139
  let newMessages: Array<any> = []
@@ -402,7 +402,9 @@ const MessagesUI = (props: MessagesParams) => {
402
402
  <Wrapper>
403
403
  {!isMeesageListing ? (
404
404
  <Header>
405
- <OIconButton icon={theme.images.general.arrow_left} style={{ paddingStart: 10, borderColor: theme.colors.clear }} onClick={onClose} />
405
+ <TouchableOpacity onPress={onClose} style={{ paddingStart: 10, borderColor: theme.colors.clear }}>
406
+ <AntDesignIcon name='arrowleft' size={26} />
407
+ </TouchableOpacity>
406
408
  <View style={{ marginRight: 10, shadowColor: theme.colors.black, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 1 }, shadowRadius: 2 }}>
407
409
  <OIcon
408
410
  url={type === USER_TYPE.DRIVER ? order?.driver?.photo : order?.business?.logo}
@@ -419,10 +421,8 @@ const MessagesUI = (props: MessagesParams) => {
419
421
  ) : (
420
422
  <ProfileMessageHeader>
421
423
  <View style={{ ...styles.headerTitle }}>
422
- <TouchableOpacity
423
- style={styles.headerItem}
424
- onPress={onClose}>
425
- <OIcon src={theme.images.general.arrow_left} width={16} />
424
+ <TouchableOpacity onPress={onClose} style={styles.headerItem}>
425
+ <AntDesignIcon name='arrowleft' size={26} />
426
426
  </TouchableOpacity>
427
427
  <OText size={18}>{t('ORDER', theme?.defaultLanguages?.ORDER || 'Order')} #{order?.id}</OText>
428
428
  </View>