ordering-ui-react-native 0.14.84 → 0.14.86-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 (149) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +34 -2
  3. package/src/assets/images/no-network.png +0 -0
  4. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  5. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Cart/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +0 -1
  9. package/src/components/Home/index.tsx +3 -5
  10. package/src/components/LanguageSelector/index.tsx +65 -97
  11. package/src/components/LanguageSelector/styles.tsx +4 -17
  12. package/src/components/Messages/index.tsx +38 -30
  13. package/src/components/MomentOption/index.tsx +3 -1
  14. package/src/components/OrderDetails/index.tsx +29 -6
  15. package/src/components/OrdersOption/index.tsx +4 -2
  16. package/src/components/PaymentOptions/index.tsx +7 -16
  17. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  18. package/src/components/ProductForm/index.tsx +1 -1
  19. package/src/components/ProductForm/styles.tsx +1 -0
  20. package/src/components/StripeElementsForm/index.tsx +27 -48
  21. package/src/components/UserProfileForm/index.tsx +35 -1
  22. package/src/components/VerifyPhone/styles.tsx +1 -2
  23. package/src/config.json +0 -2
  24. package/src/pages/Checkout.tsx +1 -1
  25. package/src/providers/AlertProvider.tsx +4 -1
  26. package/src/theme.json +2 -1
  27. package/src/types/index.tsx +2 -9
  28. package/src/utils/index.tsx +196 -1
  29. package/themes/business/index.tsx +4 -0
  30. package/themes/business/src/components/Chat/index.tsx +32 -31
  31. package/themes/business/src/components/NetworkError/index.tsx +61 -0
  32. package/themes/business/src/components/NetworkError/styles.tsx +11 -0
  33. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  35. package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
  36. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  37. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  38. package/themes/business/src/components/OrdersOption/index.tsx +354 -54
  39. package/themes/business/src/components/OrdersOption/styles.tsx +95 -7
  40. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  41. package/themes/business/src/components/PreviousOrders/index.tsx +65 -46
  42. package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +11 -8
  44. package/themes/business/src/types/index.tsx +4 -0
  45. package/themes/business/src/utils/index.tsx +12 -0
  46. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  48. package/themes/doordash/src/components/OrderDetails/index.tsx +3 -1
  49. package/themes/doordash/src/components/OrdersOption/index.tsx +4 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/instacart/src/components/OrderDetails/index.tsx +3 -1
  52. package/themes/instacart/src/components/OrdersOption/index.tsx +4 -2
  53. package/themes/kiosk/index.tsx +2 -0
  54. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  55. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  56. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  57. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  58. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  59. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  60. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  61. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  62. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  63. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  64. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  65. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  66. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  67. package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
  68. package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
  69. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  70. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  71. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  72. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  73. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  74. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  75. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  76. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  77. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  78. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  79. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  80. package/themes/kiosk/src/types/index.d.ts +4 -0
  81. package/themes/original/index.tsx +26 -6
  82. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  83. package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
  84. package/themes/original/src/components/BusinessController/index.tsx +3 -3
  85. package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  87. package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
  88. package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
  89. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  90. package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
  91. package/themes/original/src/components/Cart/index.tsx +43 -10
  92. package/themes/original/src/components/Checkout/index.tsx +54 -17
  93. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  94. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  95. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  96. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
  98. package/themes/original/src/components/LastOrder/index.tsx +3 -1
  99. package/themes/original/src/components/LoginForm/index.tsx +83 -68
  100. package/themes/original/src/components/MessageListing/index.tsx +4 -2
  101. package/themes/original/src/components/Messages/index.tsx +19 -21
  102. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  103. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  104. package/themes/original/src/components/NetworkError/index.tsx +61 -0
  105. package/themes/original/src/components/NetworkError/styles.tsx +11 -0
  106. package/themes/original/src/components/OrderDetails/index.tsx +106 -113
  107. package/themes/original/src/components/OrderProgress/index.tsx +6 -5
  108. package/themes/original/src/components/OrderSummary/index.tsx +34 -1
  109. package/themes/original/src/components/OrdersOption/index.tsx +20 -42
  110. package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
  111. package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
  112. package/themes/original/src/components/PaymentOptions/index.tsx +20 -23
  113. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  114. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  115. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  116. package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
  117. package/themes/original/src/components/ProductForm/index.tsx +35 -20
  118. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  119. package/themes/original/src/components/ProductOptionSubOption/index.tsx +81 -74
  120. package/themes/original/src/components/ReviewDriver/index.tsx +315 -0
  121. package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
  122. package/themes/original/src/components/ReviewOrder/index.tsx +307 -186
  123. package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
  124. package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
  125. package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
  126. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  127. package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
  128. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
  129. package/themes/original/src/components/SingleProductReview/index.tsx +166 -0
  130. package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
  131. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  132. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  133. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  134. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  135. package/themes/original/src/components/UserProfile/index.tsx +13 -6
  136. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  137. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  138. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  139. package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
  140. package/themes/original/src/types/index.tsx +47 -10
  141. package/themes/single-business/src/components/LastOrder/index.tsx +3 -1
  142. package/themes/single-business/src/components/OrderDetails/index.tsx +15 -0
  143. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  144. package/themes/single-business/src/components/OrdersOption/index.tsx +4 -2
  145. package/themes/single-business/src/utils/index.tsx +7 -1
  146. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  147. package/themes/uber-eats/src/components/OrderDetails/index.tsx +3 -1
  148. package/themes/uber-eats/src/components/OrdersOption/index.tsx +4 -2
  149. package/src/components/StripeMethodForm/index.tsx +0 -163
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View, StyleSheet, useWindowDimensions, Keyboard } from 'react-native';
3
- import { useLanguage, useSession, useConfig } from 'ordering-components/native';
3
+ import { useLanguage, useSession } from 'ordering-components/native';
4
4
  import {
5
5
  StripeProvider,
6
6
  CardField,
@@ -13,7 +13,6 @@ import { ErrorMessage } from './styles';
13
13
  import { StripeElementsForm as StripeFormController } from './naked';
14
14
  import { OButton, OText } from '../shared';
15
15
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
16
- import { StripeMethodForm } from '../../../../../src/components/StripeMethodForm';
17
16
 
18
17
  const StripeElementsFormUI = (props: any) => {
19
18
  const {
@@ -23,17 +22,12 @@ const StripeElementsFormUI = (props: any) => {
23
22
  businessId,
24
23
  requirements,
25
24
  stripeTokenHandler,
26
- methodsPay,
27
- paymethod,
28
- onCancel,
29
- cart,
30
25
  } = props;
31
26
 
32
27
  const theme = useTheme();
33
28
 
34
29
  const [, t] = useLanguage();
35
30
  const [{ user }] = useSession();
36
- const [{ configs }] = useConfig();
37
31
  const [card, setCard] = useState<any>(null);
38
32
  const [isCompleted, setIsCompleted] = useState(false);
39
33
  const [errors, setErrors] = useState('')
@@ -43,30 +37,30 @@ const StripeElementsFormUI = (props: any) => {
43
37
  const { top, bottom } = useSafeAreaInsets();
44
38
  const [isKeyboardShow, setIsKeyboardShow] = useState(false);
45
39
 
46
- let billingDetails: any = {}
40
+ let billingDetails: any = {}
47
41
 
48
- if (user?.name || user?.lastname) {
49
- if (user?.name) {
50
- billingDetails.name = user?.name
51
- }
52
- if (user?.lastname) {
53
- billingDetails.name = `${billingDetails?.name} ${user?.lastname}`
54
- }
55
- }
42
+ if (user?.name || user?.lastname) {
43
+ if (user?.name) {
44
+ billingDetails.name = user?.name
45
+ }
46
+ if (user?.lastname) {
47
+ billingDetails.name = `${billingDetails?.name} ${user?.lastname}`
48
+ }
49
+ }
56
50
 
57
- if (user?.email) {
58
- billingDetails.email = user?.email
59
- }
51
+ if (user?.email) {
52
+ billingDetails.email = user?.email
53
+ }
60
54
 
61
- if (user?.address) {
62
- billingDetails.addressLine1 = user?.address
63
- }
55
+ if (user?.address) {
56
+ billingDetails.addressLine1 = user?.address
57
+ }
64
58
 
65
59
  const createPayMethod = async () => {
66
- const params: any = { type: 'Card' }
67
- if (Object.keys(billingDetails).length > 0) {
68
- params.billingDetails = billingDetails
69
- }
60
+ const params: any = { type: 'Card' }
61
+ if (Object.keys(billingDetails).length > 0) {
62
+ params.billingDetails = billingDetails
63
+ }
70
64
  try {
71
65
  setCreatePmLoading(true)
72
66
  const { paymentMethod } = await createPaymentMethod(params);
@@ -99,10 +93,10 @@ const StripeElementsFormUI = (props: any) => {
99
93
  createPayMethod();
100
94
  return
101
95
  }
102
- const params: any = { type: 'Card' }
103
- if (Object.keys(billingDetails).length > 0) {
104
- params.billingDetails = billingDetails
105
- }
96
+ const params: any = { type: 'Card' }
97
+ if (Object.keys(billingDetails).length > 0) {
98
+ params.billingDetails = billingDetails
99
+ }
106
100
  try {
107
101
  const { setupIntent, error } = await confirmSetupIntent(requirements, params);
108
102
 
@@ -158,35 +152,27 @@ const StripeElementsFormUI = (props: any) => {
158
152
  <View style={{ ...styles.container, height: height - top - bottom - 60 - (isKeyboardShow ? 250 : 0) }}>
159
153
  {publicKey ? (
160
154
  <View style={{ flex: 1 }}>
161
- <StripeProvider
162
- publishableKey={publicKey}
163
- merchantIdentifier={`merchant.${configs.apple_app_id}`}
164
- >
165
- {methodsPay?.includes(paymethod) ? (
166
- <StripeMethodForm
167
- handleSource={handleSource}
168
- onCancel={onCancel}
169
- cart={cart}
170
- setErrors={setErrors}
171
- paymethod={paymethod}
172
- devMode={publicKey?.includes('test')}
173
- />
174
- ) : (
175
- <CardField
176
- postalCodeEnabled={true}
177
- cardStyle={{
178
- backgroundColor: '#FFFFFF',
179
- textColor: '#000000',
180
- }}
181
- style={{
182
- width: '100%',
183
- height: 50,
184
- marginVertical: 30,
185
- zIndex: 9999,
186
- }}
187
- onCardChange={(cardDetails: any) => setCard(cardDetails)}
188
- />
189
- )}
155
+ <StripeProvider publishableKey={publicKey}>
156
+ <CardField
157
+ postalCodeEnabled={false}
158
+ cardStyle={{
159
+ backgroundColor: '#FFFFFF',
160
+ textColor: '#000000',
161
+ fontSize: 17,
162
+ styles: {
163
+
164
+ }
165
+ }}
166
+ style={{
167
+ width: '100%',
168
+ height: 50,
169
+ marginVertical: 50,
170
+ borderWidth: 1,
171
+ borderColor: theme.colors.border,
172
+ borderRadius: 7.6,
173
+ }}
174
+ onCardChange={(cardDetails: any) => setCard(cardDetails)}
175
+ />
190
176
  </StripeProvider>
191
177
  {!!errors && (
192
178
  <ErrorMessage>
@@ -211,19 +197,16 @@ const StripeElementsFormUI = (props: any) => {
211
197
  </OText>
212
198
  </ErrorMessage>
213
199
  )}
214
- {!methodsPay?.includes(paymethod) && (
215
- <OButton
216
- text={t('SAVE_CARD', 'Save card')}
217
- bgColor={isCompleted ? theme.colors.primary : theme.colors.backgroundGray}
218
- borderColor={isCompleted ? theme.colors.primary : theme.colors.backgroundGray}
219
- style={styles.btnAddStyle}
220
- textStyle={{ color: 'white' }}
221
- imgRightSrc={null}
222
- onClick={() => handleSaveCard()}
223
- isDisabled={!isCompleted}
224
- isLoading={confirmSetupLoading || values.loadingAdd || createPmLoading}
225
- />
226
- )}
200
+ <OButton
201
+ text={t('SAVE_CARD', 'Save card')}
202
+ bgColor={isCompleted ? theme.colors.primary : theme.colors.backgroundGray}
203
+ borderColor={isCompleted ? theme.colors.primary : theme.colors.backgroundGray}
204
+ style={styles.btnAddStyle}
205
+ textStyle={{ color: 'white', fontSize: 14 }}
206
+ imgRightSrc={null}
207
+ onClick={isCompleted ? () => handleSaveCard() : () => { }}
208
+ isLoading={confirmSetupLoading || values.loadingAdd || createPmLoading}
209
+ />
227
210
  </View>
228
211
  )
229
212
  }
@@ -157,6 +157,12 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
157
157
  </TopActions>
158
158
  </TopBar>
159
159
  <ScrollView style={{ marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
160
+ {productsList.length > 0 &&
161
+ <View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
162
+ <OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
163
+ <UpsellingLayout />
164
+ </View>
165
+ }
160
166
  <View style={{ paddingHorizontal: 40 }}>
161
167
  <OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
162
168
  <OrderSummary
@@ -165,12 +171,6 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
165
171
  onNavigationRedirect={onNavigationRedirect}
166
172
  />
167
173
  </View>
168
- {productsList.length > 0 &&
169
- <View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
170
- <OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
171
- <UpsellingLayout />
172
- </View>
173
- }
174
174
  </ScrollView>
175
175
  <View
176
176
  style={{
@@ -3,17 +3,14 @@ import { TouchableOpacity, View } from 'react-native';
3
3
  import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
4
4
 
5
5
  import { UDContainer, UDHeader, UDForm, UDInfo, EditBtn } from './styles';
6
+
6
7
  import {
7
8
  UserFormDetails as UserFormController,
8
9
  useLanguage,
9
10
  useSession,
10
- ToastType,
11
- useToast
12
11
  } from 'ordering-components/native';
13
12
  import { useTheme } from 'styled-components/native';
14
- import { OIcon, OText, OModal } from '../shared';
15
- import { VerifyPhone } from '../VerifyPhone';
16
- import Spinner from 'react-native-loading-spinner-overlay';
13
+ import { OIcon, OText } from '../shared';
17
14
 
18
15
  import { UserFormDetailsUI } from '../UserFormDetails';
19
16
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
@@ -29,33 +26,15 @@ const UserDetailsUI = (props: any) => {
29
26
  isUserDetailsEdit,
30
27
  phoneUpdate,
31
28
  togglePhoneUpdate,
32
- isCheckout,
33
- checkPhoneCodeState,
34
- handleSendVerifyCode,
35
- handleCheckPhoneCode,
36
- verifyPhoneState,
37
- isVerifiedPhone,
38
- setCheckPhoneCodeState
29
+ isCheckout
39
30
  } = props
40
31
 
41
32
  const theme = useTheme();
42
33
 
43
34
  const [, t] = useLanguage()
44
35
  const [{ user }] = useSession()
45
- const [, { showToast }] = useToast();
46
-
47
36
  const userData = props.userData || (!formState.result.error && formState.result?.result) || user
48
37
 
49
- const [isModalVisible, setIsModalVisible] = useState(false);
50
- const [willVerifyOtpState, setWillVerifyOtpState] = useState(false);
51
- const [phoneInputData, setPhoneInputData] = useState({
52
- error: '',
53
- phone: {
54
- country_phone_code: null,
55
- cellphone: null,
56
- },
57
- });
58
-
59
38
 
60
39
  useEffect(() => {
61
40
  if (isUserDetailsEdit) {
@@ -76,54 +55,6 @@ const UserDetailsUI = (props: any) => {
76
55
  }
77
56
  }, [user?.country_phone_code])
78
57
 
79
- const handleVerifyCodeClick = () => {
80
- if (formState?.changes?.cellphone && formState?.changes?.country_phone_code) {
81
- const { cellphone, country_phone_code: countryPhoneCode } = formState?.changes
82
-
83
- setPhoneInputData({
84
- error: '',
85
- phone: {
86
- country_phone_code: countryPhoneCode,
87
- cellphone: cellphone,
88
- },
89
- });
90
- handleSendVerifyCode({
91
- cellphone: cellphone,
92
- country_phone_code: countryPhoneCode
93
- })
94
- }
95
- }
96
-
97
- useEffect(() => {
98
- if (willVerifyOtpState) handleVerifyCodeClick()
99
- }, [willVerifyOtpState])
100
-
101
- useEffect(() => {
102
- if (verifyPhoneState && !verifyPhoneState?.loading) {
103
- if (verifyPhoneState.result?.error) {
104
- const message = typeof verifyPhoneState?.result?.result === 'string'
105
- ? verifyPhoneState?.result?.result
106
- : verifyPhoneState?.result?.result[0]
107
- verifyPhoneState.result?.result && showToast(
108
- ToastType.Error,
109
- message
110
- )
111
- setWillVerifyOtpState(false)
112
- return
113
- }
114
-
115
- const okResult = verifyPhoneState.result?.result === 'OK'
116
- if (okResult) {
117
- !isModalVisible && setIsModalVisible(true)
118
- setWillVerifyOtpState(false)
119
- }
120
- }
121
- }, [verifyPhoneState])
122
-
123
- useEffect(() => {
124
- if (isVerifiedPhone) setIsModalVisible(false)
125
- }, [isVerifiedPhone])
126
-
127
58
  return (
128
59
  <>
129
60
  {(validationFields.loading || formState.loading) && (
@@ -186,32 +117,10 @@ const UserDetailsUI = (props: any) => {
186
117
  )}
187
118
  </UDInfo>
188
119
  ) : (
189
- <UserFormDetailsUI
190
- {...props}
191
- phoneUpdate={phoneUpdate}
192
- togglePhoneUpdate={togglePhoneUpdate}
193
- isCheckout={isCheckout}
194
- setWillVerifyOtpState={setWillVerifyOtpState}
195
- />
120
+ <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} isCheckout={isCheckout} />
196
121
  )}
197
122
  </UDContainer>
198
123
  )}
199
- <OModal
200
- open={isModalVisible}
201
- onClose={() => setIsModalVisible(false)}
202
- entireModal
203
- >
204
- <VerifyPhone
205
- phone={phoneInputData.phone}
206
- verifyPhoneState={verifyPhoneState}
207
- checkPhoneCodeState={checkPhoneCodeState}
208
- handleCheckPhoneCode={handleCheckPhoneCode}
209
- setCheckPhoneCodeState={setCheckPhoneCodeState}
210
- handleVerifyCodeClick={handleVerifyCodeClick}
211
- onClose={() => setIsModalVisible(false)}
212
- />
213
- </OModal>
214
- <Spinner visible={verifyPhoneState?.loading} />
215
124
  </>
216
125
  )
217
126
  }
@@ -25,8 +25,6 @@ export const UserFormDetailsUI = (props: any) => {
25
25
  handleButtonUpdateClick,
26
26
  phoneUpdate,
27
27
  hideUpdateButton,
28
- setWillVerifyOtpState,
29
- isVerifiedPhone,
30
28
  handleChangePromotions
31
29
  } = props;
32
30
 
@@ -141,8 +139,8 @@ export const UserFormDetailsUI = (props: any) => {
141
139
  if (
142
140
  formState.changes?.cellphone === null &&
143
141
  ((validationFields?.fields?.checkout?.cellphone?.enabled &&
144
- validationFields?.fields?.checkout?.cellphone?.required) ||
145
- configs?.verification_phone_required?.value === '1')
142
+ validationFields?.fields?.checkout?.cellphone?.required) ||
143
+ configs?.verification_phone_required?.value === '1')
146
144
  ) {
147
145
  showToast(
148
146
  ToastType.Error,
@@ -153,9 +151,6 @@ export const UserFormDetailsUI = (props: any) => {
153
151
  );
154
152
  return;
155
153
  }
156
- if (formState?.changes?.cellphone && !isVerifiedPhone) {
157
- showToast(ToastType.Error, t('VERIFY_ERROR_PHONE_NUMBER', 'The Phone Number field is not verified'))
158
- }
159
154
  let changes = null;
160
155
  if (user?.cellphone && !userPhoneNumber) {
161
156
  changes = {
@@ -216,13 +211,6 @@ export const UserFormDetailsUI = (props: any) => {
216
211
  }
217
212
  }
218
213
  }, [user, isEdit]);
219
-
220
- useEffect(() => {
221
- if (!phoneInputData.error && phoneInputData?.phone?.country_phone_code && phoneInputData?.phone?.cellphone) {
222
- setWillVerifyOtpState(true)
223
- }
224
- }, [phoneInputData])
225
-
226
214
  return (
227
215
  <>
228
216
  <UDForm>
@@ -16,6 +16,7 @@ import { LogoutButton } from '../LogoutButton'
16
16
  import { LanguageSelector } from '../LanguageSelector'
17
17
  import MessageCircle from 'react-native-vector-icons/AntDesign'
18
18
  import Ionicons from 'react-native-vector-icons/Ionicons'
19
+ import FastImage from 'react-native-fast-image'
19
20
 
20
21
  import {
21
22
  OIcon,
@@ -141,12 +142,18 @@ const ProfileListUI = (props: ProfileParams) => {
141
142
  </OText>
142
143
  <CenterView style={styles.pagePadding}>
143
144
  <View style={styles.photo}>
144
- <OIcon
145
- url={user?.photo}
146
- src={!user?.photo && theme.images.general.user}
147
- width={60}
148
- height={60}
149
- />
145
+ {user?.photo ? (
146
+ <FastImage
147
+ style={{ height: 60, width: 60, borderRadius: 8 }}
148
+ source={{
149
+ uri: user?.photo,
150
+ priority: FastImage.priority.normal,
151
+ }}
152
+ resizeMode={FastImage.resizeMode.cover}
153
+ />
154
+ ) : (
155
+ <Ionicons name='person-outline' size={50} style={{ marginRight: 10 }} />
156
+ )}
150
157
  </View>
151
158
  <View style={{ flexBasis: '70%' }}>
152
159
  <OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
@@ -20,6 +20,8 @@ import { CenterView } from './styles';
20
20
  import NavBar from '../NavBar';
21
21
  import { Container } from '../../layouts/Container';
22
22
  import { VerifyPhone } from '../VerifyPhone'
23
+ import Ionicons from 'react-native-vector-icons/Ionicons'
24
+ import FastImage from 'react-native-fast-image'
23
25
 
24
26
  const ProfileUI = (props: ProfileParams) => {
25
27
  const {
@@ -286,18 +288,24 @@ const ProfileUI = (props: ProfileParams) => {
286
288
  />
287
289
  <CenterView style={styles.pagePadding}>
288
290
  <View style={styles.photo}>
289
- <OIcon
290
- url={user?.photo}
291
- src={!user?.photo && theme.images.general.user}
292
- width={79}
293
- height={79}
294
- />
291
+ {user?.photo ? (
292
+ <FastImage
293
+ style={{ height: 60, width: 80, borderRadius: 8 }}
294
+ source={{
295
+ uri: user?.photo,
296
+ priority: FastImage.priority.normal,
297
+ }}
298
+ resizeMode={FastImage.resizeMode.cover}
299
+ />
300
+ ) : (
301
+ <Ionicons name='person-outline' size={50} />
302
+ )}
295
303
  </View>
296
304
  <OIconButton
297
305
  icon={theme.images.general.camera}
298
306
  borderColor={theme.colors.clear}
299
- iconStyle={{ width: 16, height: 16 }}
300
- style={{ maxWidth: 40, position: 'absolute', bottom: -2, alignSelf: 'center' }}
307
+ iconStyle={{ width: 20, height: 20 }}
308
+ style={{ maxWidth: 40, position: 'absolute', bottom: -2, alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
301
309
  onClick={() => handleImagePicker()}
302
310
  />
303
311
  </CenterView>
@@ -37,8 +37,8 @@ export const VerifyPhone = (props: any) => {
37
37
  height: 75,
38
38
  marginBottom: 25,
39
39
  borderWidth: 1,
40
- borderColor: theme.colors.inputBorderColor,
41
- borderRadius: 8,
40
+ borderColor: theme.colors.disabled,
41
+ borderRadius: 20,
42
42
  textAlign: 'center',
43
43
  fontSize: 40
44
44
  }
@@ -131,11 +131,11 @@ export const VerifyPhone = (props: any) => {
131
131
 
132
132
  return (
133
133
  <Container>
134
- <OText size={26} style={{ textAlign: 'left', fontWeight: '600', marginTop: 10, marginBottom: 30 }}>
135
- {t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
134
+ <OText size={30} style={{ textAlign: 'left' }}>
135
+ {t('VERIFY_PHONE', 'Verify Phone')}
136
136
  </OText>
137
137
  {lastNumbers && (
138
- <OText size={16} color={theme.colors.disabled}>
138
+ <OText size={20} color={theme.colors.disabled}>
139
139
  {`${t('MESSAGE_ENTER_VERIFY_CODE', 'Please, enter the verification code we sent to your mobile ending with')} **${lastNumbers}`}
140
140
  </OText>
141
141
  )}
@@ -174,7 +174,7 @@ export const VerifyPhone = (props: any) => {
174
174
  ).result?.result)?.map((e: any, i: number) => (
175
175
  <OText
176
176
  key={i}
177
- size={16}
177
+ size={20}
178
178
  color={theme.colors.error}
179
179
  >
180
180
  {`* ${t(getTraduction(e))}`}
@@ -183,9 +183,12 @@ export const VerifyPhone = (props: any) => {
183
183
  </ErrorSection>
184
184
  )}
185
185
  <ResendSection>
186
+ <OText size={16} style={{ marginRight: 5 }}>
187
+ {t('ARE_YOU_NOT_SEEING_THE_CODE', 'Are you not seeing the code?')}
188
+ </OText>
186
189
  <Pressable onPress={() => handleSendCodeAgain()}>
187
190
  <OText size={16} color={theme.colors.primary}>
188
- {t('RESEND_CODE', 'Resend code')}
191
+ {t('SEND_AGAIN', 'Send Again')}
189
192
  </OText>
190
193
  </Pressable>
191
194
  </ResendSection>
@@ -19,12 +19,13 @@ export const CountDownContainer = styled.View`
19
19
  export const ResendSection = styled.View`
20
20
  display: flex;
21
21
  flex-direction: row;
22
+ justify-content: center;
22
23
  margin-bottom: 30px;
23
24
  `
24
25
 
25
26
  export const WrappCountdown = styled.View`
26
27
  padding-top: 20px;
27
- padding-bottom: 50px;
28
+ padding-bottom: 20px;
28
29
  `
29
30
 
30
31
  export const InputsSection = styled.View`
@@ -0,0 +1,26 @@
1
+ import React from 'react'
2
+ import styled from 'styled-components/native'
3
+ import { Platform, Dimensions } from 'react-native'
4
+ const windowWidth = Dimensions.get('window').width
5
+
6
+ export const Container = styled.View`
7
+ position: absolute;
8
+ flex: 1;
9
+ bottom: 0px;
10
+ left: 0;
11
+ right: 0;
12
+ padding: 10px;
13
+ border-top-width: 1px;
14
+ border-color: ${(props: any) => props.theme.colors.backgroundGray200};
15
+ z-index: 1000;
16
+ background-color: ${(props: any) => props.bgColor ? props.bgColor : '#FFF'};
17
+ padding-bottom: ${Platform.OS === 'ios' ? '20px' : '10px'};
18
+ `
19
+
20
+ export const FloatingBottomContainer = (props: any) => {
21
+ return (
22
+ <Container style={{ width: windowWidth }}>
23
+ {props.children}
24
+ </Container>
25
+ )
26
+ }
@@ -31,12 +31,6 @@ export interface ProfileParams {
31
31
  validationFields?: any;
32
32
  showField?: any;
33
33
  isRequiredField?: any;
34
- handleSendVerifyCode?: any;
35
- handleCheckPhoneCode?: any;
36
- checkPhoneCodeState?: any;
37
- verifyPhoneState?: any;
38
- setCheckPhoneCodeState?: any;
39
- isVerifiedPhone?: any;
40
34
  }
41
35
 
42
36
  export interface AddressListParams {
@@ -115,6 +109,7 @@ export interface PhoneInputParams {
115
109
  noDropIcon?: boolean;
116
110
  flagStyle?: any;
117
111
  isDisabled?: any;
112
+ isStartValidation?: any;
118
113
  }
119
114
 
120
115
  export interface LanguageSelectorParams {
@@ -143,6 +138,8 @@ export interface HighestRatedBusinessesParams {
143
138
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
144
139
  onBusinessClick?: void;
145
140
  navigation? :any;
141
+ isLoading?: boolean;
142
+ getBusinesses: (newFetch : boolean) => void
146
143
  }
147
144
  export interface BusinessTypeFilterParams {
148
145
  businessTypes?: Array<any>;
@@ -189,6 +186,7 @@ export interface BusinessBasicInformationParams {
189
186
  isBusinessInfoShow?: boolean;
190
187
  header?: any;
191
188
  logo?: any;
189
+ isPreOrder?: boolean;
192
190
  }
193
191
  export interface BusinessProductsCategoriesParams {
194
192
  categories: Array<any>;
@@ -210,7 +208,7 @@ export interface BusinessProductsListParams {
210
208
  errors?: any;
211
209
  businessId?: number;
212
210
  category?: any;
213
- categories: Array<any>;
211
+ categories?: Array<any>;
214
212
  categoryState?: any;
215
213
  onProductClick?: any;
216
214
  handleSearchRedirect?: () => {};
@@ -329,13 +327,40 @@ export interface ProductItemAccordionParams {
329
327
  isFromCheckout?: any
330
328
  }
331
329
  export interface ReviewOrderParams {
332
- order?: { orderId: number, businessId: number, logo: string },
330
+ order?: { id: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
333
331
  stars?: any,
334
332
  handleChangeInput?: any,
335
333
  handleChangeRating?: any,
336
334
  handleSendReview?: any,
337
335
  formState?: any,
338
- navigation?: any
336
+ navigation?: any,
337
+ setIsReviewed?: (isReviewed: boolean) => {},
338
+ handleReviewState?: any,
339
+ setStars?: any,
340
+ onNavigationRedirect?: any
341
+ }
342
+ export interface ReviewProductParams {
343
+ navigation?: any,
344
+ onNavigationRedirect?: any,
345
+ order?: { orderId: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
346
+ formState?: any,
347
+ handleChangeFormState?: any,
348
+ handleSendProductReview?: any
349
+ }
350
+ export interface SingleProductReviewParams {
351
+ product: any,
352
+ formState?: any,
353
+ handleChangeFormState?: any,
354
+ }
355
+ export interface ReviewDriverParams {
356
+ navigation?: any,
357
+ onNavigationRedirect?: any,
358
+ order?: { orderId: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
359
+ formState?: any,
360
+ setIsDriverReviewed?: (isReviewed: boolean) => {},
361
+ dirverReviews?: any,
362
+ setDriverReviews?: any,
363
+ handleSendDriverReview?: any
339
364
  }
340
365
  export interface MessagesParams {
341
366
  type?: string,
@@ -349,7 +374,7 @@ export interface MessagesParams {
349
374
  handleSend?: () => {},
350
375
  setImage?: (image: string | null) => {},
351
376
  setMessage?: (comment: string) => {},
352
- setMessages?: () => {},
377
+ setMessages?: (image: any | null) => {},
353
378
  readMessages?: () => {},
354
379
  onClose?: () => void,
355
380
  isMeesageListing?: boolean,
@@ -493,3 +518,15 @@ export interface MessageListingParams {
493
518
  navigation: any;
494
519
  franchiseId?: any;
495
520
  }
521
+ export interface NoNetworkParams {
522
+ image?: any,
523
+ }
524
+
525
+ export interface PlaceSpotParams {
526
+ isOpenPlaceSpot?: boolean,
527
+ cart?: any ,
528
+ placesState?: any,
529
+ handleChangePlace?: any,
530
+ getPlacesList?: any,
531
+ setOpenPlaceModal?: any
532
+ }