ordering-ui-react-native 0.16.41 → 0.16.42-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 (199) hide show
  1. package/package.json +7 -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/BusinessBasicInformation/index.tsx +11 -19
  6. package/src/components/BusinessInformation/index.tsx +33 -4
  7. package/src/components/BusinessInformation/styles.tsx +2 -2
  8. package/src/components/BusinessProductsList/index.tsx +10 -10
  9. package/src/components/BusinessesListing/index.tsx +1 -1
  10. package/src/components/Checkout/index.tsx +2 -1
  11. package/src/components/LanguageSelector/index.tsx +21 -16
  12. package/src/components/Messages/index.tsx +2 -2
  13. package/src/components/NotificationSetting/index.tsx +85 -0
  14. package/src/components/OrdersOption/index.tsx +54 -56
  15. package/src/components/PaymentOptions/index.tsx +298 -345
  16. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  17. package/src/components/ReviewDriver/index.tsx +1 -1
  18. package/src/components/ReviewOrder/index.tsx +1 -1
  19. package/src/components/ReviewProducts/index.tsx +11 -0
  20. package/src/components/SingleProductReview/index.tsx +8 -5
  21. package/src/components/StripeElementsForm/index.tsx +25 -16
  22. package/src/components/VerifyPhone/styles.tsx +1 -2
  23. package/src/components/shared/OBottomPopup.tsx +6 -2
  24. package/src/index.tsx +2 -0
  25. package/src/pages/BusinessesListing.tsx +7 -6
  26. package/src/pages/OrderDetails.tsx +1 -1
  27. package/src/pages/ReviewDriver.tsx +2 -2
  28. package/src/pages/ReviewOrder.tsx +2 -2
  29. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  30. package/src/utils/index.tsx +2 -1
  31. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  32. package/themes/business/src/components/Chat/index.tsx +40 -32
  33. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  34. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  35. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  36. package/themes/business/src/components/MapView/index.tsx +12 -1
  37. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  38. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  39. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  40. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  41. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  42. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  43. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  44. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  45. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  46. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  47. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  48. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  49. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  50. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  51. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  52. package/themes/business/src/components/PreviousOrders/index.tsx +22 -24
  53. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  54. package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
  55. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  56. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  57. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  58. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  59. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  60. package/themes/business/src/types/index.tsx +15 -9
  61. package/themes/business/src/utils/index.tsx +10 -0
  62. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  64. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  65. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  66. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  67. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  68. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  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/ProductForm/index.tsx +1 -14
  73. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  74. package/themes/kiosk/src/types/index.d.ts +2 -0
  75. package/themes/original/index.tsx +4 -0
  76. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  77. package/themes/original/src/components/AddressForm/index.tsx +157 -140
  78. package/themes/original/src/components/AddressList/index.tsx +1 -1
  79. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  80. package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
  81. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
  82. package/themes/original/src/components/BusinessController/index.tsx +216 -113
  83. package/themes/original/src/components/BusinessController/styles.tsx +1 -8
  84. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  85. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  86. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  87. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  88. package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
  89. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  90. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  91. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  92. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -60
  93. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  94. package/themes/original/src/components/BusinessProductsListing/index.tsx +210 -115
  95. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
  96. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  97. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
  98. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +260 -109
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
  101. package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
  102. package/themes/original/src/components/Cart/index.tsx +53 -15
  103. package/themes/original/src/components/Cart/styles.tsx +4 -0
  104. package/themes/original/src/components/CartContent/index.tsx +22 -16
  105. package/themes/original/src/components/Checkout/index.tsx +114 -118
  106. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  107. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  108. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  109. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  110. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  111. package/themes/original/src/components/FavoriteList/index.tsx +19 -0
  112. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  113. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  114. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  115. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  116. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  117. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  118. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  119. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  120. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  121. package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -73
  122. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  123. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  124. package/themes/original/src/components/Messages/index.tsx +20 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  126. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  127. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  128. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  129. package/themes/original/src/components/MyOrders/index.tsx +88 -22
  130. package/themes/original/src/components/NavBar/index.tsx +15 -9
  131. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  132. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  133. package/themes/original/src/components/Notifications/index.tsx +148 -0
  134. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  135. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  136. package/themes/original/src/components/OrderDetails/index.tsx +200 -37
  137. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  138. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  139. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  140. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  141. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  142. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  143. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  144. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  148. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  149. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  150. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  151. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  152. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  153. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  154. package/themes/original/src/components/ProductForm/index.tsx +639 -664
  155. package/themes/original/src/components/ProductForm/styles.tsx +10 -11
  156. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  157. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  158. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  159. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  160. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  161. package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
  162. package/themes/original/src/components/Promotions/index.tsx +232 -219
  163. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  164. package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
  165. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  166. package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
  167. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  168. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  169. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  170. package/themes/original/src/components/ServiceForm/index.tsx +410 -258
  171. package/themes/original/src/components/SignupForm/index.tsx +160 -113
  172. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  173. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  174. package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
  175. package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
  176. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  177. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  178. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  179. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  180. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  181. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  182. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  183. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  184. package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
  185. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  186. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  187. package/themes/original/src/components/Wallets/index.tsx +176 -164
  188. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  189. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  190. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  191. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  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 +13 -3
  195. package/themes/original/src/layouts/Container.tsx +13 -9
  196. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  197. package/themes/original/src/types/index.tsx +82 -28
  198. package/themes/original/src/utils/index.tsx +103 -58
  199. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -14,6 +14,7 @@ import { Container, WrappButton } from './styles'
14
14
  import { OButton } from '../shared';
15
15
  import { BusinessController } from '../BusinessController';
16
16
  import { SingleProductCard } from '../SingleProductCard';
17
+ import { NotFoundSource } from '../NotFoundSource';
17
18
  import moment from 'moment';
18
19
 
19
20
 
@@ -224,6 +225,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
224
225
  <BusinessSkeleton key={i} />
225
226
  ))
226
227
  )}
228
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
229
+ <NotFoundSource
230
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
231
+ }
232
+ />
233
+ )}
227
234
  </>
228
235
  )}
229
236
 
@@ -250,6 +257,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
250
257
  <OrderSkeleton key={i} />
251
258
  ))
252
259
  )}
260
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
261
+ <NotFoundSource
262
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
263
+ }
264
+ />
265
+ )}
253
266
  </>
254
267
  )}
255
268
 
@@ -271,6 +284,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
271
284
  <ProductSkeleton key={i} />
272
285
  ))
273
286
  )}
287
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
288
+ <NotFoundSource
289
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
290
+ }
291
+ />
292
+ )}
274
293
  </>
275
294
  )}
276
295
 
@@ -12,7 +12,7 @@ export const Container = styled.View`
12
12
  width: 100%;
13
13
  justify-content: space-between;
14
14
  background-color: #FFF;
15
- z-index: 1000;
15
+ z-index: 9999;
16
16
  justify-content: space-between;
17
17
  `
18
18
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const GpsButtonStyle = styled.TouchableOpacity`
4
- width: 30px;
5
- height: 30px;
6
- `
4
+ width: 16px;
5
+ height: 16px;
6
+ `
@@ -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
  }
@@ -1,12 +1,15 @@
1
1
  import React from 'react'
2
+ import { Platform } from 'react-native'
2
3
  import { useLanguage } from 'ordering-components/native'
3
4
  import { HelpAccountAndPaymentParams } from '../../types'
4
5
  import { OText, OButton, OIcon } from '../shared'
5
6
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
7
+ import { StyleSheet, TouchableOpacity } from 'react-native'
8
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
7
9
 
8
10
  import {
9
- Content
11
+ Content,
12
+ HeaderWrapper
10
13
  } from './styles'
11
14
 
12
15
  export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
@@ -37,13 +40,25 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
37
40
 
38
41
  return (
39
42
  <>
40
- <OButton
41
- imgLeftSrc={theme.images.general.arrow_left}
42
- imgRightSrc={null}
43
- style={styles.btnBackArrow}
44
- onClick={() => goToBack()}
45
- />
46
- <OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
43
+ <HeaderWrapper>
44
+ <OButton
45
+ imgRightSrc={null}
46
+ style={styles.btnBackArrow}
47
+ onClick={() => goToBack()}
48
+ icon={AntDesignIcon}
49
+ iconProps={{
50
+ name: 'arrowleft',
51
+ size: 26
52
+ }}
53
+ />
54
+ <OText
55
+ size={24}
56
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
57
+ color={theme.colors.textNormal}
58
+ >
59
+ {t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}
60
+ </OText>
61
+ </HeaderWrapper>
47
62
  <Content>
48
63
  <OText mBottom={20}>
49
64
  -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vel in congue nisl, nisi. Mauris, condimentum auctor sed cras cursus arcu pellentesque.
@@ -65,4 +80,4 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
65
80
  </Content>
66
81
  </>
67
82
  )
68
- }
83
+ }
@@ -4,3 +4,7 @@ export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
6
  `
7
+ export const HeaderWrapper = styled.View`
8
+ padding: 10px 20px 20px 0;
9
+ flex-direction: row;
10
+ `
@@ -3,10 +3,12 @@ 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
+ import NavBar from '../NavBar'
7
8
  import {
8
9
  Content
9
10
  } from './styles'
11
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
10
12
 
11
13
  export const HelpGuide = (props: HelpGuideParams) => {
12
14
  const {
@@ -36,13 +38,12 @@ export const HelpGuide = (props: HelpGuideParams) => {
36
38
 
37
39
  return (
38
40
  <>
39
- <OButton
40
- imgLeftSrc={theme.images.general.arrow_left}
41
- imgRightSrc={null}
42
- style={styles.btnBackArrow}
43
- onClick={() => goToBack()}
41
+ <NavBar
42
+ title={t('GUIDE_TO_ORDERING', 'Guide to Ordering')}
43
+ onActionLeft={goToBack}
44
+ btnStyle={{ paddingLeft: 0 }}
45
+ showCall={false}
44
46
  />
45
- <OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
46
47
  <Content>
47
48
  <OText mBottom={15}>
48
49
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Blandit mauris varius faucibus varius condimentum morbi pretium mus. Aliquam bibendum erat venenatis feugiat sed.
@@ -64,4 +65,4 @@ export const HelpGuide = (props: HelpGuideParams) => {
64
65
  </Content>
65
66
  </>
66
67
  )
67
- }
68
+ }
@@ -3,8 +3,10 @@ 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'
9
+ import NavBar from '../NavBar'
8
10
 
9
11
  import {
10
12
  Content
@@ -41,13 +43,12 @@ export const HelpOrder = (props: HelpOrderParams) => {
41
43
 
42
44
  return (
43
45
  <>
44
- <OButton
45
- imgLeftSrc={theme.images.general.arrow_left}
46
- imgRightSrc={null}
47
- style={styles.btnBackArrow}
48
- onClick={() => goToBack()}
46
+ <NavBar
47
+ title={t('HELP_WITH_ORDER', 'Help with an order')}
48
+ onActionLeft={goToBack}
49
+ btnStyle={{ paddingLeft: 0 }}
50
+ showCall={false}
49
51
  />
50
- <OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
51
52
  <Content>
52
53
  <OText mBottom={20}>
53
54
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vel in congue nisl, nisi. Mauris, condimentum auctor sed cras cursus arcu pellentesque. Sed tempus et, cursus ultricies nisl nisl, in eros.
@@ -76,4 +77,4 @@ export const HelpOrder = (props: HelpOrderParams) => {
76
77
  </Content>
77
78
  </>
78
79
  )
79
- }
80
+ }
@@ -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 />}
@@ -1,91 +1,113 @@
1
- import React, { useEffect } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import { formatSeconds } from '../../../utils'
3
3
  import { StyleSheet, TouchableOpacity } from 'react-native';
4
4
  import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
5
5
  import { useLanguage } from 'ordering-components/native';
6
6
  import { OTPContainer } from './styles';
7
7
  import { OText, OButton } from '../../shared';
8
- import OTPInputView from '@twotalltotems/react-native-otp-input'
8
+ import OtpInputs from 'react-native-otp-inputs';
9
9
  import { useTheme } from 'styled-components/native';
10
10
  import { otpParams } from '../../../types'
11
11
 
12
12
  export const Otp = (props: otpParams) => {
13
- const {
14
- willVerifyOtpState,
15
- setWillVerifyOtpState,
16
- onSubmit,
17
- handleLoginOtp,
18
- setAlertState,
19
- pinCount
20
- } = props
13
+ const {
14
+ willVerifyOtpState,
15
+ setWillVerifyOtpState,
16
+ onSubmit,
17
+ handleLoginOtp,
18
+ setAlertState,
19
+ pinCount
20
+ } = props
21
21
 
22
- const theme = useTheme();
23
- const [, t] = useLanguage();
24
- const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
25
- 600, willVerifyOtpState)
22
+ const theme = useTheme();
23
+ const [, t] = useLanguage();
24
+ const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
25
+ 600, willVerifyOtpState)
26
26
 
27
+ const [code, setCode] = useState('')
27
28
 
28
- const handleOnSubmit = () => {
29
- setAlertState({
30
- open: true,
31
- title: t('CODE_SENT', 'The code has been sent'),
32
- })
33
- resetOtpLeftTime()
34
- onSubmit()
29
+
30
+ const handleOnSubmit = () => {
31
+ setAlertState({
32
+ open: true,
33
+ title: t('CODE_SENT', 'The code has been sent'),
34
+ })
35
+ resetOtpLeftTime()
36
+ onSubmit()
37
+ }
38
+
39
+ useEffect(() => {
40
+ if (otpLeftTime === 0) {
41
+ setAlertState({
42
+ open: true,
43
+ title: t('TIME_IS_UP', 'Time is up'),
44
+ content: t('PLEASE_RESEND_CODE', 'Please resend code again')
45
+ })
35
46
  }
47
+ }, [otpLeftTime])
36
48
 
37
- useEffect(() => {
38
- if (otpLeftTime === 0) {
39
- setAlertState({
40
- open: true,
41
- title: t('TIME_IS_UP', 'Time is up'),
42
- content: t('PLEASE_RESEND_CODE', 'Please resend code again')
43
- })
44
- }
45
- }, [otpLeftTime])
49
+ useEffect(() => {
50
+ if (code?.length === (pinCount || 6)) {
51
+ handleLoginOtp(code)
52
+ }
53
+ }, [code])
46
54
 
47
- const loginStyle = StyleSheet.create({
48
- underlineStyleBase: {
49
- width: 45,
50
- height: 60,
51
- borderWidth: 1,
52
- fontSize: 16
53
- },
54
- underlineStyleHighLighted: {
55
- borderColor: theme.colors.primary,
56
- color: theme.colors.primary,
57
- fontSize: 16
58
- },
59
- });
55
+ const loginStyle = StyleSheet.create({
56
+ container: {
57
+ width: '100%',
58
+ flexDirection: 'row',
59
+ justifyContent: 'space-between',
60
+ marginVertical: 30
61
+ },
62
+ focusStyles: {
63
+ borderColor: theme.colors.primary,
64
+ borderWidth: 1,
65
+ borderRadius: 8
66
+ },
67
+ underlineStyleBase: {
68
+ width: 45,
69
+ height: 50,
70
+ borderWidth: 1,
71
+ fontSize: 16,
72
+ borderRadius: 8,
73
+ borderColor: theme.colors.lightGray,
74
+ textAlign: 'center'
75
+ },
76
+ underlineStyleHighLighted: {
77
+ borderColor: theme.colors.primary,
78
+ color: theme.colors.primary,
79
+ fontSize: 16
80
+ },
81
+ });
60
82
 
61
- return (
62
- <>
63
- <OTPContainer>
64
- <OText size={24}>
65
- {formatSeconds(otpLeftTime)}
66
- </OText>
67
- <OTPInputView
68
- style={{ width: '100%', height: 150 }}
69
- pinCount={pinCount || 6}
70
- codeInputFieldStyle={loginStyle.underlineStyleBase}
71
- codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
72
- onCodeFilled={(code: string) => handleLoginOtp(code)}
73
- selectionColor={theme.colors.primary}
74
- />
75
- <TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
76
- <OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
77
- {t('RESEND_CODE', 'Resend code')}
78
- </OText>
79
- </TouchableOpacity>
80
- <OButton
81
- onClick={() => setWillVerifyOtpState(false)}
82
- bgColor={theme.colors.white}
83
- borderColor={theme.colors.primary}
84
- textStyle={{ color: theme.colors.primary }}
85
- style={{ borderRadius: 8, width: '100%' }}
86
- text={t('CANCEL', 'Cancel')}
87
- />
88
- </OTPContainer>
89
- </>
90
- )
83
+ return (
84
+ <>
85
+ <OTPContainer>
86
+ <OText size={24}>
87
+ {formatSeconds(otpLeftTime)}
88
+ </OText>
89
+ <OtpInputs
90
+ autofillFromClipboard
91
+ numberOfInputs={pinCount || 6}
92
+ style={loginStyle.container}
93
+ inputStyles={loginStyle.underlineStyleBase}
94
+ focusStyles={loginStyle.focusStyles}
95
+ handleChange={setCode}
96
+ />
97
+ <TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
98
+ <OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
99
+ {t('RESEND_CODE', 'Resend code')}
100
+ </OText>
101
+ </TouchableOpacity>
102
+ <OButton
103
+ onClick={() => setWillVerifyOtpState(false)}
104
+ bgColor={theme.colors.white}
105
+ borderColor={theme.colors.primary}
106
+ textStyle={{ color: theme.colors.primary }}
107
+ style={{ borderRadius: 8, width: '100%' }}
108
+ text={t('CANCEL', 'Cancel')}
109
+ />
110
+ </OTPContainer>
111
+ </>
112
+ )
91
113
  }