ordering-ui-react-native 0.21.99 → 0.22.0-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 (163) 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/StripeMethodForm/index.tsx +4 -2
  5. package/src/components/VerifyPhone/styles.tsx +1 -2
  6. package/src/context/OfflineActions/index.tsx +236 -0
  7. package/src/types/index.tsx +2 -1
  8. package/themes/business/index.tsx +2 -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/BusinessController/index.tsx +8 -3
  12. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  13. package/themes/business/src/components/Chat/index.tsx +15 -3
  14. package/themes/business/src/components/DriverMap/index.tsx +49 -27
  15. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  16. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  17. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  18. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  19. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  20. package/themes/business/src/components/MapView/index.tsx +36 -17
  21. package/themes/business/src/components/NewOrderNotification/index.tsx +40 -27
  22. package/themes/business/src/components/OrderDetails/Business.tsx +74 -9
  23. package/themes/business/src/components/OrderDetails/Delivery.tsx +138 -55
  24. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +125 -43
  25. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +62 -24
  26. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  27. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +221 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  29. package/themes/business/src/components/OrderSummary/index.tsx +210 -65
  30. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  31. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  32. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  33. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  35. package/themes/business/src/components/PreviousOrders/index.tsx +76 -66
  36. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  37. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  38. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  39. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  40. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  41. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  43. package/themes/business/src/components/StoresList/index.tsx +2 -2
  44. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  45. package/themes/business/src/components/UserProfileForm/index.tsx +43 -25
  46. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +2 -2
  49. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  50. package/themes/business/src/types/index.tsx +15 -5
  51. package/themes/business/src/utils/index.tsx +25 -1
  52. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  53. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  54. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  55. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  56. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  57. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  58. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/original/index.tsx +11 -0
  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 +5 -8
  66. package/themes/original/src/components/BusinessController/index.tsx +5 -5
  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 +44 -32
  72. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  73. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  74. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  75. package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
  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 +38 -14
  82. package/themes/original/src/components/CartContent/index.tsx +2 -4
  83. package/themes/original/src/components/Checkout/index.tsx +100 -58
  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/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  94. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  95. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  96. package/themes/original/src/components/Help/index.tsx +2 -0
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  98. package/themes/original/src/components/Home/index.tsx +3 -11
  99. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  100. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  101. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  102. package/themes/original/src/components/Messages/index.tsx +29 -17
  103. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  104. package/themes/original/src/components/MomentOption/index.tsx +79 -56
  105. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  106. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  107. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  108. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  109. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  110. package/themes/original/src/components/NavBar/index.tsx +7 -4
  111. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  112. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  113. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  114. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
  115. package/themes/original/src/components/OrderDetails/index.tsx +42 -19
  116. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  117. package/themes/original/src/components/OrderProgress/index.tsx +5 -4
  118. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  119. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  120. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  121. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  123. package/themes/original/src/components/PaymentOptions/index.tsx +10 -8
  124. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  125. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  126. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  127. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  128. package/themes/original/src/components/ProductItemAccordion/index.tsx +51 -44
  129. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  130. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  131. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  132. package/themes/original/src/components/Promotions/index.tsx +6 -9
  133. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  134. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  135. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  136. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  137. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  138. package/themes/original/src/components/Sessions/index.tsx +3 -3
  139. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  140. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  141. package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
  142. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  143. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  144. package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
  145. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  146. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  147. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  148. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  149. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  150. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  151. package/themes/original/src/components/UserDetails/index.tsx +3 -2
  152. package/themes/original/src/components/UserFormDetails/index.tsx +154 -130
  153. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  154. package/themes/original/src/components/UserVerification/index.tsx +14 -4
  155. package/themes/original/src/components/Wallets/index.tsx +6 -3
  156. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  157. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  158. package/themes/original/src/components/shared/OButton.tsx +5 -4
  159. package/themes/original/src/components/shared/OInput.tsx +4 -8
  160. package/themes/original/src/components/shared/OModal.tsx +7 -2
  161. package/themes/original/src/types/index.tsx +5 -1
  162. package/themes/original/src/utils/index.tsx +30 -1
  163. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -11,7 +11,8 @@ import {
11
11
  useToast,
12
12
  useLanguage,
13
13
  useUtils,
14
- useConfig
14
+ useConfig,
15
+ useValidationFields
15
16
  } from 'ordering-components/native';
16
17
  import {
17
18
  CenterView,
@@ -24,6 +25,7 @@ import { LogoutButton } from '../LogoutButton';
24
25
  import { LanguageSelector } from '../LanguageSelector';
25
26
  import { UserFormDetailsUI } from '../UserFormDetails';
26
27
  import { DriverSchedule } from '../DriverSchedule'
28
+ import { PrinterSettings } from '../PrinterSettings'
27
29
  import ToggleSwitch from 'toggle-switch-react-native';
28
30
  import { UDWrapper } from '../UserFormDetails/styles';
29
31
  import {
@@ -56,11 +58,12 @@ const ProfileUI = (props: ProfileParams) => {
56
58
  const [, t] = useLanguage();
57
59
  const [, { showToast }] = useToast();
58
60
  const [{ optimizeImage }] = useUtils();
59
- const [{ configs }] = useConfig()
61
+ const [{ configs }] = useConfig();
62
+ const [{ loading }, { loadOriginalValidationFields }] = useValidationFields()
60
63
  const { errors } = useForm();
61
64
  const theme = useTheme();
62
65
 
63
- const [phoneInputData, setPhoneInputData] = useState({
66
+ const [phoneInputData, setPhoneInputData] = useState<any>({
64
67
  error: '',
65
68
  phone: {
66
69
  country_phone_code: null,
@@ -75,11 +78,8 @@ const ProfileUI = (props: ProfileParams) => {
75
78
  const allowDriverUpdateData = user?.level !== 4 || configs?.allow_driver_update_data?.value === "1"
76
79
  useEffect(() => {
77
80
  if (phoneInputData.phone.cellphone) {
78
- const codeNumberPhone = phoneInputData.phone.cellphone.slice(0, 3);
79
- const numberPhone = phoneInputData.phone.cellphone.slice(
80
- 3,
81
- phoneInputData.phone.cellphone?.length,
82
- );
81
+ const codeNumberPhone = phoneInputData.phone.country_phone_code
82
+ const numberPhone = phoneInputData.phone.cellphone
83
83
  setPhoneToShow(`(${codeNumberPhone}) ${numberPhone}`);
84
84
  }
85
85
  }, [phoneInputData.phone.cellphone]);
@@ -261,15 +261,17 @@ const ProfileUI = (props: ProfileParams) => {
261
261
 
262
262
  return (
263
263
  <>
264
- {validationFields?.error && (
264
+ {validationFields?.error && !loading && (
265
265
  <NotFoundSource
266
266
  content={
267
- validationFields?.error[0] ||
268
- validationFields?.error[0]?.message ||
267
+ validationFields?.error?.[0] ||
268
+ validationFields?.error?.[0]?.message ||
269
269
  t('NETWORK_ERROR', 'Network Error')
270
270
  }
271
271
  image={theme.images.general.notFound}
272
272
  conditioned={false}
273
+ onClickButton={() => loadOriginalValidationFields({ forceLoading: true })}
274
+ btnTitle={t('REFRESH_PROFILE', 'Refresh profile')}
273
275
  />
274
276
  )}
275
277
 
@@ -462,7 +464,6 @@ const ProfileUI = (props: ProfileParams) => {
462
464
  />
463
465
 
464
466
  <OText style={styles.label}>{t('PHONE', 'Phone')}</OText>
465
-
466
467
  <OInput
467
468
  isSecured={true}
468
469
  placeholder={
@@ -485,10 +486,11 @@ const ProfileUI = (props: ProfileParams) => {
485
486
  handleCancelEdit={handleCancelEdit}
486
487
  toggleIsEdit={toggleIsEdit}
487
488
  isAlsea={isAlsea}
489
+ allowDriverUpdateData={allowDriverUpdateData}
488
490
  />
489
491
  </View>
490
492
  )}
491
- {!validationFields.loading && !isEdit && allowDriverUpdateData && (
493
+ {!validationFields.loading && !isEdit && (
492
494
  <EditButton>
493
495
  <OButton
494
496
  text={t('EDIT', 'Edit')}
@@ -502,17 +504,31 @@ const ProfileUI = (props: ProfileParams) => {
502
504
  />
503
505
  </EditButton>
504
506
  )}
505
- <Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
506
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
507
- <OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
508
- <AntDesignIcon size={18} name='right' />
509
- </View>
510
- <View style={{
511
- borderBottomColor: theme.colors.tabBar,
512
- borderBottomWidth: 1,
513
- marginTop: 10
514
- }} />
515
- </Pressable>
507
+ {!props.isBusinessApp ? (
508
+ <Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
509
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
510
+ <OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
511
+ <AntDesignIcon size={18} name='right' />
512
+ </View>
513
+ <View style={{
514
+ borderBottomColor: theme.colors.tabBar,
515
+ borderBottomWidth: 1,
516
+ marginTop: 10
517
+ }} />
518
+ </Pressable>
519
+ ) : (
520
+ <Pressable style={{ marginBottom: 10 }} onPress={() => navigation.navigate('PrinterSetup')}>
521
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
522
+ <OText size={16}>{t('PRINTER_SETTINGS', 'Printer Settings')}</OText>
523
+ <AntDesignIcon size={18} name='right' />
524
+ </View>
525
+ <View style={{
526
+ borderBottomColor: theme.colors.tabBar,
527
+ borderBottomWidth: 1,
528
+ marginTop: 10
529
+ }} />
530
+ </Pressable>
531
+ )}
516
532
  <Pressable style={{ marginBottom: 10 }} onPress={() => navigation.navigate('Sessions')}>
517
533
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
518
534
  <OText size={16}>{t('SESSIONS', 'Sessions')}</OText>
@@ -535,7 +551,9 @@ const ProfileUI = (props: ProfileParams) => {
535
551
  entireModal
536
552
  hideIcons
537
553
  >
538
- <DriverSchedule schedule={user?.schedule} />
554
+ {!props.isBusinessApp && (
555
+ <DriverSchedule schedule={user?.schedule} />
556
+ )}
539
557
  </OModal>
540
558
  </ScrollView>
541
559
  )}
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import { useLanguage, useUtils, WebsocketStatus as WebsocketStatusController } from 'ordering-components/native'
3
- import { TouchableOpacity, View, StyleSheet } from 'react-native'
3
+ import { TouchableOpacity, View, StyleSheet, Platform } from 'react-native'
4
4
  import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
5
5
  import { useTheme } from 'styled-components/native'
6
6
  import RNRestart from 'react-native-restart'
@@ -37,7 +37,7 @@ const SocketStatusUI = (props: any) => {
37
37
  paddingLeft: 0,
38
38
  paddingRight: 0,
39
39
  marginBottom: 30,
40
- marginTop: 30
40
+ marginTop: Platform.OS === 'ios' ? 60 : 30
41
41
  },
42
42
  })
43
43
 
@@ -4,8 +4,10 @@ import { useTheme } from 'styled-components/native';
4
4
 
5
5
  const Wrapper = styled.View`
6
6
  border-radius: 10px;
7
- border: 1px solid ${(props: any) => props.theme.colors.lightGray};
7
+ border-width: 1px;
8
+ border-color: ${(props: any) => props.theme.colors.lightGray};
8
9
  `;
10
+
9
11
  const Inner = styled.TextInput`
10
12
  height: 100px;
11
13
  padding: 5px 10px 5px 10px;
@@ -29,16 +31,13 @@ const OTextarea = (props: Props) => {
29
31
  ref={props.textTareaRef}
30
32
  onFocus={() => props.onFocus()}
31
33
  onChangeText={(txt: any) => props.onChange(txt)}
32
- textAlignVertical={'top'}
33
34
  placeholder={props.placeholder}
34
- placeholderTextColor={theme.colors.arrowColor}
35
- numberOfLines={props.lines}
36
- underlineColorAndroid={'transparent'}
37
- value={props.value}
35
+ placeholderTextColor={theme.colors.lightGray}
36
+ numberOfLines={props.lines}
37
+ underlineColorAndroid={'transparent'}
38
+ value={props.value}
39
+ multiline={true}
38
40
  autoFocus={props.autoFocus}
39
- multiline={true}
40
- selectionColor={theme.colors.primary}
41
- color={theme.colors.textGray}
42
41
  />
43
42
  </Wrapper>
44
43
  );
@@ -48,8 +48,8 @@ export const useLocation = () => {
48
48
  GeoLocation.getCurrentPosition(
49
49
  ({ coords }) => {
50
50
  resolve({
51
- latitude: typeof coords.latitude !== 'number' && !Number.isNaN(coords.latitude) ? coords.latitude : 0,
52
- longitude: typeof coords.longitude !== 'number' && !Number.isNaN(coords.longitude) ? coords.longitude : 0,
51
+ latitude: typeof coords.latitude === 'number' && !Number.isNaN(coords.latitude) ? coords.latitude : 0,
52
+ longitude: typeof coords.longitude === 'number' && !Number.isNaN(coords.longitude) ? coords.longitude : 0,
53
53
  speed: coords.speed,
54
54
  });
55
55
  },
@@ -1,12 +1,12 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import {
3
3
  Dimensions,
4
4
  Platform,
5
5
  StatusBar,
6
- StyleSheet,
7
6
  View,
8
7
  } from 'react-native';
9
- import styled from 'styled-components/native';
8
+ import styled, { useTheme } from 'styled-components/native';
9
+ import { useNetInfo } from '@react-native-community/netinfo';
10
10
 
11
11
  export const SafeAreaContainer = styled.SafeAreaView`
12
12
  flex: 1;
@@ -14,6 +14,10 @@ export const SafeAreaContainer = styled.SafeAreaView`
14
14
  `;
15
15
 
16
16
  export const SafeAreaContainerLayout = (props: any) => {
17
+ const theme = useTheme();
18
+ const netInfo = useNetInfo()
19
+
20
+ const [statusColor, setStatusColor] = useState<string | null>(null)
17
21
  const [orientation, setOrientation] = useState(
18
22
  Dimensions.get('window').width < Dimensions.get('window').height
19
23
  ? 'Portrait'
@@ -28,22 +32,34 @@ export const SafeAreaContainerLayout = (props: any) => {
28
32
  }
29
33
  });
30
34
 
35
+ useEffect(() => {
36
+ if (netInfo.isConnected === false) {
37
+ setStatusColor(theme.colors.danger500)
38
+ }
39
+
40
+ if (netInfo.isConnected && statusColor) {
41
+ setStatusColor(theme.colors.success500)
42
+ setTimeout(() => {
43
+ setStatusColor(null)
44
+ }, 2000);
45
+ }
46
+ }, [netInfo.isConnected])
47
+
31
48
  return (
32
- <>
33
- <SafeAreaContainer>
34
- <View
35
- style={{
36
- paddingHorizontal: 30,
37
- paddingTop: 30,
38
- paddingBottom: 0,
39
- flex: 1,
40
- }}>
41
- <StatusBar
42
- barStyle={Platform.OS === 'ios' ? 'dark-content' : 'default'}
43
- />
44
- {props.children}
45
- </View>
46
- </SafeAreaContainer>
47
- </>
49
+ <SafeAreaContainer>
50
+ <View
51
+ style={{
52
+ paddingHorizontal: 30,
53
+ paddingTop: 0,
54
+ paddingBottom: 0,
55
+ flex: 1,
56
+ }}>
57
+ <StatusBar
58
+ barStyle={Platform.OS === 'ios' ? 'dark-content' : 'default'}
59
+ {...statusColor && ({ backgroundColor: statusColor })}
60
+ />
61
+ {props.children}
62
+ </View>
63
+ </SafeAreaContainer>
48
64
  );
49
65
  };
@@ -59,6 +59,7 @@ export interface ProfileParams {
59
59
  isAlsea?: boolean;
60
60
  isShowDriverStatus?: boolean;
61
61
  isFocused?: boolean;
62
+ isBusinessApp?: boolean;
62
63
  }
63
64
 
64
65
  export interface AddressListParams {
@@ -310,9 +311,9 @@ export interface OrdersOptionParams {
310
311
  cancelled?: Array<number>;
311
312
  };
312
313
  isBusinessApp?: boolean;
313
- handleClickLogisticOrder: (status: number, orderId: number) => void,
314
- logisticOrders: { orders: Array<any>, loading: boolean, error: Array<string> | string },
315
- loadLogisticOrders: () => void;
314
+ handleClickLogisticOrder?: (status: number, orderId: number) => void,
315
+ logisticOrders?: { orders: Array<any>, loading: boolean, error: Array<string> | string },
316
+ loadLogisticOrders?: () => void;
316
317
  isLogisticActivated?: boolean;
317
318
  isAlsea?: boolean;
318
319
  checkNotification?: boolean;
@@ -320,6 +321,10 @@ export interface OrdersOptionParams {
320
321
  handleChangeOrderStatus?: () => void;
321
322
  handleSendCustomerReview?: () => void;
322
323
  orderDetailsProps?: any;
324
+ isNetConnected?: boolean;
325
+ isDriverApp?: boolean;
326
+ combineTabs?: boolean;
327
+ setCombineTabsState?: any;
323
328
  }
324
329
  export interface ActiveOrdersParams {
325
330
  orders?: any;
@@ -391,7 +396,7 @@ export interface OrderDetailsParams {
391
396
  urlToShare?: string;
392
397
  messages?: any;
393
398
  handleAssignDriver?: (id: any) => {};
394
- handleChangeOrderStatus?: (status: any) => {};
399
+ handleChangeOrderStatus?: (status: any, isAcceptOrReject: any) => {};
395
400
  order?: any;
396
401
  isFromRoot?: any;
397
402
  handleOrderRedirect?: () => {};
@@ -410,6 +415,8 @@ export interface OrderDetailsParams {
410
415
  orderTitle?: any;
411
416
  forceUpdate?: number;
412
417
  getPermissions?: any
418
+ loadMessages?: any;
419
+ notificationApp?: string
413
420
  }
414
421
  export interface ProductItemAccordionParams {
415
422
  isCartPending?: boolean;
@@ -445,6 +452,7 @@ export interface MessagesParams {
445
452
  sendMessage?: any;
446
453
  canRead?: any;
447
454
  setCanRead?: any;
455
+ notificationApp?: string
448
456
  handleSend?: () => {};
449
457
  setImage?: (image: string | null) => {};
450
458
  setMessage?: (comment: string) => {};
@@ -495,7 +503,8 @@ export interface FloatingButtonParams {
495
503
  firstColorCustom?: string;
496
504
  secondColorCustom?: string;
497
505
  paddingBottomIos?: any;
498
- isHideRejectButtons?: boolean
506
+ isHideRejectButtons?: boolean;
507
+ principalButtonColor?: string;
499
508
  }
500
509
  export interface MomentOptionParams {
501
510
  navigation: any;
@@ -596,6 +605,7 @@ export interface AcceptOrRejectOrderParams {
596
605
  isPage?: boolean
597
606
  navigation?: any
598
607
  route?: any
608
+ isLoadingOrder?: boolean
599
609
  }
600
610
 
601
611
  export interface MapViewParams {
@@ -39,7 +39,8 @@ export const getTraduction = (key: string, t: any) => {
39
39
  ERROR_USER_UPDATE_YOU_HAVE_ASSIGNED_ORDERS:
40
40
  "You can't because you have assigned orders",
41
41
  ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
42
- ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation'
42
+ ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation',
43
+ ERROR_DRIVER_UPDATE_SCHEDULE: 'Error driver update schedule',
43
44
  };
44
45
 
45
46
  return keyList[key] ? t(key, keyList[key]) : t(key);
@@ -146,6 +147,11 @@ export const transformCountryCode = (countryCode: number) => {
146
147
  return code?.countryCode;
147
148
  };
148
149
 
150
+ export const findExitingCode = (countryCode: string) => {
151
+ const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
152
+ return code?.countryCode
153
+ }
154
+
149
155
  /**
150
156
  * Function to check if a number is decimal or not
151
157
  * @param {*} value number to check if decimal or not
@@ -338,6 +344,24 @@ export const getOrderStatus = (s: string, t: any) => {
338
344
  value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
339
345
  slug: 'ORDER_DRIVER_ON_WAY',
340
346
  percentage: 45
347
+ },
348
+ {
349
+ key: 24,
350
+ value: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
351
+ slug: 'ORDER_DRIVER_WAITING_FOR_ORDER',
352
+ percentage: 25
353
+ },
354
+ {
355
+ key: 25,
356
+ value: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company'),
357
+ slug: 'ORDER_ACCEPTED_BY_DRIVER_COMPANY',
358
+ percentage: 25
359
+ },
360
+ {
361
+ key: 26,
362
+ value: t('ORDER_DRIVER_ARRIVED_CUSTOMER', 'Driver arrived to customer'),
363
+ slug: 'ORDER_DRIVER_ARRIVED_CUSTOMER',
364
+ percentage: 80
341
365
  }
342
366
  ];
343
367
 
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
197
197
  {isFarAway && (
198
198
  <FarAwayMessage style={styles.farAwayMsg}>
199
199
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
201
201
  </FarAwayMessage>
202
202
  )}
203
203
  {!auth && (
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
410
410
  textInputProps={{
411
411
  returnKeyType: 'next',
412
412
  onSubmitEditing: () => inputRef?.current?.focus?.(),
413
- style: { borderWidth: 0, fontSize: 12 },
414
- maxLength: 10
413
+ style: { borderWidth: 0, fontSize: 12 }
415
414
  }}
416
415
  textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
417
416
  />
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
155
155
  {isFarAway && (
156
156
  <FarAwayMessage style={styles.farAwayMsg}>
157
157
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
159
159
  </FarAwayMessage>
160
160
  )}
161
161
  <View style={styles.wrapperOrderOptions}>
@@ -50,6 +50,12 @@ const CheckoutUI = (props: any) => {
50
50
  }
51
51
  }, [cart])
52
52
 
53
+ useEffect(() => {
54
+ if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
55
+ navigation?.canGoBack() && navigation.goBack()
56
+ }
57
+ }, [cart])
58
+
53
59
  return (
54
60
  <>
55
61
  <PaymentOptions
@@ -4,6 +4,7 @@ import { OIcon, OButton, OText } from '../shared'
4
4
  import { ImageStyle, TextStyle, View, Platform, TouchableOpacity } from 'react-native'
5
5
  import { useConfig, useLanguage, useOrder } from 'ordering-components/native'
6
6
  import { useTheme } from 'styled-components/native'
7
+
7
8
  const Wrapper = styled.View`
8
9
  background-color: ${(props: any) => props.theme.colors.white};
9
10
  padding: 10px 0px 20px 0px;
@@ -65,28 +66,27 @@ const NavBar = (props: Props) => {
65
66
 
66
67
  return (
67
68
  <Wrapper style={{ paddingTop: props.paddingTop, ...props.style }}>
68
- {(props?.onActionLeft) && (
69
+ {(props?.onActionLeft || props?.leftImg) && (
69
70
  <OButton
70
- imgLeftSrc={props.leftImg}
71
+ imgLeftSrc={props.leftImg || theme.images.general.arrow_left}
71
72
  imgRightSrc={null}
72
73
  style={{ ...btnBackArrow, ...props.btnStyle }}
73
74
  onClick={props.onActionLeft}
74
- imgLeftStyle={props.imgLeftStyle}
75
- {...(!props.leftImg && { iconProps: { name: 'arrowleft', size: 28, color: props.btnStyle?.color } })}
75
+ imgLeftStyle= {props.imgLeftStyle}
76
76
  />)
77
77
  }
78
78
  <TitleTopWrapper>
79
79
  {props.withIcon
80
80
  ? (
81
- <OIcon
82
- url={props.icon}
83
- style={{
84
- borderColor: theme.colors.lightGray,
85
- borderRadius: 20,
86
- }}
87
- width={60}
88
- height={60}
89
- />
81
+ <OIcon
82
+ url={props.icon}
83
+ style={{
84
+ borderColor: theme.colors.lightGray,
85
+ borderRadius: 20,
86
+ }}
87
+ width={60}
88
+ height={60}
89
+ />
90
90
  )
91
91
  : null
92
92
  }
@@ -134,7 +134,7 @@ const NavBar = (props: Props) => {
134
134
  </View>
135
135
  )}
136
136
 
137
- {props.rightComponent}
137
+ { props.rightComponent }
138
138
  </Wrapper>
139
139
  )
140
140
  }
@@ -95,7 +95,7 @@ interface Props {
95
95
  style?: ViewStyle;
96
96
  bgImage: ImageSourcePropType;
97
97
  innerStyle?: ViewStyle;
98
- icon?: ImageSourcePropType;
98
+ icon: ImageSourcePropType;
99
99
  iconStyle?: ImageStyle;
100
100
  callToActionText: string;
101
101
  callToActionTextStyle?: TextStyle;
@@ -15,8 +15,6 @@ import { Container } from '../../layouts/Container'
15
15
  import NavBar from '../NavBar'
16
16
  import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation'
17
17
  import GridContainer from '../../layouts/GridContainer'
18
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
19
- import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
20
18
 
21
19
  const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
22
20
  const {
@@ -29,7 +27,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
29
27
  callback
30
28
  } = props
31
29
 
32
- const theme = useTheme();
30
+ const theme = useTheme();
33
31
  const [, t] = useLanguage();
34
32
  const [orientationState] = useDeviceOrientation();
35
33
  const [orderState] = useOrder()
@@ -47,7 +45,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
47
45
  }
48
46
 
49
47
  useEffect(() => {
50
- if (isCardCliked) {
48
+ if(isCardCliked){
51
49
  callback?.()
52
50
  setIsCardClicked(false)
53
51
  setIsLoadingCard(null)
@@ -85,13 +83,13 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
85
83
  style={cardStyle}
86
84
  isDisabled={isCardCliked}
87
85
  isLoading={isLoadingCard === 'Eat In'}
88
- title={t('EAT_IN', 'Eat In')}
86
+ title={t('EAT_IN','Eat In')}
89
87
  description={t('EAT_IN_DESCRIPTION', 'We are very glad to have you here. Bon appetit!')}
90
88
  bgImage={theme.images.general.eatIn}
91
- VectorIcon={() => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />}
89
+ icon={theme.images.general.pushPin}
92
90
  callToActionText={t('START_MY_ORDER', 'Start my order')}
93
91
  onClick={() => {
94
- if (_eatIn?.value !== orderState?.options?.type) {
92
+ if(_eatIn?.value !== orderState?.options?.type){
95
93
  handleChangeOrderType(_eatIn?.value);
96
94
  setIsCardClicked(true)
97
95
  setIsLoadingCard('Eat In')
@@ -108,15 +106,15 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
108
106
 
109
107
  <OptionCard
110
108
  style={cardStyle}
111
- title={t('TAKE_OUT', 'Take out')}
109
+ title={t('TAKE_OUT','Take out')}
112
110
  isDisabled={isCardCliked}
113
111
  isLoading={isLoadingCard === 'Take out'}
114
112
  description={t('TAKE_OUT_DESCRIPTION', 'You are very welcome anytime you visit us!')}
115
113
  bgImage={theme.images.general.takeOut}
116
- VectorIcon={() => <AntDesignIcon name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} />}
114
+ icon={theme.images.general.shoppingCart}
117
115
  callToActionText={t('START_MY_ORDER', 'Start my order')}
118
116
  onClick={() => {
119
- if (_takeOut?.value !== orderState?.options?.type) {
117
+ if(_takeOut?.value !== orderState?.options?.type){
120
118
  handleChangeOrderType(_takeOut?.value);
121
119
  setIsCardClicked(true)
122
120
  setIsLoadingCard('Take out')
@@ -10,8 +10,6 @@ import {
10
10
 
11
11
  import * as React from 'react';
12
12
  import styled from 'styled-components/native';
13
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
14
- import { Icon, IconProps } from 'react-native-vector-icons/Icon';
15
13
 
16
14
  const StyledButton = styled.View<Props>`
17
15
  background-color: ${(props: any) => props.theme.colors.primary};
@@ -79,19 +77,17 @@ interface Props {
79
77
  isCircle?: boolean;
80
78
  bgColor?: string;
81
79
  borderColor?: string;
82
- iconProps?: IconProps;
83
- IconCustom?: React.FunctionComponent
84
80
  }
85
81
 
86
82
  const OButton = (props: Props): React.ReactElement => {
87
83
  if (props.isDisabled) {
88
84
  return (
89
85
  <View style={props.parentStyle}>
90
- <StyledButtonDisabled style={props.style}>
91
- <StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
92
- {props.text}
93
- </StyledTextDisabled>
94
- </StyledButtonDisabled>
86
+ <StyledButtonDisabled style={props.style}>
87
+ <StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
88
+ {props.text}
89
+ </StyledTextDisabled>
90
+ </StyledButtonDisabled>
95
91
  </View>
96
92
  );
97
93
  }
@@ -115,15 +111,6 @@ const OButton = (props: Props): React.ReactElement => {
115
111
  {props.imgLeftSrc ? (
116
112
  <StyledImage style={props.imgLeftStyle} source={props.imgLeftSrc} />
117
113
  ) : null}
118
- {props.iconProps ? (
119
- <>
120
- {props?.IconCustom ? (
121
- <props.IconCustom {...props.iconProps} />
122
- ) : (
123
- <AntDesignIcon {...props.iconProps} />
124
- )}
125
- </>
126
- ) : null}
127
114
  {props.text ? (
128
115
  <StyledText style={props.textStyle}>{props.text}</StyledText>
129
116
  ) : null}