ordering-ui-react-native 0.21.70 → 0.21.71-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 (165) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  10. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  11. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  12. package/themes/business/src/components/Chat/index.tsx +3 -1
  13. package/themes/business/src/components/DriverMap/index.tsx +33 -22
  14. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  15. package/themes/business/src/components/Home/index.tsx +5 -1
  16. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  17. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  18. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  19. package/themes/business/src/components/MapView/index.tsx +36 -17
  20. package/themes/business/src/components/NewOrderNotification/index.tsx +74 -24
  21. package/themes/business/src/components/OrderDetails/Business.tsx +63 -7
  22. package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -20
  23. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +110 -40
  24. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -35
  25. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  26. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  27. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  28. package/themes/business/src/components/OrdersListManager/index.tsx +9 -1
  29. package/themes/business/src/components/OrdersOption/index.tsx +250 -127
  30. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  31. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +28 -18
  33. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  34. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  35. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  36. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  37. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  40. package/themes/business/src/components/Sessions/index.tsx +187 -0
  41. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  42. package/themes/business/src/components/StoresList/index.tsx +2 -2
  43. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  44. package/themes/business/src/components/UserProfileForm/index.tsx +105 -53
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +4 -4
  46. package/themes/business/src/components/shared/OInput.tsx +2 -0
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +5 -4
  49. package/themes/business/src/types/index.tsx +21 -4
  50. package/themes/business/src/utils/index.tsx +19 -1
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +13 -1
  60. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  61. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  62. package/themes/original/src/components/AddressList/index.tsx +8 -7
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
  66. package/themes/original/src/components/BusinessController/index.tsx +12 -7
  67. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  68. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
  70. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  71. package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
  72. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
  73. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  74. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  75. package/themes/original/src/components/BusinessProductsListing/index.tsx +26 -11
  76. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  77. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  78. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +39 -12
  82. package/themes/original/src/components/CartContent/index.tsx +59 -44
  83. package/themes/original/src/components/Checkout/index.tsx +60 -29
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  91. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  92. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  93. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  94. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  95. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  96. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  97. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  98. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
  99. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  100. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  101. package/themes/original/src/components/Help/index.tsx +2 -0
  102. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  103. package/themes/original/src/components/Home/index.tsx +2 -10
  104. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  105. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  106. package/themes/original/src/components/MessageListing/index.tsx +1 -0
  107. package/themes/original/src/components/Messages/index.tsx +8 -7
  108. package/themes/original/src/components/MomentOption/index.tsx +13 -2
  109. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  110. package/themes/original/src/components/MultiCheckout/index.tsx +123 -62
  111. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  112. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -14
  113. package/themes/original/src/components/MyOrders/index.tsx +21 -26
  114. package/themes/original/src/components/NavBar/index.tsx +4 -2
  115. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  116. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  117. package/themes/original/src/components/OrderDetails/OrderEta.tsx +1 -1
  118. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
  119. package/themes/original/src/components/OrderDetails/index.tsx +28 -12
  120. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  121. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  122. package/themes/original/src/components/OrderSummary/index.tsx +23 -5
  123. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  124. package/themes/original/src/components/OrdersOption/index.tsx +2 -4
  125. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  126. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  127. package/themes/original/src/components/PaymentOptions/index.tsx +46 -5
  128. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  129. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  130. package/themes/original/src/components/ProductForm/ActionButton.tsx +16 -19
  131. package/themes/original/src/components/ProductForm/index.tsx +108 -105
  132. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
  133. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  134. package/themes/original/src/components/ProductOptionSubOption/index.tsx +8 -1
  135. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  136. package/themes/original/src/components/Promotions/index.tsx +6 -9
  137. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  138. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  139. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  140. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  141. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  142. package/themes/original/src/components/Sessions/index.tsx +3 -3
  143. package/themes/original/src/components/SignupForm/index.tsx +65 -67
  144. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
  145. package/themes/original/src/components/SingleProductCard/index.tsx +5 -6
  146. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  147. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  148. package/themes/original/src/components/StripeCardsList/index.tsx +10 -35
  149. package/themes/original/src/components/StripeElementsForm/index.tsx +78 -59
  150. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  151. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  152. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  153. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  154. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  155. package/themes/original/src/components/UserFormDetails/index.tsx +83 -84
  156. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  157. package/themes/original/src/components/Wallets/index.tsx +6 -3
  158. package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
  159. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  160. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  161. package/themes/original/src/components/shared/OButton.tsx +8 -7
  162. package/themes/original/src/components/shared/OInput.tsx +1 -4
  163. package/themes/original/src/types/index.tsx +5 -1
  164. package/themes/original/src/utils/index.tsx +12 -1
  165. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.21.70",
3
+ "version": "0.21.71-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -52,13 +52,13 @@
52
52
  "@segment/analytics-react-native": "2.1.11",
53
53
  "@segment/sovran-react-native": "0.2.6",
54
54
  "@sentry/react-native": "^2.6.0",
55
- "@stripe/stripe-react-native": "^0.2.0",
55
+ "@stripe/stripe-react-native": "0.23.0",
56
56
  "@types/react-native-loading-spinner-overlay": "^0.5.2",
57
57
  "@types/react-native-snap-carousel": "^3.8.4",
58
58
  "@types/styled-components": "^5.1.3",
59
59
  "axios": "^0.21.0",
60
60
  "moment": "^2.29.1",
61
- "ordering-components": "github:Ordering-Inc/ordering-components#development",
61
+ "ordering-components": "github:Ordering-Inc/ordering-components#release",
62
62
  "patch-package": "^6.4.7",
63
63
  "postinstall-postinstall": "^2.1.0",
64
64
  "prop-types": "^15.7.2",
@@ -76,7 +76,7 @@
76
76
  "react-native-color-matrix-image-filters": "^5.2.10",
77
77
  "react-native-country-picker-modal": "^2.0.0",
78
78
  "react-native-credit-card-input": "^0.4.1",
79
- "react-native-date-picker": "^4.2.13",
79
+ "react-native-date-picker": "4.2.14",
80
80
  "react-native-device-info": "^8.7.1",
81
81
  "react-native-document-picker": "^5.2.0",
82
82
  "react-native-elements": "^3.0.0-alpha.1",
@@ -86,12 +86,12 @@
86
86
  "react-native-gesture-handler": "^1.8.0",
87
87
  "react-native-get-random-values": "1.8.0",
88
88
  "react-native-gifted-chat": "^0.16.3",
89
- "react-native-google-places-autocomplete": "^2.1.3",
89
+ "react-native-google-places-autocomplete": "2.1.3",
90
90
  "react-native-html-to-pdf": "^0.10.0",
91
91
  "react-native-image-picker": "^4.0.6",
92
92
  "react-native-intersection-observer": "^0.0.9",
93
93
  "react-native-lightbox": "^0.8.1",
94
- "react-native-linear-gradient": "^2.5.6",
94
+ "react-native-linear-gradient": "2.7.3",
95
95
  "react-native-loading-spinner-overlay": "^2.0.0",
96
96
  "react-native-map-link": "^2.8.2",
97
97
  "react-native-maps": "^0.28.0",
@@ -102,7 +102,6 @@
102
102
  "react-native-phone-number-input": "^2.0.0",
103
103
  "react-native-picker-select": "^8.0.4",
104
104
  "react-native-print": "^0.9.0",
105
- "react-native-reanimated": "^1.13.1",
106
105
  "react-native-recaptcha-that-works": "^1.2.0",
107
106
  "react-native-restart": "^0.0.22",
108
107
  "react-native-safe-area-context": "^3.1.8",
@@ -7,7 +7,8 @@
7
7
  */
8
8
 
9
9
  import * as React from 'react';
10
- import { LogBox } from 'react-native';
10
+ import { LogBox, Platform } from 'react-native';
11
+ import * as Sentry from "@sentry/react-native";
11
12
  import { OrderingProvider } from 'ordering-components/native';
12
13
  import RNBootSplash from "react-native-bootsplash";
13
14
 
@@ -22,6 +23,47 @@ import theme from './theme.json';
22
23
  import AppContainer from './AppContainer';
23
24
  import { FacebookPixel } from './components/FacebookPixel';
24
25
 
26
+ Sentry.init({
27
+ environment: Platform.OS === 'ios' ? 'ios' : 'android',
28
+ dsn: 'https://e5e1115dc93b49109f4ab65f2098bef9@o460529.ingest.sentry.io/5722123',
29
+ release: 'ordering-ui-native@' + process.env.npm_package_version,
30
+ ignoreErrors: [
31
+ 'is not defined',
32
+ 'is not a function',
33
+ 'can\'t find variable',
34
+ 'objects are not valid',
35
+ 'element type is invalid',
36
+ 'requiring module',
37
+ 'has not been registered',
38
+ 'failed to connect to debugger!',
39
+ 'rendered more hooks than',
40
+ 'rendered fewer hooks than',
41
+ 'should have a queue',
42
+ 'the OS most likely terminated',
43
+ 'Connection timed out',
44
+ 'java.io.EOFException',
45
+ 'Abort',
46
+ 'Segfault',
47
+ 'Failed to allocate a',
48
+ 'Application Not Responding',
49
+ 'connection no longer valid',
50
+ 'IllegalInstruction',
51
+ 'React.Children.only expected to receive a single React element child.',
52
+ 'unrecognized selector sent to instance'
53
+ ],
54
+ tracesSampleRate: 0.2,
55
+ // Release health
56
+ enableAutoSessionTracking: true,
57
+ // Sessions close after app is 10 seconds in the background.
58
+ sessionTrackingIntervalMillis: 10000,
59
+
60
+ integrations: [
61
+ new Sentry.ReactNativeTracing({
62
+ routingInstrumentation: reactNavigationV5Instrumentation,
63
+ })
64
+ ]
65
+ });
66
+
25
67
  LogBox.ignoreLogs([
26
68
  'Sending \`onAnimatedValueUpdate` with no listeners registered.',
27
69
  'Non-serializable values were found in the navigation state.',
@@ -191,7 +191,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
191
191
  {isFarAway && (
192
192
  <FarAwayMessage style={styles.farAwayMsg}>
193
193
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
194
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
194
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
195
195
  </FarAwayMessage>
196
196
  )}
197
197
  </OrderControlContainer>
@@ -156,6 +156,7 @@ export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
156
156
  user_id: user?.id,
157
157
  user_name: user?.name
158
158
  },
159
+ xappx: ordering?.appId,
159
160
  currency: configs?.stripe_currency?.value || currency,
160
161
  userToken: token,
161
162
  clientId: webviewPaymethod?.credentials?.client_id,
@@ -3,7 +3,6 @@ import { useLanguage, useConfig, useOrder } from 'ordering-components/native'
3
3
  import { useGooglePay, useApplePay } from '@stripe/stripe-react-native'
4
4
  import { Platform } from 'react-native';
5
5
  import { StripeMethodFormParams } from '../../types';
6
- import { android_app_id } from '../../config.json'
7
6
 
8
7
  export const StripeMethodForm = (props: StripeMethodFormParams) => {
9
8
  const {
@@ -17,7 +16,9 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
17
16
  placeByMethodPay,
18
17
  methodPaySupported,
19
18
  setPlaceByMethodPay,
20
- cartTotal
19
+ cartTotal,
20
+ androidAppId,
21
+ businessNames
21
22
  } = props
22
23
  const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
23
24
  const { presentApplePay, isApplePaySupported } = useApplePay();
@@ -61,7 +62,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
61
62
  })
62
63
  const { error } = await initGooglePay({
63
64
  testEnv: devMode,
64
- merchantName: android_app_id,
65
+ merchantName: androidAppId,
65
66
  countryCode: 'US',
66
67
  billingAddressConfig: {
67
68
  format: 'FULL',
@@ -152,7 +153,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
152
153
 
153
154
  const { error, paymentMethod } = await presentApplePay({
154
155
  cartItems: [{
155
- label: t('CART', 'Cart'),
156
+ label: businessNames ? `${businessNames.join(', ')} ${t('VIA_CHEW_APP', 'via Chew App')}`
157
+ : `${cart?.business?.name} ${t('VIA_CHEW_APP', 'via Chew App')}`,
156
158
  amount: cartTotal?.toString?.() ?? cart?.balance?.toString() ?? cart?.total?.toString?.(),
157
159
  paymentType: 'Immediate'
158
160
  }],
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding: 0 43px;
5
+ padding: 0 30px;
6
6
  `
7
7
 
8
8
  export const CountDownContainer = styled.View`
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
20
20
  display: flex;
21
21
  flex-direction: row;
22
22
  justify-content: center;
23
- flex-wrap: wrap;
24
23
  `
25
24
 
26
25
  export const WrappCountdown = styled.View`
@@ -494,5 +494,7 @@ export interface StripeMethodFormParams {
494
494
  placeByMethodPay?: any
495
495
  methodPaySupported?: any,
496
496
  setPlaceByMethodPay?: any,
497
- cartTotal?: number
497
+ cartTotal?: number,
498
+ androidAppId?: string,
499
+ businessNames?: Array<string>
498
500
  }
@@ -29,6 +29,7 @@ import { OrderSummary } from './src/components/OrderSummary';
29
29
  import { PhoneInputNumber } from './src/components/PhoneInputNumber';
30
30
  import { PreviousMessages } from './src/components/PreviousMessages';
31
31
  import { PreviousOrders } from './src/components/PreviousOrders';
32
+ import { PrinterSettings } from './src/components/PrinterSettings';
32
33
  import { ProductItemAccordion } from './src/components/ProductItemAccordion';
33
34
  import { ReviewCustomer } from './src/components/ReviewCustomer'
34
35
  import { SearchBar } from './src/components/SearchBar';
@@ -43,6 +44,7 @@ import { NewOrderNotification } from './src/components/NewOrderNotification';
43
44
  import { DriverSchedule } from './src/components/DriverSchedule';
44
45
  import { ScheduleBlocked } from './src/components/ScheduleBlocked';
45
46
  import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
47
+ import { Sessions } from './src/components/Sessions';
46
48
  //OComponents
47
49
  import {
48
50
  OText,
@@ -102,10 +104,12 @@ export {
102
104
  PhoneInputNumber,
103
105
  PreviousMessages,
104
106
  PreviousOrders,
107
+ PrinterSettings,
105
108
  ProductItemAccordion,
106
109
  ReviewCustomer,
107
110
  SafeAreaContainerLayout,
108
111
  SearchBar,
112
+ Sessions,
109
113
  SignupForm,
110
114
  StoresList,
111
115
  UserFormDetailsUI,
@@ -31,6 +31,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
31
31
  notShowCustomerPhone,
32
32
  orderTitle,
33
33
  appTitle,
34
+ isLoadingOrder
34
35
  } = props;
35
36
 
36
37
  const [, t] = useLanguage();
@@ -277,7 +278,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
277
278
  }
278
279
 
279
280
  bodyToSend.id = orderId;
280
- handleUpdateOrder && handleUpdateOrder(bodyToSend.status, bodyToSend);
281
+ handleUpdateOrder?.(bodyToSend.status, bodyToSend);
281
282
  };
282
283
 
283
284
  useEffect(() => {
@@ -427,13 +428,15 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
427
428
  {action === 'accept' && (
428
429
  <View style={{ height: 300, justifyContent: 'center' }}>
429
430
  <Timer onPress={() => openTimerIOnput()}>
430
- <OText weight="600" style={{ textAlign: 'center' }} size={55}>
431
+ <OText weight="600" size={55}>
431
432
  {hour}
432
433
  </OText>
433
- {hour.length > 0 && <OText size={55}>:</OText>}
434
- <OText weight="600" style={{ textAlign: 'center' }} size={55}>
434
+ {hour.length > 0 && <OText size={55} style={{ marginBottom: 10 }}>:</OText>}
435
+ <OText weight="600" size={55}>
435
436
  {min}
436
437
  </OText>
438
+ {time?.length > 2 && <OText style={{ position: 'absolute', bottom: 60, left: 55 }}>{t('HOURS', 'Hours')}</OText>}
439
+ <OText style={{ position: 'absolute', bottom: 60, right: time?.length > 2 ? 55 : 95 }}>{t('MINUTES', 'Minutes')}</OText>
437
440
  </Timer>
438
441
  </View>
439
442
  )}
@@ -517,7 +520,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
517
520
  ...styles.bottomParent,
518
521
  marginBottom: Platform.OS === 'ios'
519
522
  ? 30 : (keyboardState.height === 0)
520
- ? isPage ? 0 : 30
523
+ ? isPage ? 0 : 40
521
524
  : keyboardState.height - (isPage ? 20 : -10)
522
525
  }}
523
526
  >
@@ -529,7 +532,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
529
532
  style={{ borderRadius: 7, height: 45 }}
530
533
  parentStyle={{ width: '100%' }}
531
534
  textStyle={{ color: '#FFF', fontSize: 18 }}
532
- isDisabled={showTextArea && !comments}
535
+ isDisabled={(showTextArea && !comments) || isLoadingOrder}
533
536
  onClick={() => handleAcceptOrReject()}
534
537
  />
535
538
  </View>
@@ -10,6 +10,7 @@ export const TopActions = styled.View`
10
10
  `
11
11
 
12
12
  export const Timer = styled.TouchableOpacity`
13
+ position: relative;
13
14
  padding: 40px;
14
15
  justify-content: center;
15
16
  flex-direction: row;
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, StyleSheet, ScrollView, Dimensions, TouchableOpacity } from 'react-native';
2
+ import { View, StyleSheet, ScrollView, Dimensions, TouchableOpacity, Platform } from 'react-native';
3
3
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { SearchBar } from '../SearchBar';
@@ -190,6 +190,7 @@ export const BusinessProductList = (props: any) => {
190
190
  const businessProductListProps = {
191
191
  ...props,
192
192
  UIComponent: BusinessProductListUI,
193
+ isIos: Platform.OS === 'ios'
193
194
  };
194
195
 
195
196
  return <StoreProductList {...businessProductListProps} />;
@@ -96,7 +96,9 @@ const ChatUI = (props: MessagesParams) => {
96
96
  20: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Order customer almost arrived to business'),
97
97
  21: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Order customer arrived to business'),
98
98
  22: t('ORDER_LOOKING_FOR_DRIVER', 'Order looking for driver'),
99
- 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
99
+ 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
100
+ 24: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
101
+ 25: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company')
100
102
  }
101
103
 
102
104
  const getLogisticTag = (status: any) => {
@@ -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;
@@ -70,11 +69,20 @@ export const DriverMap = (props: GoogleMapsParams) => {
70
69
  stopFollowUserLocation,
71
70
  } = useLocation();
72
71
 
73
- const origin = {
74
- latitude: initialPosition.latitude,
75
- 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
76
75
  };
77
- 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
+ }
78
86
 
79
87
  useEffect(() => {
80
88
  if (isToFollow) {
@@ -162,7 +170,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
162
170
  if (driverUpdateLocation.error) return;
163
171
 
164
172
  calculateDistance(
165
- { lat: userLocation.latitude, lng: userLocation.longitude },
173
+ { lat: parsedUserLocation.latitude, lng: parsedUserLocation.longitude },
166
174
  destination,
167
175
  );
168
176
  // geocodePosition(userLocation);
@@ -170,13 +178,13 @@ export const DriverMap = (props: GoogleMapsParams) => {
170
178
  if (!following.current) return;
171
179
  fitCoordinates();
172
180
 
173
- const { latitude, longitude } = userLocation;
181
+ const { latitude, longitude } = parsedUserLocation;
174
182
 
175
183
  mapRef.current?.animateCamera({
176
184
  center: { latitude, longitude },
177
185
  });
178
186
 
179
- }, [userLocation]);
187
+ }, [parsedUserLocation]);
180
188
 
181
189
  const handleArrowBack: any = () => {
182
190
  setDriverUpdateLocation?.({
@@ -242,8 +250,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
242
250
  [
243
251
  { latitude: location.lat, longitude: location.lng },
244
252
  {
245
- latitude: initialPosition.latitude,
246
- longitude: initialPosition.longitude,
253
+ latitude: parsedInitialPosition.latitude,
254
+ longitude: parsedInitialPosition.longitude,
247
255
  },
248
256
  ],
249
257
  {
@@ -256,7 +264,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
256
264
 
257
265
  useEffect(() => {
258
266
  const interval = setInterval(() => {
259
- if (initialPosition.latitude !== 0 && autoFit.current) {
267
+ if (parsedInitialPosition.latitude !== 0 && autoFit.current) {
260
268
  if (mapRef.current) {
261
269
  fitCoordinates();
262
270
  autoFit.current = false;
@@ -264,7 +272,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
264
272
  }
265
273
  }, 1000);
266
274
  return () => clearInterval(interval);
267
- }, [initialPosition]);
275
+ }, [parsedInitialPosition]);
268
276
 
269
277
  const fitCoordinatesZoom = () => {
270
278
  following.current = false;
@@ -347,8 +355,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
347
355
  ref={mapRef}
348
356
  provider={PROVIDER_GOOGLE}
349
357
  initialRegion={{
350
- latitude: initialPosition.latitude,
351
- longitude: initialPosition.longitude,
358
+ latitude: parsedInitialPosition.latitude,
359
+ longitude: parsedInitialPosition.longitude,
352
360
  latitudeDelta: 0.001,
353
361
  longitudeDelta: 0.001 * ASPECT_RATIO,
354
362
  }}
@@ -370,8 +378,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
370
378
  <>
371
379
  <Marker
372
380
  coordinate={{
373
- latitude: location.lat,
374
- longitude: location.lng,
381
+ latitude: typeof destination?.latitude !== 'object' ? destination?.latitude : 0,
382
+ longitude: typeof destination?.longitude !== 'object' ? destination?.latitude : 0
375
383
  }}
376
384
  title={location.title}>
377
385
  <Icon
@@ -388,7 +396,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
388
396
  />
389
397
  </View>
390
398
  </Marker>
391
- <Marker coordinate={userLocation}>
399
+ <Marker coordinate={{
400
+ latitude: typeof parsedUserLocation?.latitude !== 'object' ? parsedUserLocation?.latitude : 0,
401
+ longitude: typeof parsedUserLocation?.longitude !== 'object' ? parsedUserLocation?.latitude : 0
402
+ }}>
392
403
  <View style={styles.driverIcon}>
393
404
  <OIcon
394
405
  style={styles.image}
@@ -402,8 +413,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
402
413
  ) : (
403
414
  <Marker
404
415
  coordinate={{
405
- latitude: userLocation.latitude,
406
- longitude: userLocation.longitude,
416
+ latitude: typeof parsedUserLocation?.latitude !== 'object' ? parsedUserLocation?.latitude : 0,
417
+ longitude: typeof parsedUserLocation?.longitude !== 'object' ? parsedUserLocation?.latitude : 0
407
418
  }}
408
419
  title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
409
420
  />
@@ -517,8 +528,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
517
528
  options={{
518
529
  latitude: destination.latitude,
519
530
  longitude: destination.longitude,
520
- sourceLatitude: userLocation.latitude,
521
- sourceLongitude: userLocation.longitude,
531
+ sourceLatitude: parsedUserLocation.latitude,
532
+ sourceLongitude: parsedUserLocation.longitude,
522
533
  naverCallerName: 'com.deliveryapp',
523
534
  dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
524
535
  dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
@@ -540,7 +551,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
540
551
  secondButton={true}
541
552
  firstColorCustom={theme.colors.red}
542
553
  secondColorCustom={theme.colors.green}
543
- widthButton={isHideRejectButtons ? '100%': '45%'}
554
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
544
555
  isPadding
545
556
  isHideRejectButtons={isHideRejectButtons}
546
557
  />
@@ -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
 
@@ -50,7 +49,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
50
49
  },
51
50
  });
52
51
 
53
- return (
52
+ return !languagesState?.loading && languagesState?.languages?.length > 1 && (
54
53
  <Container style={{ backgroundColor: theme.colors.inputChat }}>
55
54
  {languagesState?.languages && (
56
55
  <CountryPicker