ordering-ui-react-native 0.15.49 → 0.15.50-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 (188) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/AddressForm/index.tsx +18 -2
  4. package/src/components/BusinessController/index.tsx +16 -8
  5. package/src/components/BusinessTypeFilter/index.tsx +3 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Checkout/index.tsx +23 -2
  8. package/src/components/DriverTips/index.tsx +11 -6
  9. package/src/components/LanguageSelector/index.tsx +7 -2
  10. package/src/components/LoginForm/index.tsx +120 -30
  11. package/src/components/LoginForm/styles.tsx +6 -0
  12. package/src/components/OrderDetails/index.tsx +9 -23
  13. package/src/components/PaymentOptions/index.tsx +1 -1
  14. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  15. package/src/components/SignupForm/index.tsx +145 -61
  16. package/src/components/SingleProductCard/index.tsx +16 -4
  17. package/src/components/StripeMethodForm/index.tsx +1 -2
  18. package/src/components/UpsellingProducts/index.tsx +1 -1
  19. package/src/components/UserProfileForm/index.tsx +63 -6
  20. package/src/components/UserProfileForm/styles.tsx +8 -0
  21. package/src/components/VerifyPhone/styles.tsx +1 -2
  22. package/src/components/shared/OModal.tsx +1 -1
  23. package/src/hooks/useCountdownTimer.tsx +26 -0
  24. package/src/navigators/CheckoutNavigator.tsx +6 -0
  25. package/src/navigators/HomeNavigator.tsx +12 -0
  26. package/src/pages/BusinessesListing.tsx +1 -1
  27. package/src/pages/MultiCheckout.tsx +31 -0
  28. package/src/pages/MultiOrdersDetails.tsx +27 -0
  29. package/src/pages/Sessions.tsx +22 -0
  30. package/src/theme.json +0 -1
  31. package/src/types/index.tsx +18 -11
  32. package/src/utils/index.tsx +68 -1
  33. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  34. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  35. package/themes/business/src/components/Chat/index.tsx +42 -90
  36. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  37. package/themes/business/src/components/Home/index.tsx +128 -55
  38. package/themes/business/src/components/Home/styles.tsx +8 -1
  39. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  40. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  41. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  42. package/themes/business/src/components/NewOrderNotification/index.tsx +79 -105
  43. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  44. package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -18
  45. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +159 -91
  46. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  47. package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
  48. package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
  49. package/themes/business/src/components/OrdersOption/index.tsx +5 -2
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  51. package/themes/business/src/components/shared/OModal.tsx +1 -1
  52. package/themes/business/src/types/index.tsx +5 -1
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/BusinessMenu/index.tsx +39 -28
  57. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  58. package/themes/kiosk/src/components/Cart/index.tsx +99 -26
  59. package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
  60. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
  61. package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
  62. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  63. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
  64. package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
  65. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  66. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  67. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  68. package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
  69. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  70. package/themes/kiosk/src/components/OrderDetails/index.tsx +165 -65
  71. package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
  72. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
  73. package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
  74. package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
  75. package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
  76. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
  77. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  78. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
  79. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  80. package/themes/kiosk/src/types/index.d.ts +3 -0
  81. package/themes/original/index.tsx +169 -4
  82. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  83. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  84. package/themes/original/src/components/AddressForm/index.tsx +1 -1
  85. package/themes/original/src/components/AddressList/index.tsx +30 -18
  86. package/themes/original/src/components/AppleLogin/index.tsx +117 -78
  87. package/themes/original/src/components/BusinessBasicInformation/index.tsx +136 -45
  88. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +4 -0
  89. package/themes/original/src/components/BusinessController/index.tsx +48 -11
  90. package/themes/original/src/components/BusinessController/styles.tsx +27 -0
  91. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  92. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  93. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
  94. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  95. package/themes/original/src/components/BusinessListingSearch/index.tsx +196 -58
  96. package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
  97. package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
  98. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
  99. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  100. package/themes/original/src/components/BusinessProductsList/index.tsx +119 -35
  101. package/themes/original/src/components/BusinessProductsList/styles.tsx +12 -4
  102. package/themes/original/src/components/BusinessProductsListing/index.tsx +109 -21
  103. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
  104. package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
  105. package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
  106. package/themes/original/src/components/BusinessesListing/index.tsx +127 -66
  107. package/themes/original/src/components/BusinessesListing/styles.tsx +11 -3
  108. package/themes/original/src/components/Cart/index.tsx +60 -41
  109. package/themes/original/src/components/Checkout/index.tsx +48 -32
  110. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  111. package/themes/original/src/components/Favorite/index.tsx +92 -0
  112. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  113. package/themes/original/src/components/FavoriteList/index.tsx +298 -0
  114. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  115. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  116. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  117. package/themes/original/src/components/GoogleMap/index.tsx +1 -0
  118. package/themes/original/src/components/Help/index.tsx +21 -4
  119. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  120. package/themes/original/src/components/Home/index.tsx +1 -1
  121. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  122. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
  123. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  124. package/themes/original/src/components/LoginForm/index.tsx +394 -155
  125. package/themes/original/src/components/LoginForm/styles.tsx +7 -4
  126. package/themes/original/src/components/LogoutButton/index.tsx +7 -1
  127. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  128. package/themes/original/src/components/Messages/index.tsx +1 -1
  129. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  130. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  131. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  132. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  133. package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
  134. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  135. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  136. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  137. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  138. package/themes/original/src/components/MyOrders/index.tsx +120 -32
  139. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  140. package/themes/original/src/components/OrderDetails/index.tsx +64 -42
  141. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  142. package/themes/original/src/components/OrderSummary/index.tsx +3 -3
  143. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  144. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
  147. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  148. package/themes/original/src/components/OrdersOption/index.tsx +130 -38
  149. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  150. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  151. package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
  152. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  153. package/themes/original/src/components/PaymentOptions/index.tsx +16 -14
  154. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  155. package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
  156. package/themes/original/src/components/ProductForm/index.tsx +70 -62
  157. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  158. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  159. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  160. package/themes/original/src/components/Promotions/index.tsx +250 -0
  161. package/themes/original/src/components/Promotions/styles.tsx +60 -0
  162. package/themes/original/src/components/SearchBar/index.tsx +10 -4
  163. package/themes/original/src/components/Sessions/index.tsx +160 -0
  164. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  165. package/themes/original/src/components/SignupForm/index.tsx +333 -128
  166. package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
  167. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  168. package/themes/original/src/components/SingleProductCard/index.tsx +59 -17
  169. package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
  170. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  171. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  172. package/themes/original/src/components/UserDetails/index.tsx +5 -96
  173. package/themes/original/src/components/UserFormDetails/index.tsx +34 -24
  174. package/themes/original/src/components/UserProfile/index.tsx +59 -5
  175. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  176. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  177. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  178. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  179. package/themes/original/src/components/Wallets/index.tsx +76 -9
  180. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  181. package/themes/original/src/components/shared/OModal.tsx +4 -2
  182. package/themes/original/src/config/constants.tsx +6 -6
  183. package/themes/original/src/types/index.tsx +144 -9
  184. package/themes/original/src/utils/index.tsx +19 -2
  185. package/themes/single-business/src/components/AddressList/index.tsx +1 -1
  186. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
  187. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
  188. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,7 +1,8 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Pressable, View } from 'react-native';
2
+ import { Pressable, StyleSheet, View } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native'
4
4
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
5
+ import FastImage from 'react-native-fast-image'
5
6
  import {
6
7
  WalletList,
7
8
  useLanguage,
@@ -15,7 +16,10 @@ import {
15
16
  TransactionsWrapper,
16
17
  OTabs,
17
18
  OTab,
18
- SectionContent
19
+ SectionContent,
20
+ LoyaltyContent,
21
+ LoyaltyWrapp,
22
+ LoyaltyImg
19
23
  } from './styles'
20
24
 
21
25
  import NavBar from '../NavBar'
@@ -27,10 +31,14 @@ const WalletsUI = (props: any) => {
27
31
  const {
28
32
  navigation,
29
33
  walletList,
34
+ userLoyaltyLevel,
30
35
  transactionsList,
31
36
  setWalletSelected,
32
37
  isWalletCashEnabled,
33
- isWalletPointsEnabled
38
+ isWalletPointsEnabled,
39
+ getWallets,
40
+ refreshWallets,
41
+ setRefreshWallets
34
42
  } = props
35
43
 
36
44
  const [, t] = useLanguage()
@@ -38,12 +46,27 @@ const WalletsUI = (props: any) => {
38
46
  const [{ parsePrice }] = useUtils()
39
47
  const [{ configs }] = useConfig()
40
48
 
49
+ const styles = StyleSheet.create({
50
+ logoStyle: {
51
+ width: 120,
52
+ height: 120,
53
+ borderRadius: 8,
54
+ borderWidth: 1,
55
+ borderColor: theme.colors.border,
56
+ flexDirection: 'column',
57
+ justifyContent: 'center',
58
+ alignItems: 'center',
59
+ }
60
+ });
61
+
41
62
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
42
63
 
43
- const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
64
+ const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
44
65
 
45
66
  const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
46
67
 
68
+ const loyaltyLevel = Object.keys(userLoyaltyLevel.loyaltyLevel ?? {}).length > 0 && userLoyaltyLevel.loyaltyLevel
69
+
47
70
  const walletName: any = {
48
71
  cash: {
49
72
  name: t('CASH_WALLET', 'Cash Wallet'),
@@ -74,6 +97,13 @@ const WalletsUI = (props: any) => {
74
97
  }
75
98
  }, [configs])
76
99
 
100
+ useEffect(() => {
101
+ if(refreshWallets){
102
+ getWallets()
103
+ setRefreshWallets && setRefreshWallets(false)
104
+ }
105
+ }, [refreshWallets])
106
+
77
107
  return (
78
108
  <Container>
79
109
  <NavBar
@@ -86,18 +116,22 @@ const WalletsUI = (props: any) => {
86
116
  />
87
117
 
88
118
  {!walletList.loading &&
119
+ !userLoyaltyLevel.loading &&
89
120
  !walletList.error &&
90
121
  walletList.wallets?.length > 0 &&
91
122
  (
92
123
  <>
93
- <OTabs>
124
+ <OTabs
125
+ horizontal
126
+ showsHorizontalScrollIndicator={false}
127
+ >
94
128
  {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
95
129
  <Pressable
96
130
  key={wallet.id}
97
131
  onPress={() => handleChangeTab(wallet)}
98
132
  >
99
- <OTab>
100
- <OText size={18} color={tabSelected === wallet.type ? theme.colors.primary : theme.colors.disabled}>
133
+ <OTab isSelected={tabSelected === wallet.type}>
134
+ <OText size={18}>
101
135
  {walletName[wallet.type]?.name}
102
136
  </OText>
103
137
  </OTab>
@@ -106,6 +140,39 @@ const WalletsUI = (props: any) => {
106
140
  </OTabs>
107
141
 
108
142
  <SectionContent>
143
+ {!!loyaltyLevel && tabSelected === 'credit_point' && (
144
+ <LoyaltyContent>
145
+ <LoyaltyWrapp>
146
+ <OText size={20}>
147
+ {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
148
+ </OText>
149
+ {loyaltyLevel.image ? (
150
+ <FastImage
151
+ style={styles.logoStyle}
152
+ source={{
153
+ uri: loyaltyLevel.image,
154
+ priority: FastImage.priority.high,
155
+ cache:FastImage.cacheControl.web
156
+ }}
157
+ resizeMode={FastImage.resizeMode.contain}
158
+ />
159
+ ) : (
160
+ <LoyaltyImg
161
+ source={theme.images.dummies.loyaltyLevel}
162
+ resizeMode='contain'
163
+ />
164
+ )}
165
+ <OText
166
+ size={22}
167
+ weight='bold'
168
+ style={{ textTransform: 'uppercase' }}
169
+ color={theme.colors.primary}
170
+ >
171
+ {loyaltyLevel.name}
172
+ </OText>
173
+ </LoyaltyWrapp>
174
+ </LoyaltyContent>
175
+ )}
109
176
  <BalanceElement>
110
177
  <OText size={20} style={{fontWeight: '600'}}>
111
178
  {currentWalletSelected?.type === 'cash'
@@ -172,7 +239,7 @@ const WalletsUI = (props: any) => {
172
239
  </>
173
240
  )}
174
241
 
175
- {walletList?.loading && (
242
+ {(walletList?.loading || userLoyaltyLevel.loading) && (
176
243
  <>
177
244
  <View>
178
245
  <Placeholder Animation={Fade}>
@@ -196,7 +263,7 @@ const WalletsUI = (props: any) => {
196
263
  </>
197
264
  )}
198
265
 
199
- {!walletList?.loading && (walletList?.error || !walletList?.wallets?.length) && (
266
+ {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
200
267
  <NotFoundSource
201
268
  content={walletList?.error
202
269
  ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
@@ -41,3 +41,24 @@ export const OTabs = styled.View`
41
41
  export const OTab = styled.View`
42
42
  padding-horizontal: 10px;
43
43
  `;
44
+
45
+ export const LoyaltyContent = styled.View`
46
+ width: 100%;
47
+ margin-bottom: 20px;
48
+ `
49
+
50
+ export const LoyaltyWrapp = styled.View`
51
+ flex-direction: column;
52
+ justify-content: center;
53
+ align-items: center;
54
+ `
55
+
56
+ export const LoyaltyImg = styled.ImageBackground`
57
+ position: relative;
58
+ height: 150px;
59
+ width: 100%;
60
+ display: flex;
61
+ flex-direction: column;
62
+ justify-content: center;
63
+ align-items: center;
64
+ `
@@ -21,6 +21,7 @@ interface Props {
21
21
  isNotDecoration?: boolean;
22
22
  styleCloseButton?: any,
23
23
  isAvoidKeyBoardView?: boolean;
24
+ styleContainerCloseButton?: any;
24
25
  }
25
26
  const KeyboardView = styled.KeyboardAvoidingView`
26
27
  flex-grow: 1;
@@ -45,6 +46,7 @@ const OModal = (props: Props): React.ReactElement => {
45
46
  isNotDecoration,
46
47
  style,
47
48
  styleCloseButton,
49
+ styleContainerCloseButton,
48
50
  isAvoidKeyBoardView
49
51
  } = props
50
52
 
@@ -55,7 +57,7 @@ const OModal = (props: Props): React.ReactElement => {
55
57
  {!entireModal ? (
56
58
  <View style={styles.centeredView}>
57
59
  <View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
58
- <TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
60
+ <TouchableOpacity style={{...styles.wrapperIcon, ...styleContainerCloseButton}} onPress={onClose}>
59
61
  <OIcon
60
62
  src={theme.images.general.close}
61
63
  width={16}
@@ -91,7 +93,7 @@ const OModal = (props: Props): React.ReactElement => {
91
93
  animationType="slide"
92
94
  transparent={isTransparent}
93
95
  visible={open}
94
- onRequestClose={() => onClose()}
96
+ onRequestClose={() => onClose && onClose()}
95
97
  style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
96
98
  >
97
99
  {isAvoidKeyBoardView ? (
@@ -8,26 +8,26 @@ export const ORDER_TYPES = [
8
8
  {
9
9
  value: 1,
10
10
  content: 'DELIVERY',
11
- description: 'DELIVERY_DESCRIPTION'
11
+ description: 'ORDERTYPE_DESCRIPTION_DELIVERY'
12
12
  },
13
13
  {
14
14
  value: 2,
15
15
  content: 'PICKUP',
16
- description: 'PICKUP_DESCRIPTION',
16
+ description: 'ORDERTYPE_DESCRIPTION_PICKUP',
17
17
  },
18
18
  {
19
19
  value: 3,
20
20
  content: 'EAT_IN',
21
- description: 'EAT_IN_DESCRIPTION',
21
+ description: 'ORDERTYPE_DESCRIPTION_EATIN',
22
22
  },
23
23
  {
24
24
  value: 4,
25
25
  content: 'CURBSIDE',
26
- description: 'CURBSIDE_DESCRIPTION',
26
+ description: 'ORDERTYPE_DESCRIPTION_CURBSIDE',
27
27
  },
28
28
  {
29
29
  value: 5,
30
30
  content: 'DRIVE_THRU',
31
- description: 'DRIVE_THRU_DESCRIPTION',
31
+ description: 'ORDERTYPE_DESCRIPTION_DRIVETHRU',
32
32
  }
33
- ]
33
+ ]
@@ -17,6 +17,14 @@ export interface LoginParams {
17
17
  handleSendVerifyCode?: any;
18
18
  handleCheckPhoneCode?: any;
19
19
  notificationState?: any;
20
+ handleReCaptcha?: any;
21
+ enableReCaptcha?: any;
22
+ otpType?: string,
23
+ setOtpType: (type: string) => void,
24
+ generateOtpCode: (values?: any) => void,
25
+ useLoginOtpEmail?: boolean,
26
+ useLoginOtpCellphone?: boolean,
27
+ useLoginOtp?: boolean
20
28
  }
21
29
  export interface ProfileParams {
22
30
  navigation?: any;
@@ -37,6 +45,8 @@ export interface ProfileParams {
37
45
  verifyPhoneState?: any;
38
46
  setCheckPhoneCodeState?: any;
39
47
  isVerifiedPhone?: any;
48
+ handleRemoveAccount?: any;
49
+ removeAccountState?: any;
40
50
  }
41
51
 
42
52
  export interface AddressListParams {
@@ -55,6 +65,7 @@ export interface AddressListParams {
55
65
  isFromProductsList?: boolean;
56
66
  afterSignup?: boolean;
57
67
  isFromCheckout?: boolean
68
+ loadAddresses: () => void
58
69
  }
59
70
 
60
71
  export interface AddressFormParams {
@@ -99,7 +110,20 @@ export interface SignupParams {
99
110
  handleSendVerifyCode?: any;
100
111
  handleCheckPhoneCode?: any;
101
112
  notificationState?: any;
113
+ signUpTab?: string;
114
+ useSignUpFullDetails?: boolean;
115
+ useSignUpOtpEmail?: boolean;
116
+ useSignUpOtpCellphone?: boolean;
117
+ willVerifyOtpState?: boolean;
118
+ numOtpInputs?: number;
102
119
  handleChangePromotions: () => void;
120
+ handleChangeInput?: (in1: any, in2: any) => void;
121
+ enableReCaptcha?: boolean;
122
+ generateOtpCode?: (in1?: any) => void;
123
+ handleReCaptcha?: (token?: any) => void;
124
+ setSignUpTab?: (in1: string) => void;
125
+ setWillVerifyOtpState?: (in1: boolean) => void;
126
+ setOtpState?: (in1: string) => void;
103
127
  }
104
128
 
105
129
  export interface PhoneInputParams {
@@ -116,6 +140,7 @@ export interface PhoneInputParams {
116
140
  flagStyle?: any;
117
141
  isDisabled?: any;
118
142
  isStartValidation?: any;
143
+ changeCountry?: any;
119
144
  }
120
145
 
121
146
  export interface LanguageSelectorParams {
@@ -139,13 +164,18 @@ export interface BusinessesListingParams {
139
164
  defaultBusinessType?: any;
140
165
  franchiseId?: any;
141
166
  businessId?: any;
167
+ isGuestUser?: any;
168
+ handleUpdateBusinessList?: any;
142
169
  }
143
170
  export interface HighestRatedBusinessesParams {
144
171
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
145
172
  onBusinessClick?: void;
146
173
  navigation?: any;
147
174
  isLoading?: boolean;
148
- getBusinesses: (newFetch: boolean) => void
175
+ getBusinesses: (newFetch: boolean) => void,
176
+ favoriteIds?: any,
177
+ setFavoriteIds?: any,
178
+ handleUpdateBusinessList?: any
149
179
  }
150
180
  export interface BusinessTypeFilterParams {
151
181
  businessTypes?: Array<any>;
@@ -157,7 +187,7 @@ export interface BusinessTypeFilterParams {
157
187
  setBusinessTypes?: any
158
188
  }
159
189
  export interface BusinessControllerParams {
160
- key?: number;
190
+ key?: string | number;
161
191
  business?: any;
162
192
  handleCustomClick?: any;
163
193
  orderType?: any;
@@ -174,7 +204,11 @@ export interface BusinessControllerParams {
174
204
  businessDeliveryPrice?: number,
175
205
  businessDeliveryTime?: string,
176
206
  businessPickupTime?: string,
177
- businessDistance?: number
207
+ businessDistance?: number,
208
+ favoriteIds?: number[],
209
+ handleFavoriteBusiness?: any,
210
+ setFavoriteIds?: any;
211
+ handleUpdateBusinessList?: any;
178
212
  }
179
213
  export interface BusinessProductsListingParams {
180
214
  navigation?: any;
@@ -190,10 +224,14 @@ export interface BusinessProductsListingParams {
190
224
  header?: any;
191
225
  logo?: any;
192
226
  productModal?: any;
227
+ alertState?: { open: boolean, content: any[] };
228
+ setAlertState?: any;
229
+ multiRemoveProducts?: (in1: any, in2: any) => {};
193
230
  getNextProducts?: () => {};
194
231
  handleChangeCategory: (value: any) => {};
195
232
  setProductLogin?: () => {};
196
233
  updateProductModal?: (value: any) => {};
234
+ handleUpdateProducts?: any;
197
235
  }
198
236
  export interface BusinessBasicInformationParams {
199
237
  navigation?: any;
@@ -236,7 +274,13 @@ export interface BusinessProductsListParams {
236
274
  handleCancelSearch?: () => void,
237
275
  categoriesLayout?: any,
238
276
  setCategoriesLayout?: any,
239
- currentCart?: any
277
+ currentCart?: any,
278
+ setSubcategoriesSelected?: any,
279
+ subcategoriesSelected?: any,
280
+ onClickCategory?: any,
281
+ lazyLoadProductsRecommended?: boolean,
282
+ isFiltMode?: boolean,
283
+ handleUpdateProducts?: any
240
284
  }
241
285
  export interface SingleProductCardParams {
242
286
  businessId: any,
@@ -244,7 +288,10 @@ export interface SingleProductCardParams {
244
288
  isSoldOut: boolean;
245
289
  onProductClick: any;
246
290
  productAddedToCartLength: number;
247
- style?: ViewStyle
291
+ style?: ViewStyle,
292
+ categoryState?: any,
293
+ handleFavoriteProduct?: any,
294
+ handleUpdateProducts?: any
248
295
  }
249
296
  export interface BusinessInformationParams {
250
297
  navigation?: any,
@@ -278,6 +325,7 @@ export interface OrdersOptionParams {
278
325
  orderList?: any,
279
326
  franchiseId?: any,
280
327
  activeOrders?: boolean,
328
+ pastOrders?: boolean,
281
329
  pagination?: any,
282
330
  titleContent?: string,
283
331
  customArray?: Array<any>,
@@ -288,11 +336,23 @@ export interface OrdersOptionParams {
288
336
  loadOrders?: any,
289
337
  setOrderList?: any,
290
338
  preOrders?: boolean,
339
+ reorderState?: any,
340
+ handleReorder?: (orderId: number) => {},
291
341
  setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
292
342
  ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
293
343
  setSelectedOrderId?: any,
294
344
  setOpenMessges?: any,
295
- loadMoreStatus?: boolean
345
+ loadMoreStatus?: boolean,
346
+ refreshOrders?: boolean,
347
+ setRefreshOrders?: (value: boolean) => void,
348
+ handleUpdateOrderList?: (orderId: number, changes: any) => {},
349
+ isBusiness?: boolean,
350
+ isProducts?: boolean,
351
+ businessOrderIds?: any,
352
+ products?: any,
353
+ businessesSearchList?: any,
354
+ hideOrders?: boolean,
355
+ BusinessControllerSkeletons?: any,
296
356
  }
297
357
  export interface ActiveOrdersParams {
298
358
  orders?: any,
@@ -305,7 +365,8 @@ export interface ActiveOrdersParams {
305
365
  loadMoreOrders?: () => {},
306
366
  onNavigationRedirect?: (route: string, params?: any) => {},
307
367
  isMessageView?: boolean,
308
- handleClickOrder?: any
368
+ handleClickOrder?: any,
369
+ handleUpdateOrderList?: (orderId: number, changes: any) => {}
309
370
  }
310
371
  export interface PreviousOrdersParams {
311
372
  orders?: any,
@@ -314,8 +375,9 @@ export interface PreviousOrdersParams {
314
375
  orderID?: number
315
376
  reorderLoading?: boolean,
316
377
  loadMoreOrders?: () => {},
317
- handleReorder: (order: any) => {},
378
+ handleReorder?: (orderId: number) => {},
318
379
  onNavigationRedirect?: (route: string, params?: any) => {}
380
+ handleUpdateOrderList?: (orderId: number, changes: any) => {}
319
381
  }
320
382
  export interface OrderDetailsParams {
321
383
  navigation?: any,
@@ -478,6 +540,7 @@ export interface OrderTypeSelectParams {
478
540
  defaultValue?: number;
479
541
  configTypes?: Array<any>;
480
542
  orderTypes: Array<any>;
543
+ setOrderTypeValue?: (value: number) => any
481
544
  }
482
545
  export interface UpsellingProductsParams {
483
546
  isCustomMode?: boolean;
@@ -551,7 +614,11 @@ export interface BusinessSearchParams {
551
614
  filters: any,
552
615
  businessTypes: Array<number>,
553
616
  setFilters: (filters: any) => void,
554
- lazySearch?: boolean
617
+ lazySearch?: boolean,
618
+ brandList?: any;
619
+ onNavigationRedirect?: any,
620
+ handleUpdateProducts: any,
621
+ handleUpdateBusinessList?: any;
555
622
  }
556
623
 
557
624
  export interface NoNetworkParams {
@@ -566,3 +633,71 @@ export interface PlaceSpotParams {
566
633
  getPlacesList?: any,
567
634
  setOpenPlaceModal?: any
568
635
  }
636
+
637
+ export interface PromotionParams {
638
+ navigation: any,
639
+ offersState: any,
640
+ handleSearchValue: any,
641
+ searchValue: string,
642
+ offerSelected: any,
643
+ setOfferSelected: any,
644
+ loadOffers: any
645
+ }
646
+ export interface SessionsParams {
647
+ navigation: any,
648
+ sessionsList: any,
649
+ actionState: any,
650
+ handleDeleteSession: any,
651
+ handleDeleteAllSessions: any
652
+ }
653
+
654
+ export interface otpParams {
655
+ willVerifyOtpState: boolean,
656
+ setWillVerifyOtpState: (val: boolean) => void,
657
+ onSubmit: () => void,
658
+ handleLoginOtp: (code: string) => void,
659
+ setAlertState: any;
660
+ pinCount: number;
661
+ }
662
+
663
+ export interface FavoriteParams {
664
+ favoriteList: any,
665
+ handleUpdateFavoriteList: (id: number, changes: any) => {},
666
+ pagination: any,
667
+ getFavoriteList: (value: number) => {},
668
+ navigation?: any,
669
+ onNavigationRedirect?: (route: string, params?: any) => {},
670
+ reorderState?: any,
671
+ handleReorder?: (orderId: number) => {},
672
+ isOrder?: boolean,
673
+ isProduct?: boolean,
674
+ isBusiness?: boolean
675
+ }
676
+
677
+ export interface SingleOrderCardParams {
678
+ order: any,
679
+ reorderLoading: any,
680
+ handleReorder?: (value: any) => {},
681
+ getOrderStatus: any,
682
+ handleFavoriteOrder?: (value: boolean) => {},
683
+ onNavigationRedirect?: (route: string, params?: any) => {},
684
+ pastOrders: any,
685
+ isMessageView?: any,
686
+ handleClickOrder: (value: any) => {}
687
+ }
688
+
689
+ export interface PreviousBusinessOrderedParams {
690
+ navigation?: any,
691
+ businessesList?: any,
692
+ setBusinessLoading?: any,
693
+ businessId?: number,
694
+ onNavigationRedirect?: any,
695
+ isBusinessesSearchList?: any,
696
+ businessLoading?: boolean
697
+ }
698
+
699
+ export interface PreviousProductsOrderedParams {
700
+ products?: any,
701
+ onProductClick?: any,
702
+ isBusinessesSearchList?: boolean
703
+ }
@@ -33,7 +33,8 @@ export const getTraduction = (key: string) => {
33
33
  ERROR_PLACE_PAY_WITH_CARD1: 'An error occurred while trying to pay by card',
34
34
  ERROR_PLACE_PAY_WITH_PAYPAL_CAPTURE: 'An error occurred while trying to pay by PayPal',
35
35
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
36
- ERROR_PRODUCT_NOT_FOUND: 'Error with the product'
36
+ ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
37
+ ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
37
38
  }
38
39
 
39
40
  return keyList[key] ? t(key, keyList[key]) : t(key)
@@ -211,4 +212,20 @@ export const formatUrlVideo = (url : string) => {
211
212
  const match = url.match(regExp)
212
213
  const id = (match && match[7].length === 11) ? match[7] : false
213
214
  return `https://www.youtube-nocookie.com/embed/${id}`
214
- }
215
+ }
216
+
217
+ export const formatSeconds = (seconds : number) => {
218
+ // Hours, minutes and seconds
219
+ var hrs = ~~(seconds / 3600)
220
+ var mins = ~~((seconds % 3600) / 60)
221
+ var secs = ~~seconds % 60
222
+
223
+ // Output like '1:01' or '4:03:59' or '123:03:59'
224
+ var ret = ''
225
+ if (hrs > 0) {
226
+ ret += '' + hrs + ':' + (mins < 10 ? '0' : '')
227
+ }
228
+ ret += '' + mins + ':' + (secs < 10 ? '0' : '')
229
+ ret += '' + secs
230
+ return ret
231
+ }
@@ -140,7 +140,7 @@ const AddressListUI = (props: AddressListParams) => {
140
140
  <AddressListContainer>
141
141
  {isProfile && (
142
142
  <NavBar
143
- title={t('MY_SAVED_PLACES', 'My saved places')}
143
+ title={t('SAVED_PLACES', 'My saved places')}
144
144
  titleAlign={'center'}
145
145
  onActionLeft={() => goToBack()}
146
146
  showCall={false}
@@ -58,7 +58,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
58
58
  btnStyle={{ paddingLeft: 0 }}
59
59
  paddingTop={0}
60
60
  style={{ paddingBottom: 0 }}
61
- title={t('HOW_WILL_YOUR_ORDER_TYPE', 'How will your order type?')}
61
+ title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
62
62
  titleAlign={'center'}
63
63
  titleStyle={{ fontSize: 14 }}
64
64
  />
@@ -154,7 +154,7 @@ const ProfileListUI = (props: ProfileParams) => {
154
154
  <Actions>
155
155
  <ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
156
156
  <OIcon src={theme.images.general.pin} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
157
- <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_SAVED_PLACES', 'My saved places')}</OText>
157
+ <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SAVED_PLACES', 'My saved places')}</OText>
158
158
  </ListItem>
159
159
  <ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
160
160
  <OIcon src={theme.images.general.help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
144
144
  {isFarAway && (
145
145
  <FarAwayMessage style={styles.farAwayMsg}>
146
146
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
147
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
147
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
148
148
  </FarAwayMessage>
149
149
  )}
150
150
  <View style={styles.wrapperOrderOptions}>