ordering-ui-react-native 0.18.55-test1 → 0.18.56-crash-driver-1

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 (266) hide show
  1. package/package.json +6 -5
  2. package/src/components/BusinessInformation/index.tsx +10 -9
  3. package/src/components/PaymentOptionsWebView/index.tsx +30 -8
  4. package/src/components/PhoneInputNumber/index.tsx +6 -2
  5. package/src/components/StripeMethodForm/index.tsx +60 -55
  6. package/src/components/shared/OToast.tsx +3 -2
  7. package/src/types/index.tsx +3 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +6 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/Chat/index.tsx +48 -19
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  20. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  21. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  22. package/themes/business/src/components/Home/index.tsx +5 -1
  23. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  24. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  25. package/themes/business/src/components/LoginForm/index.tsx +2 -2
  26. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  27. package/themes/business/src/components/MapView/index.tsx +28 -17
  28. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  29. package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
  30. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  31. package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
  32. package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
  35. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  36. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
  37. package/themes/business/src/components/OrderMessage/index.tsx +1 -1
  38. package/themes/business/src/components/OrderSummary/index.tsx +245 -82
  39. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  40. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  41. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  42. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  43. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  44. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
  46. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  48. package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  50. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  51. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  52. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  53. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  54. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  55. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  56. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  57. package/themes/business/src/components/Sessions/index.tsx +187 -0
  58. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  59. package/themes/business/src/components/StoresList/index.tsx +4 -3
  60. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  61. package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
  62. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  63. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  64. package/themes/business/src/components/shared/OInput.tsx +2 -0
  65. package/themes/business/src/hooks/useLocation.tsx +5 -4
  66. package/themes/business/src/types/index.tsx +21 -1
  67. package/themes/business/src/utils/index.tsx +5 -0
  68. package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
  69. package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
  70. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  71. package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
  72. package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
  73. package/themes/original/index.tsx +11 -3
  74. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  75. package/themes/original/src/components/AddressForm/index.tsx +41 -20
  76. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  77. package/themes/original/src/components/AddressList/index.tsx +22 -11
  78. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  79. package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
  80. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  81. package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
  82. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  83. package/themes/original/src/components/BusinessController/index.tsx +40 -43
  84. package/themes/original/src/components/BusinessController/styles.tsx +12 -12
  85. package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
  86. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  88. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  89. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  93. package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
  94. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  98. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
  105. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
  106. package/themes/original/src/components/Cart/index.tsx +51 -40
  107. package/themes/original/src/components/CartContent/index.tsx +98 -54
  108. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  109. package/themes/original/src/components/Checkout/index.tsx +308 -75
  110. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  112. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  113. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  114. package/themes/original/src/components/DriverTips/index.tsx +6 -3
  115. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  116. package/themes/original/src/components/Favorite/index.tsx +8 -4
  117. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  120. package/themes/original/src/components/GPSButton/index.tsx +7 -5
  121. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  122. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  123. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  124. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  125. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  126. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  127. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  128. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  129. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  130. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  131. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  132. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  133. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  134. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  135. package/themes/original/src/components/GoogleMap/index.tsx +52 -5
  136. package/themes/original/src/components/Help/index.tsx +7 -0
  137. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  138. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  139. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  140. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  141. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  142. package/themes/original/src/components/Home/index.tsx +3 -2
  143. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  144. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  145. package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
  146. package/themes/original/src/components/LoginForm/index.tsx +38 -14
  147. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  148. package/themes/original/src/components/Messages/index.tsx +9 -3
  149. package/themes/original/src/components/Messages/styles.tsx +1 -1
  150. package/themes/original/src/components/MomentOption/index.tsx +20 -5
  151. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  152. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  153. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
  154. package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
  155. package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
  156. package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
  157. package/themes/original/src/components/MyOrders/index.tsx +37 -39
  158. package/themes/original/src/components/NavBar/index.tsx +15 -14
  159. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  160. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  161. package/themes/original/src/components/Notifications/index.tsx +9 -8
  162. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  163. package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
  164. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
  165. package/themes/original/src/components/OrderDetails/index.tsx +718 -667
  166. package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
  167. package/themes/original/src/components/OrderProgress/index.tsx +50 -14
  168. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  169. package/themes/original/src/components/OrderSummary/index.tsx +26 -34
  170. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
  171. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  172. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  173. package/themes/original/src/components/OrdersOption/index.tsx +14 -6
  174. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  175. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  176. package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
  177. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  178. package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
  179. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  180. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  181. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  182. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  183. package/themes/original/src/components/ProductForm/index.tsx +193 -267
  184. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  185. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
  186. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  187. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  188. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  189. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  190. package/themes/original/src/components/Promotions/index.tsx +13 -11
  191. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  192. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  193. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  194. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  195. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  196. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  197. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  198. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  199. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  200. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  201. package/themes/original/src/components/Sessions/index.tsx +5 -0
  202. package/themes/original/src/components/SignupForm/index.tsx +76 -60
  203. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
  204. package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
  205. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
  206. package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
  207. package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
  208. package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
  209. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  210. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  211. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  212. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  213. package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
  214. package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
  215. package/themes/original/src/components/UserProfile/index.tsx +5 -4
  216. package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
  217. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  218. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  219. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  220. package/themes/original/src/components/Wallets/index.tsx +35 -49
  221. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  222. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  223. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  224. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  225. package/themes/original/src/components/shared/OButton.tsx +5 -5
  226. package/themes/original/src/components/shared/OInput.tsx +7 -4
  227. package/themes/original/src/components/shared/OModal.tsx +12 -14
  228. package/themes/original/src/layouts/Container.tsx +5 -3
  229. package/themes/original/src/types/index.tsx +13 -2
  230. package/themes/original/src/utils/index.tsx +124 -22
  231. package/src/navigators/BottomNavigator.tsx +0 -117
  232. package/src/navigators/CheckoutNavigator.tsx +0 -66
  233. package/src/navigators/HomeNavigator.tsx +0 -202
  234. package/src/navigators/NavigationRef.tsx +0 -7
  235. package/src/navigators/RootNavigator.tsx +0 -269
  236. package/src/pages/Account.tsx +0 -34
  237. package/src/pages/AddressForm.tsx +0 -62
  238. package/src/pages/AddressList.tsx +0 -24
  239. package/src/pages/BusinessProductsList.tsx +0 -81
  240. package/src/pages/BusinessesListing.tsx +0 -43
  241. package/src/pages/CartList.tsx +0 -49
  242. package/src/pages/Checkout.tsx +0 -101
  243. package/src/pages/ForgotPassword.tsx +0 -24
  244. package/src/pages/Help.tsx +0 -23
  245. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  246. package/src/pages/HelpGuide.tsx +0 -23
  247. package/src/pages/HelpOrder.tsx +0 -23
  248. package/src/pages/Home.tsx +0 -36
  249. package/src/pages/IntroductoryTutorial.tsx +0 -170
  250. package/src/pages/Login.tsx +0 -47
  251. package/src/pages/MomentOption.tsx +0 -30
  252. package/src/pages/MultiCheckout.tsx +0 -31
  253. package/src/pages/MultiOrdersDetails.tsx +0 -27
  254. package/src/pages/MyOrders.tsx +0 -40
  255. package/src/pages/NetworkError.tsx +0 -24
  256. package/src/pages/NotFound.tsx +0 -22
  257. package/src/pages/OrderDetails.tsx +0 -25
  258. package/src/pages/ProductDetails.tsx +0 -55
  259. package/src/pages/Profile.tsx +0 -36
  260. package/src/pages/ReviewDriver.tsx +0 -30
  261. package/src/pages/ReviewOrder.tsx +0 -32
  262. package/src/pages/ReviewProducts.tsx +0 -30
  263. package/src/pages/Sessions.tsx +0 -22
  264. package/src/pages/Signup.tsx +0 -53
  265. package/src/pages/SpinnerLoader.tsx +0 -10
  266. package/src/pages/Splash.tsx +0 -21
@@ -30,7 +30,6 @@ export const DriverMap = (props: GoogleMapsParams) => {
30
30
  isBusinessMarker,
31
31
  isToFollow,
32
32
  handleViewActionOrder,
33
- updateDriverPosition,
34
33
  driverUpdateLocation,
35
34
  setDriverUpdateLocation,
36
35
  } = props;
@@ -59,6 +58,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
59
58
  key?: string | null;
60
59
  }>({ open: false, content: [], key: null });
61
60
  const distanceUnit = configState?.configs?.distance_unit?.value
61
+ const isHideRejectButtons = configState?.configs?.reject_orders_enabled && configState?.configs?.reject_orders_enabled?.value !== '1'
62
62
 
63
63
  const {
64
64
  hasLocation,
@@ -69,11 +69,20 @@ export const DriverMap = (props: GoogleMapsParams) => {
69
69
  stopFollowUserLocation,
70
70
  } = useLocation();
71
71
 
72
- const origin = {
73
- latitude: initialPosition.latitude,
74
- longitude: initialPosition.longitude,
72
+ const destination = {
73
+ latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
74
+ longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0
75
75
  };
76
- const destination = { latitude: location.lat, longitude: location.lng };
76
+
77
+ const parsedInitialPosition = {
78
+ latitude: typeof initialPosition.latitude === 'string' ? parseFloat(initialPosition.latitude) || 0 : initialPosition.latitude || 0,
79
+ longitude: typeof initialPosition.longitude === 'string' ? parseFloat(initialPosition.longitude) || 0 : initialPosition.longitude || 0,
80
+ }
81
+
82
+ const parsedUserLocation = {
83
+ latitude: typeof userLocation?.latitude === 'string' ? parseFloat(userLocation?.latitude) || 0 : userLocation?.latitude || 0,
84
+ longitude: typeof userLocation?.longitude === 'string' ? parseFloat(userLocation?.longitude) || 0 : userLocation?.longitude || 0
85
+ }
77
86
 
78
87
  useEffect(() => {
79
88
  if (isToFollow) {
@@ -161,7 +170,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
161
170
  if (driverUpdateLocation.error) return;
162
171
 
163
172
  calculateDistance(
164
- { lat: userLocation.latitude, lng: userLocation.longitude },
173
+ { lat: parsedUserLocation.latitude, lng: parsedUserLocation.longitude },
165
174
  destination,
166
175
  );
167
176
  // geocodePosition(userLocation);
@@ -169,13 +178,13 @@ export const DriverMap = (props: GoogleMapsParams) => {
169
178
  if (!following.current) return;
170
179
  fitCoordinates();
171
180
 
172
- const { latitude, longitude } = userLocation;
181
+ const { latitude, longitude } = parsedUserLocation;
173
182
 
174
183
  mapRef.current?.animateCamera({
175
184
  center: { latitude, longitude },
176
185
  });
177
186
 
178
- }, [userLocation]);
187
+ }, [parsedUserLocation]);
179
188
 
180
189
  const handleArrowBack: any = () => {
181
190
  setDriverUpdateLocation?.({
@@ -241,8 +250,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
241
250
  [
242
251
  { latitude: location.lat, longitude: location.lng },
243
252
  {
244
- latitude: initialPosition.latitude,
245
- longitude: initialPosition.longitude,
253
+ latitude: parsedInitialPosition.latitude,
254
+ longitude: parsedInitialPosition.longitude,
246
255
  },
247
256
  ],
248
257
  {
@@ -255,7 +264,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
255
264
 
256
265
  useEffect(() => {
257
266
  const interval = setInterval(() => {
258
- if (initialPosition.latitude !== 0 && autoFit.current) {
267
+ if (parsedInitialPosition.latitude !== 0 && autoFit.current) {
259
268
  if (mapRef.current) {
260
269
  fitCoordinates();
261
270
  autoFit.current = false;
@@ -263,7 +272,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
263
272
  }
264
273
  }, 1000);
265
274
  return () => clearInterval(interval);
266
- }, [initialPosition]);
275
+ }, [parsedInitialPosition]);
267
276
 
268
277
  const fitCoordinatesZoom = () => {
269
278
  following.current = false;
@@ -346,8 +355,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
346
355
  ref={mapRef}
347
356
  provider={PROVIDER_GOOGLE}
348
357
  initialRegion={{
349
- latitude: initialPosition.latitude,
350
- longitude: initialPosition.longitude,
358
+ latitude: parsedInitialPosition.latitude,
359
+ longitude: parsedInitialPosition.longitude,
351
360
  latitudeDelta: 0.001,
352
361
  longitudeDelta: 0.001 * ASPECT_RATIO,
353
362
  }}
@@ -369,8 +378,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
369
378
  <>
370
379
  <Marker
371
380
  coordinate={{
372
- latitude: location.lat,
373
- longitude: location.lng,
381
+ latitude: destination.latitude,
382
+ longitude: destination.longitude
374
383
  }}
375
384
  title={location.title}>
376
385
  <Icon
@@ -381,13 +390,16 @@ export const DriverMap = (props: GoogleMapsParams) => {
381
390
  <View style={styles.view}>
382
391
  <OIcon
383
392
  style={styles.image}
384
- url={location.icon}
393
+ src={typeof location.icon === 'number' ? location.icon : { uri: location.icon }}
385
394
  width={25}
386
395
  height={25}
387
396
  />
388
397
  </View>
389
398
  </Marker>
390
- <Marker coordinate={userLocation}>
399
+ <Marker coordinate={{
400
+ latitude: parsedUserLocation.latitude,
401
+ longitude: parsedUserLocation.longitude
402
+ }}>
391
403
  <View style={styles.driverIcon}>
392
404
  <OIcon
393
405
  style={styles.image}
@@ -401,8 +413,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
401
413
  ) : (
402
414
  <Marker
403
415
  coordinate={{
404
- latitude: userLocation.latitude,
405
- longitude: userLocation.longitude,
416
+ latitude: parsedUserLocation.latitude,
417
+ longitude: parsedUserLocation.longitude
406
418
  }}
407
419
  title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
408
420
  />
@@ -516,8 +528,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
516
528
  options={{
517
529
  latitude: destination.latitude,
518
530
  longitude: destination.longitude,
519
- sourceLatitude: userLocation.latitude,
520
- sourceLongitude: userLocation.longitude,
531
+ sourceLatitude: parsedUserLocation.latitude,
532
+ sourceLongitude: parsedUserLocation.longitude,
521
533
  naverCallerName: 'com.deliveryapp',
522
534
  dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
523
535
  dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
@@ -539,8 +551,9 @@ export const DriverMap = (props: GoogleMapsParams) => {
539
551
  secondButton={true}
540
552
  firstColorCustom={theme.colors.red}
541
553
  secondColorCustom={theme.colors.green}
542
- widthButton={'45%'}
554
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
543
555
  isPadding
556
+ isHideRejectButtons={isHideRejectButtons}
544
557
  />
545
558
  )}
546
559
 
@@ -1,7 +1,7 @@
1
- import React, { useState } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import { RefreshControl, ScrollView, View } from 'react-native'
3
3
  import { OText } from '../shared'
4
- import { useLanguage, useSession } from 'ordering-components/native'
4
+ import { useLanguage, useSession, useUtils } from 'ordering-components/native'
5
5
  import { DayContainer } from './styles'
6
6
  import { useTheme } from 'styled-components/native'
7
7
  export const DriverSchedule = (props: any) => {
@@ -9,7 +9,9 @@ export const DriverSchedule = (props: any) => {
9
9
  const [, t] = useLanguage()
10
10
  const theme = useTheme()
11
11
  const [, { refreshUserInfo }] = useSession()
12
+ const [{ parseDate }] = useUtils()
12
13
  const [refreshing] = useState(false);
14
+ const [driverSchedule, setDriverSchedule] = useState([]);
13
15
 
14
16
  const daysOfWeek = [
15
17
  t('SUNDAY_ABBREVIATION', 'Sun'),
@@ -21,11 +23,43 @@ export const DriverSchedule = (props: any) => {
21
23
  t('SATURDAY_ABBREVIATION', 'Sat')
22
24
  ]
23
25
 
26
+ const getNextDate = (day) => {
27
+ const now = new Date()
28
+ now.setDate(now.getDate() + (day + (7 - now.getDay())) % 7)
29
+ return now
30
+ }
31
+
24
32
  const scheduleFormatted = ({ hour, minute }: any) => {
25
33
  const checkTime = (val: number) => val < 10 ? `0${val}` : val
26
34
  return `${checkTime(hour)}:${checkTime(minute)}`
27
35
  }
28
36
 
37
+ useEffect(() => {
38
+ if (schedule) {
39
+ setDriverSchedule(schedule)
40
+ } else {
41
+ const _schedule: any = []
42
+ for (let i = 0; i < 7; i++) {
43
+ _schedule.push({
44
+ enabled: true,
45
+ lapses: [
46
+ {
47
+ open: {
48
+ hour: 0,
49
+ minute: 0
50
+ },
51
+ close: {
52
+ hour: 23,
53
+ minute: 59
54
+ }
55
+ }
56
+ ]
57
+ })
58
+ }
59
+ setDriverSchedule(_schedule)
60
+ }
61
+ }, [schedule])
62
+
29
63
  return (
30
64
  <ScrollView
31
65
  refreshControl={<RefreshControl
@@ -37,22 +71,25 @@ export const DriverSchedule = (props: any) => {
37
71
  {t('SCHEDULE', 'Schedule')}
38
72
  </OText>
39
73
  <View style={{ padding: 30 }}>
40
- {schedule.map((item: any, i: number) => (
74
+ {driverSchedule.map((item: any, i: number) => (
41
75
  <DayContainer key={daysOfWeek[i]}>
42
- <OText style={{ width: '20%' }} size={22} weight={700}>{daysOfWeek[i]}</OText>
43
- <View style={{ width: '80%', alignItems: 'center' }}>
76
+ <View style={{ flex: 1 }}>
77
+ <OText size={22} weight={700}>{daysOfWeek[i]}</OText>
78
+ <OText size={14}>{parseDate(getNextDate(i), { outputFormat: 'YYYY-MM-DD' })}</OText>
79
+ </View>
80
+ <View style={{ flex: 1 }}>
44
81
  <>
45
82
  {item?.enabled ? (
46
- <View>
83
+ <View style={{ width: '100%' }}>
47
84
  {item?.lapses.map((lapse: any, i: number) => (
48
85
  <View key={`${daysOfWeek[i]}_${i}`} style={{ marginTop: 3, marginBottom: 20, flexDirection: 'row', justifyContent: 'space-between' }}>
49
- <OText size={18} style={{ width: '30%' }}>
86
+ <OText size={18} style={{ flex: 1 }}>
50
87
  {scheduleFormatted(lapse.open)}
51
88
  </OText>
52
89
  <OText size={18} style={{ width: 15 }}>
53
90
  -
54
91
  </OText>
55
- <OText size={18} style={{ width: '30%' }}>
92
+ <OText size={18} style={{ flex: 1, textAlign: 'right' }}>
56
93
  {scheduleFormatted(lapse.close)}
57
94
  </OText>
58
95
  </View>
@@ -25,6 +25,7 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
25
25
  secondButton,
26
26
  widthButton,
27
27
  isPadding,
28
+ isHideRejectButtons
28
29
  } = props;
29
30
 
30
31
  const theme = useTheme();
@@ -61,39 +62,41 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
61
62
  width: '100%',
62
63
  justifyContent: 'space-between',
63
64
  }}>
64
- <Button
65
- secondButton={secondButton}
66
- style={[
67
- {
68
- borderWidth: colorTxt1 ? 1 : 0,
69
- borderColor: colorTxt1 ? colorTxt1 : null,
70
- },
71
- secondButton
72
- ? { backgroundColor: firstColorCustom || styles.primaryBtn }
73
- : color
74
- ? { backgroundColor: color }
75
- : styles.primaryBtn,
76
- ,
77
- { width: widthButton },
78
- ]}
79
- onPress={firstButtonClick}
80
- disabled={disabled}>
81
- <OText color={theme.colors.white} size={16} mLeft={20}>
82
- {btnLeftValueShow ? btnLeftValue : ''}
83
- </OText>
65
+ {!isHideRejectButtons && (
66
+ <Button
67
+ secondButton={secondButton}
68
+ style={[
69
+ {
70
+ borderWidth: colorTxt1 ? 1 : 0,
71
+ borderColor: colorTxt1 ? colorTxt1 : null,
72
+ },
73
+ secondButton
74
+ ? { backgroundColor: firstColorCustom || styles.primaryBtn }
75
+ : color
76
+ ? { backgroundColor: color }
77
+ : styles.primaryBtn,
78
+ ,
79
+ { width: widthButton },
80
+ ]}
81
+ onPress={firstButtonClick}
82
+ disabled={disabled}>
83
+ <OText color={theme.colors.white} size={16} mLeft={20}>
84
+ {btnLeftValueShow ? btnLeftValue : ''}
85
+ </OText>
84
86
 
85
- <OText
86
- style={styles.btnTextStyle}
87
- color={colorTxt1 ? colorTxt1 : theme.colors.white}
88
- numberOfLines={2}
89
- adjustsFontSizeToFit>
90
- {btnText}
91
- </OText>
87
+ <OText
88
+ style={styles.btnTextStyle}
89
+ color={colorTxt1 ? colorTxt1 : theme.colors.white}
90
+ numberOfLines={2}
91
+ adjustsFontSizeToFit>
92
+ {btnText}
93
+ </OText>
92
94
 
93
- <OText color={theme.colors.white} size={16} mRight={20}>
94
- {btnRightValueShow ? btnRightValue : ''}
95
- </OText>
96
- </Button>
95
+ <OText color={theme.colors.white} size={16} mRight={20}>
96
+ {btnRightValueShow ? btnRightValue : ''}
97
+ </OText>
98
+ </Button>
99
+ )}
97
100
 
98
101
  {secondButton && (
99
102
  <Button
@@ -50,12 +50,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
50
50
  const ASPECT_RATIO = width / height;
51
51
  const [isMapReady, setIsMapReady] = useState(false);
52
52
  const [markerPosition, setMarkerPosition] = useState({
53
- latitude: locations ? locations[locations.length - 1].lat : location.lat,
54
- longitude: locations ? locations[locations.length - 1].lng : location.lng,
53
+ latitude: locations
54
+ ? typeof locations[locations.length - 1].lat === 'string' ? parseFloat(locations[locations.length - 1].lat) || 0 : locations[locations.length - 1].lat || 0
55
+ : typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
56
+ longitude: locations
57
+ ? typeof locations[locations.length - 1].lng === 'string' ? parseFloat(locations[locations.length - 1].lng) || 0 : locations[locations.length - 1].lng || 0
58
+ : typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0,
55
59
  });
56
60
  const [region, setRegion] = useState({
57
- latitude: location.lat,
58
- longitude: location.lng,
61
+ latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
62
+ longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0,
59
63
  latitudeDelta: 0.001,
60
64
  longitudeDelta: 0.001 * ASPECT_RATIO,
61
65
  });
@@ -78,12 +82,15 @@ export const GoogleMap = (props: GoogleMapsParams) => {
78
82
  let MARKERS =
79
83
  locations &&
80
84
  locations.map((location: { lat: number; lng: number; level: number }) => {
81
- return location.level === 4 && driverLocation?.lat
85
+ return location.level === 4 && driverLocation?.lat && driverLocation?.lng
82
86
  ? {
83
- latitude: driverLocation?.lat,
84
- longitude: driverLocation?.lng,
87
+ latitude: typeof driverLocation?.lat === 'string' ? parseFloat(driverLocation?.lat) || 0 : driverLocation?.lat,
88
+ longitude: typeof driverLocation?.lng === 'string' ? parseFloat(driverLocation?.lng) || 0 : driverLocation?.lng,
85
89
  }
86
- : { latitude: location.lat, longitude: location.lng };
90
+ : {
91
+ latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat,
92
+ longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng
93
+ };
87
94
  });
88
95
 
89
96
  const handleArrowBack: any = () => {
@@ -138,7 +138,10 @@ export const Home = (props: any) => {
138
138
  placeholder={t('PROJECT_NAME', 'Project Name')}
139
139
  icon={theme.images.general.project}
140
140
  iconColor={theme.colors.arrowColor}
141
- onChange={(e: any) => onChange(e?.target?.value)}
141
+ onChange={(e: any) => {
142
+ const project = e?.target?.value?.replace(/\s/g, '')
143
+ onChange(project)
144
+ }}
142
145
  selectionColor={theme.colors.primary}
143
146
  color={theme.colors.white}
144
147
  value={value}
@@ -148,6 +151,7 @@ export const Home = (props: any) => {
148
151
  autoCapitalize='none'
149
152
  blurOnSubmit={false}
150
153
  onSubmitEditing={() => handleSubmit(onSubmit)()}
154
+ isValueSync
151
155
  />
152
156
  )}
153
157
  />
@@ -25,8 +25,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
25
25
  value: language?.code,
26
26
  label: language?.name,
27
27
  inputLabel: language?.code.toUpperCase(),
28
- countryCode: langCountries.find(item => item.value == language?.code)
29
- ?.countryCode,
28
+ countryCode: langCountries.find(item => item.value == language?.code)?.countryCode,
30
29
  };
31
30
  });
32
31