ordering-ui-react-native 0.15.66 → 0.15.67-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 (214) hide show
  1. package/package.json +7 -3
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/AddressForm/index.tsx +18 -2
  4. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  5. package/src/components/BusinessController/index.tsx +16 -8
  6. package/src/components/BusinessInformation/index.tsx +14 -0
  7. package/src/components/BusinessTypeFilter/index.tsx +1 -2
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +23 -2
  10. package/src/components/DriverTips/index.tsx +11 -6
  11. package/src/components/LanguageSelector/index.tsx +6 -2
  12. package/src/components/LoginForm/index.tsx +120 -30
  13. package/src/components/LoginForm/styles.tsx +6 -0
  14. package/src/components/OrderDetails/index.tsx +7 -21
  15. package/src/components/PaymentOptions/index.tsx +67 -50
  16. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  17. package/src/components/ReviewDriver/index.tsx +1 -1
  18. package/src/components/ReviewOrder/index.tsx +2 -1
  19. package/src/components/ReviewProducts/index.tsx +11 -0
  20. package/src/components/SignupForm/index.tsx +145 -61
  21. package/src/components/SingleProductCard/index.tsx +16 -4
  22. package/src/components/SingleProductReview/index.tsx +1 -1
  23. package/src/components/StripeMethodForm/index.tsx +22 -24
  24. package/src/components/UpsellingProducts/index.tsx +1 -1
  25. package/src/components/UserProfileForm/index.tsx +63 -6
  26. package/src/components/UserProfileForm/styles.tsx +8 -0
  27. package/src/components/VerifyPhone/styles.tsx +1 -2
  28. package/src/components/shared/OModal.tsx +1 -1
  29. package/src/hooks/useCountdownTimer.tsx +26 -0
  30. package/src/navigators/CheckoutNavigator.tsx +6 -0
  31. package/src/navigators/HomeNavigator.tsx +12 -0
  32. package/src/pages/BusinessesListing.tsx +7 -6
  33. package/src/pages/MultiCheckout.tsx +31 -0
  34. package/src/pages/MultiOrdersDetails.tsx +27 -0
  35. package/src/pages/OrderDetails.tsx +1 -1
  36. package/src/pages/ReviewDriver.tsx +2 -2
  37. package/src/pages/ReviewOrder.tsx +2 -2
  38. package/src/pages/Sessions.tsx +22 -0
  39. package/src/theme.json +0 -1
  40. package/src/types/index.tsx +18 -11
  41. package/src/utils/index.tsx +68 -1
  42. package/themes/business/index.tsx +4 -0
  43. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  44. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  45. package/themes/business/src/components/Chat/index.tsx +42 -90
  46. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  47. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  48. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  49. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  50. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  51. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  52. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
  53. package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
  54. package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
  55. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +14 -7
  56. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  57. package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
  58. package/themes/business/src/components/OrdersOption/index.tsx +8 -4
  59. package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
  60. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  61. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  62. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  63. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  64. package/themes/business/src/components/shared/OModal.tsx +41 -38
  65. package/themes/business/src/types/index.tsx +8 -2
  66. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  67. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  68. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  69. package/themes/kiosk/src/components/BusinessMenu/index.tsx +39 -28
  70. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  71. package/themes/kiosk/src/components/Cart/index.tsx +11 -12
  72. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
  73. package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
  74. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  75. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
  76. package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
  77. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  78. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  79. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  80. package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
  81. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  82. package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
  83. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
  84. package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
  85. package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
  86. package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
  87. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
  88. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  89. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
  90. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  91. package/themes/kiosk/src/types/index.d.ts +1 -0
  92. package/themes/original/index.tsx +30 -8
  93. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  94. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  95. package/themes/original/src/components/AddressForm/index.tsx +7 -6
  96. package/themes/original/src/components/AddressList/index.tsx +30 -18
  97. package/themes/original/src/components/AppleLogin/index.tsx +6 -8
  98. package/themes/original/src/components/BusinessBasicInformation/index.tsx +304 -158
  99. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  100. package/themes/original/src/components/BusinessController/index.tsx +195 -96
  101. package/themes/original/src/components/BusinessController/styles.tsx +5 -0
  102. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
  103. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  104. package/themes/original/src/components/BusinessListingSearch/index.tsx +231 -63
  105. package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
  106. package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
  107. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
  108. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  109. package/themes/original/src/components/BusinessProductsList/index.tsx +53 -52
  110. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  111. package/themes/original/src/components/BusinessProductsListing/index.tsx +318 -155
  112. package/themes/original/src/components/BusinessProductsListing/styles.tsx +32 -0
  113. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  114. package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -39
  115. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  116. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +560 -0
  117. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
  118. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +679 -0
  119. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  120. package/themes/original/src/components/BusinessesListing/index.tsx +99 -458
  121. package/themes/original/src/components/Cart/index.tsx +61 -42
  122. package/themes/original/src/components/Checkout/index.tsx +90 -39
  123. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  124. package/themes/original/src/components/Favorite/index.tsx +92 -0
  125. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  126. package/themes/original/src/components/FavoriteList/index.tsx +298 -0
  127. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  128. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  129. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  130. package/themes/original/src/components/GoogleMap/index.tsx +11 -11
  131. package/themes/original/src/components/Help/index.tsx +21 -4
  132. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  133. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  134. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
  135. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  136. package/themes/original/src/components/LoginForm/index.tsx +332 -164
  137. package/themes/original/src/components/LoginForm/styles.tsx +1 -3
  138. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  139. package/themes/original/src/components/Messages/index.tsx +1 -1
  140. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  141. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  142. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  143. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  144. package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
  145. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  146. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  147. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  148. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  149. package/themes/original/src/components/MyOrders/index.tsx +120 -32
  150. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  151. package/themes/original/src/components/NavBar/index.tsx +4 -4
  152. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  153. package/themes/original/src/components/OrderDetails/index.tsx +148 -63
  154. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  155. package/themes/original/src/components/OrderSummary/index.tsx +6 -6
  156. package/themes/original/src/components/OrderTypeSelector/index.tsx +79 -35
  157. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  158. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
  159. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  160. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
  161. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  162. package/themes/original/src/components/OrdersOption/index.tsx +137 -38
  163. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  164. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  165. package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
  166. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  167. package/themes/original/src/components/PaymentOptions/index.tsx +58 -37
  168. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  169. package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
  170. package/themes/original/src/components/ProductForm/index.tsx +718 -679
  171. package/themes/original/src/components/ProductForm/styles.tsx +6 -2
  172. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  173. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  174. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  175. package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
  176. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  177. package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
  178. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  179. package/themes/original/src/components/Promotions/index.tsx +151 -133
  180. package/themes/original/src/components/Promotions/styles.tsx +3 -23
  181. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  182. package/themes/original/src/components/ReviewOrder/index.tsx +1 -1
  183. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  184. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  185. package/themes/original/src/components/SearchBar/index.tsx +13 -5
  186. package/themes/original/src/components/ServiceForm/index.tsx +579 -0
  187. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  188. package/themes/original/src/components/Sessions/index.tsx +160 -0
  189. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  190. package/themes/original/src/components/SignupForm/index.tsx +237 -126
  191. package/themes/original/src/components/SingleOrderCard/index.tsx +275 -0
  192. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  193. package/themes/original/src/components/SingleProductCard/index.tsx +215 -90
  194. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  195. package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
  196. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  197. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  198. package/themes/original/src/components/UserDetails/index.tsx +15 -81
  199. package/themes/original/src/components/UserFormDetails/index.tsx +98 -66
  200. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  201. package/themes/original/src/components/UserProfileForm/index.tsx +33 -22
  202. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  203. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  204. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  205. package/themes/original/src/components/Wallets/index.tsx +25 -12
  206. package/themes/original/src/components/shared/OBottomPopup.tsx +44 -13
  207. package/themes/original/src/components/shared/OButton.tsx +2 -0
  208. package/themes/original/src/components/shared/OInput.tsx +3 -2
  209. package/themes/original/src/components/shared/OModal.tsx +4 -2
  210. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  211. package/themes/original/src/types/index.tsx +187 -35
  212. package/themes/original/src/utils/index.tsx +96 -2
  213. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
  214. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Platform, StyleSheet, View } from 'react-native';
2
+ import { Platform, StyleSheet, TouchableOpacity } from 'react-native';
3
3
  import { useSession, useLanguage, ToastType, useToast, useConfig } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { useForm, Controller } from 'react-hook-form';
@@ -17,6 +17,9 @@ export const UserFormDetailsUI = (props: any) => {
17
17
  isEdit,
18
18
  formState,
19
19
  showField,
20
+ requiredFields,
21
+ onClose,
22
+ setIsSubmit,
20
23
  cleanFormState,
21
24
  onCloseProfile,
22
25
  isRequiredField,
@@ -76,6 +79,8 @@ export const UserFormDetailsUI = (props: any) => {
76
79
 
77
80
  const [{ user }] = useSession();
78
81
  const [userPhoneNumber, setUserPhoneNumber] = useState<any>(null);
82
+ const [isValid, setIsValid] = useState(false)
83
+ const [isChanged, setIsChanged] = useState(false)
79
84
  const [phoneInputData, setPhoneInputData] = useState({
80
85
  error: '',
81
86
  phone: {
@@ -141,8 +146,8 @@ export const UserFormDetailsUI = (props: any) => {
141
146
  if (
142
147
  formState.changes?.cellphone === null &&
143
148
  ((validationFields?.fields?.checkout?.cellphone?.enabled &&
144
- validationFields?.fields?.checkout?.cellphone?.required) ||
145
- configs?.verification_phone_required?.value === '1')
149
+ validationFields?.fields?.checkout?.cellphone?.required) ||
150
+ configs?.verification_phone_required?.value === '1')
146
151
  ) {
147
152
  showToast(
148
153
  ToastType.Error,
@@ -153,9 +158,6 @@ export const UserFormDetailsUI = (props: any) => {
153
158
  );
154
159
  return;
155
160
  }
156
- if (formState?.changes?.cellphone && !isVerifiedPhone) {
157
- showToast(ToastType.Error, t('VERIFY_ERROR_PHONE_NUMBER', 'The Phone Number field is not verified'))
158
- }
159
161
  let changes = null;
160
162
  if (user?.cellphone && !userPhoneNumber) {
161
163
  changes = {
@@ -163,6 +165,7 @@ export const UserFormDetailsUI = (props: any) => {
163
165
  cellphone: '',
164
166
  };
165
167
  }
168
+ setIsSubmit && setIsSubmit(true)
166
169
  handleButtonUpdateClick(changes);
167
170
  }
168
171
  };
@@ -182,7 +185,7 @@ export const UserFormDetailsUI = (props: any) => {
182
185
  handleChangeInput(phoneNumber, true);
183
186
  };
184
187
 
185
- const changeCountry = (country : any) => {
188
+ const changeCountry = (country: any) => {
186
189
  let countryCode = {
187
190
  country_code: {
188
191
  name: 'country_code',
@@ -229,10 +232,16 @@ export const UserFormDetailsUI = (props: any) => {
229
232
 
230
233
  useEffect(() => {
231
234
  if (!phoneInputData.error && phoneInputData?.phone?.country_phone_code && phoneInputData?.phone?.cellphone) {
232
- setWillVerifyOtpState(true)
235
+ setWillVerifyOtpState?.(true)
233
236
  }
234
- }, [phoneInputData])
237
+ }, [phoneInputData, configs?.verification_phone_required?.value, isChanged])
235
238
 
239
+ useEffect(() => {
240
+ if (!requiredFields || formState?.changes?.length === 0) return
241
+ const _isValid = requiredFields.every((key: any) => formState?.changes[key])
242
+ setIsValid(_isValid)
243
+ }, [formState?.changes, requiredFields])
244
+
236
245
  return (
237
246
  <>
238
247
  <UDForm>
@@ -245,7 +254,7 @@ export const UserFormDetailsUI = (props: any) => {
245
254
  }).map(
246
255
  (field: any) =>
247
256
  showField &&
248
- showField(field.code) && (
257
+ showField(field.code) && ((requiredFields && requiredFields.includes(field.code)) || !requiredFields) && (
249
258
  <React.Fragment key={field.id}>
250
259
  <Controller
251
260
  key={field.id}
@@ -319,15 +328,15 @@ export const UserFormDetailsUI = (props: any) => {
319
328
  ),
320
329
  )}
321
330
 
322
- {!!showInputPhoneNumber && (
331
+ {!!showInputPhoneNumber &&((requiredFields && requiredFields.includes('cellphone')) || !requiredFields) && (
323
332
  <WrapperPhone>
324
333
  <OText size={14} lineHeight={21} weight={'500'} color={theme.colors.textNormal}>{t('PHONE', 'Phone')}</OText>
325
334
  <PhoneInputNumber
326
335
  data={phoneInputData}
327
336
  handleData={(val: any) => handleChangePhoneNumber(val)}
328
- changeCountry={(val : any) => changeCountry(val)}
337
+ changeCountry={(val: any) => changeCountry(val)}
329
338
  defaultValue={phoneUpdate ? '' : user?.cellphone}
330
- defaultCode={user?.country_code ?? user?.country_phone_code ?? null}
339
+ defaultCode={user?.country_phone_code || null}
331
340
  boxStyle={styles.phoneSelect}
332
341
  inputStyle={styles.phoneInputStyle}
333
342
  textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
@@ -344,69 +353,76 @@ export const UserFormDetailsUI = (props: any) => {
344
353
  )}
345
354
  </WrapperPhone>
346
355
  )}
347
- <Controller
348
- control={control}
349
- render={() => (
350
- <>
351
- <OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ textTransform: 'capitalize', alignSelf: 'flex-start' }}>
352
- {t('PASSWORD', 'Password')}
353
- </OText>
354
- <OInput
355
- name='password'
356
- placeholder={t('FRONT_VISUALS_PASSWORD', 'Password')}
357
- inputStyle={styles.inputStyle}
358
- style={{ paddingLeft: 0, paddingRight: 0, marginTop: 6, height: 44, minHeight: 44 }}
359
- autoCapitalize='none'
360
- isDisabled={false}
361
- value={
362
- formState?.changes['password'] ??
363
- (user && user['password']) ??
364
- ''
365
- }
366
- onChange={(val: any) => {
367
- setValue('password', val.target.value)
368
- handleChangeInput(val)
369
- }}
370
- autoCorrect
371
- type='default'
372
- returnKeyType="done"
373
- autoCompleteType='off'
374
- isSecured
375
- />
376
- </>
377
- )}
378
- name='password'
379
- rules={getInputRules({ name: 'password', code: 'password' })}
380
- defaultValue=''
381
- />
382
- <View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20, width: '100%' }}>
356
+ {!requiredFields && (
357
+ <Controller
358
+ control={control}
359
+ render={() => (
360
+ <>
361
+ <OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ textTransform: 'capitalize', alignSelf: 'flex-start' }}>
362
+ {t('PASSWORD', 'Password')}
363
+ </OText>
364
+ <OInput
365
+ name='password'
366
+ placeholder={t('FRONT_VISUALS_PASSWORD', 'Password')}
367
+ inputStyle={styles.inputStyle}
368
+ style={{ paddingLeft: 0, paddingRight: 0, marginTop: 6, height: 44, minHeight: 44 }}
369
+ autoCapitalize='none'
370
+ isDisabled={false}
371
+ value={
372
+ formState?.changes['password'] ??
373
+ (user && user['password']) ??
374
+ ''
375
+ }
376
+ onChange={(val: any) => {
377
+ setValue('password', val.target.value)
378
+ handleChangeInput(val)
379
+ }}
380
+ autoCorrect
381
+ type='default'
382
+ returnKeyType="done"
383
+ autoCompleteType='off'
384
+ isSecured
385
+ />
386
+ </>
387
+ )}
388
+ name='password'
389
+ rules={getInputRules({ name: 'password', code: 'password' })}
390
+ defaultValue=''
391
+ />
392
+ )}
393
+ {!requiredFields && (
383
394
  <Controller
384
395
  control={control}
385
396
  render={({ onChange, value }: any) => (
386
- <CheckBox
387
- value={value}
388
- onValueChange={newValue => {
389
- onChange(newValue)
390
- handleChangePromotions(newValue)
391
- }}
392
- boxType={'square'}
393
- tintColors={{
394
- true: theme.colors.primary,
395
- false: theme.colors.disabled
397
+ <TouchableOpacity
398
+ style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20, width: '100%' }}
399
+ onPress={() => {
400
+ onChange(!value)
401
+ handleChangePromotions(!value)
396
402
  }}
397
- tintColor={theme.colors.disabled}
398
- onCheckColor={theme.colors.primary}
399
- onTintColor={theme.colors.primary}
400
- style={Platform.OS === 'ios' && styles.checkBoxStyle}
401
- />
403
+ >
404
+ <CheckBox
405
+ value={value}
406
+ boxType={'square'}
407
+ tintColors={{
408
+ true: theme.colors.primary,
409
+ false: theme.colors.disabled
410
+ }}
411
+ tintColor={theme.colors.disabled}
412
+ onCheckColor={theme.colors.primary}
413
+ onTintColor={theme.colors.primary}
414
+ style={Platform.OS === 'ios' && styles.checkBoxStyle}
415
+ />
416
+ <OText style={{ fontSize: 14, paddingHorizontal: 5, paddingLeft: 10 }}>{t('RECEIVE_NEWS_EXCLUSIVE_PROMOTIONS', 'Receive newsletters and exclusive promotions')}</OText>
417
+ </TouchableOpacity>
402
418
  )}
403
419
  name='promotions'
404
420
  defaultValue={formState?.result?.result
405
421
  ? !!formState?.result?.result?.settings?.notification?.newsletter
406
422
  : !!(formState?.changes?.settings?.notification?.newsletter ?? (user && user?.settings?.notification?.newsletter))}
407
423
  />
408
- <OText style={{ fontSize: 14, paddingHorizontal: 5 }}>{t('RECEIVE_NEWS_EXCLUSIVE_PROMOTIONS', 'Receive newsletters and exclusive promotions')}</OText>
409
- </View>
424
+ )}
425
+
410
426
  </UDWrapper>
411
427
  )}
412
428
  {validationFields?.loading && (
@@ -438,6 +454,22 @@ export const UserFormDetailsUI = (props: any) => {
438
454
  )}
439
455
  </>
440
456
  )}
457
+ {requiredFields && (
458
+ <OButton
459
+ text={
460
+ formState.loading
461
+ ? t('UPDATING', 'Updating...')
462
+ : t('CONTINUE', 'Continue')
463
+ }
464
+ bgColor={theme.colors.white}
465
+ textStyle={{ color: theme.colors.primary, fontSize: 14 }}
466
+ borderColor={theme.colors.primary}
467
+ isDisabled={formState.loading || !isValid}
468
+ imgRightSrc={null}
469
+ style={{ borderRadius: 7.6, shadowOpacity: 0, width: '100%', borderWidth: 1, marginTop: 20, marginBottom: 20 }}
470
+ onClick={handleSubmit(onSubmit)}
471
+ />
472
+ )}
441
473
  </>
442
474
  );
443
475
  };
@@ -17,6 +17,7 @@ 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
19
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
20
+ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
20
21
  import FastImage from 'react-native-fast-image'
21
22
  import { OAlert } from '../../../../../src/components/shared'
22
23
 
@@ -108,8 +109,8 @@ const ProfileListUI = (props: ProfileParams) => {
108
109
 
109
110
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
110
111
 
111
- const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
112
- const IsPromotionsEnabled = configs?.advanced_offers_module === '1' || configs?.advanced_offers_module === 'true'
112
+ const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
113
+ const IsPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
113
114
  const onRedirect = (route: string, params?: any) => {
114
115
  navigation.navigate(route, params)
115
116
  }
@@ -214,6 +215,14 @@ const ProfileListUI = (props: ProfileParams) => {
214
215
  <OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
215
216
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
216
217
  </ListItem>
218
+ <ListItem onPress={() => navigation.navigate('Sessions')} activeOpacity={0.7}>
219
+ <Ionicons name='md-list-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
220
+ <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SESSIONS', 'Sessions')}</OText>
221
+ </ListItem>
222
+ <ListItem onPress={() => navigation.navigate('Favorite')} activeOpacity={0.7}>
223
+ <Ionicons name='heart-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
224
+ <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('FAVORITES', 'Favorites')}</OText>
225
+ </ListItem>
217
226
  </Actions>
218
227
 
219
228
  <Actions>
@@ -40,7 +40,8 @@ const ProfileUI = (props: ProfileParams) => {
40
40
  handleCheckPhoneCode,
41
41
  verifyPhoneState,
42
42
  isVerifiedPhone,
43
- setCheckPhoneCodeState
43
+ setCheckPhoneCodeState,
44
+ setFormState
44
45
  } = props;
45
46
 
46
47
  const theme = useTheme();
@@ -56,7 +57,8 @@ const ProfileUI = (props: ProfileParams) => {
56
57
  },
57
58
  pagePadding: {
58
59
  paddingLeft: 40,
59
- paddingRight: 40
60
+ paddingRight: 40,
61
+ justifyContent: 'center',
60
62
  },
61
63
  navBarStyle: {
62
64
  paddingLeft: 40,
@@ -205,8 +207,8 @@ const ProfileUI = (props: ProfileParams) => {
205
207
  },
206
208
  });
207
209
  handleSendVerifyCode({
208
- cellphone: cellphone,
209
- country_phone_code: countryPhoneCode
210
+ cellphone: cellphone,
211
+ country_phone_code: countryPhoneCode
210
212
  })
211
213
  }
212
214
  }
@@ -271,21 +273,30 @@ const ProfileUI = (props: ProfileParams) => {
271
273
  }
272
274
  }, [verifyPhoneState])
273
275
 
274
- useEffect(() => {
275
- if (isVerifiedPhone) setIsModalVisible(false)
276
- }, [isVerifiedPhone])
276
+ const handleSendPhoneCode = (values: any) => {
277
+ setWillVerifyOtpState(false)
278
+ setIsModalVisible(false)
279
+ setFormState({
280
+ ...formState,
281
+ changes: {
282
+ ...formState?.changes,
283
+ verification_code: values?.code
284
+ }
285
+ })
286
+ }
277
287
 
278
288
  return (
279
289
  <>
290
+ <NavBar
291
+ title={t('ACCOUNT', 'Account')}
292
+ titleAlign={'center'}
293
+ onActionLeft={() => navigation.goBack()}
294
+ showCall={false}
295
+ style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 }}
296
+ />
280
297
  <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
281
298
  <Container noPadding>
282
- <NavBar
283
- onActionLeft={() => navigation.goBack()}
284
- btnStyle={{ paddingStart: 0 }}
285
- title={t('ACCOUNT', 'Account')}
286
- isVertical
287
- style={styles.navBarStyle}
288
- />
299
+
289
300
  <CenterView style={styles.pagePadding}>
290
301
  <View style={styles.photo}>
291
302
  {user?.photo ? (
@@ -305,7 +316,7 @@ const ProfileUI = (props: ProfileParams) => {
305
316
  icon={theme.images.general.camera}
306
317
  borderColor={theme.colors.clear}
307
318
  iconStyle={{ width: 20, height: 20 }}
308
- style={{ maxWidth: 40, position: 'absolute', bottom: -2, alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
319
+ style={{ maxWidth: 40, position: 'absolute', alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
309
320
  onClick={() => handleImagePicker()}
310
321
  />
311
322
  </CenterView>
@@ -326,13 +337,13 @@ const ProfileUI = (props: ProfileParams) => {
326
337
  entireModal
327
338
  >
328
339
  <VerifyPhone
329
- phone={phoneInputData.phone}
330
- verifyPhoneState={verifyPhoneState}
331
- checkPhoneCodeState={checkPhoneCodeState}
332
- handleCheckPhoneCode={handleCheckPhoneCode}
333
- setCheckPhoneCodeState={setCheckPhoneCodeState}
334
- handleVerifyCodeClick={handleVerifyCodeClick}
335
- onClose={() => setIsModalVisible(false)}
340
+ phone={phoneInputData.phone}
341
+ verifyPhoneState={verifyPhoneState}
342
+ checkPhoneCodeState={checkPhoneCodeState}
343
+ handleCheckPhoneCode={handleCheckPhoneCode}
344
+ setCheckPhoneCodeState={setCheckPhoneCodeState}
345
+ handleVerifyCodeClick={handleVerifyCodeClick}
346
+ onClose={() => setIsModalVisible(false)}
336
347
  />
337
348
  </OModal>
338
349
  </>