ordering-ui-react-native 0.15.57 → 0.15.59-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 (186) hide show
  1. package/package.json +5 -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 +7 -21
  13. package/src/components/PaymentOptions/index.tsx +67 -50
  14. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  15. package/src/components/ReviewDriver/index.tsx +1 -1
  16. package/src/components/ReviewOrder/index.tsx +2 -1
  17. package/src/components/ReviewProducts/index.tsx +11 -0
  18. package/src/components/SignupForm/index.tsx +145 -61
  19. package/src/components/SingleProductCard/index.tsx +16 -4
  20. package/src/components/SingleProductReview/index.tsx +1 -1
  21. package/src/components/StripeMethodForm/index.tsx +1 -2
  22. package/src/components/UpsellingProducts/index.tsx +1 -1
  23. package/src/components/UserProfileForm/index.tsx +63 -6
  24. package/src/components/UserProfileForm/styles.tsx +8 -0
  25. package/src/components/VerifyPhone/styles.tsx +1 -2
  26. package/src/components/shared/OModal.tsx +1 -1
  27. package/src/hooks/useCountdownTimer.tsx +26 -0
  28. package/src/navigators/CheckoutNavigator.tsx +6 -0
  29. package/src/navigators/HomeNavigator.tsx +12 -0
  30. package/src/pages/BusinessesListing.tsx +1 -1
  31. package/src/pages/MultiCheckout.tsx +31 -0
  32. package/src/pages/MultiOrdersDetails.tsx +27 -0
  33. package/src/pages/Sessions.tsx +22 -0
  34. package/src/theme.json +0 -1
  35. package/src/types/index.tsx +18 -11
  36. package/src/utils/index.tsx +68 -1
  37. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  38. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  39. package/themes/business/src/components/Chat/index.tsx +42 -90
  40. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  41. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  42. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  43. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  44. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
  45. package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
  46. package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
  47. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +41 -7
  48. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  49. package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
  50. package/themes/business/src/components/OrdersOption/index.tsx +5 -2
  51. package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
  52. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  53. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  54. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  55. package/themes/business/src/components/shared/OModal.tsx +1 -1
  56. package/themes/business/src/types/index.tsx +6 -1
  57. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  59. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/kiosk/src/components/BusinessMenu/index.tsx +39 -28
  61. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  62. package/themes/kiosk/src/components/Cart/index.tsx +11 -12
  63. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
  64. package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
  65. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  66. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
  67. package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
  68. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  69. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  70. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  71. package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
  72. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  73. package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
  74. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
  75. package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
  76. package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
  77. package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
  78. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
  79. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  80. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
  81. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  82. package/themes/kiosk/src/types/index.d.ts +1 -0
  83. package/themes/original/index.tsx +22 -8
  84. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  85. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  86. package/themes/original/src/components/AddressForm/index.tsx +7 -6
  87. package/themes/original/src/components/AddressList/index.tsx +30 -18
  88. package/themes/original/src/components/AppleLogin/index.tsx +9 -13
  89. package/themes/original/src/components/BusinessBasicInformation/index.tsx +136 -45
  90. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +4 -0
  91. package/themes/original/src/components/BusinessController/index.tsx +48 -11
  92. package/themes/original/src/components/BusinessController/styles.tsx +27 -0
  93. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  94. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  95. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
  96. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  97. package/themes/original/src/components/BusinessListingSearch/index.tsx +196 -58
  98. package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
  99. package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
  100. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
  101. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  102. package/themes/original/src/components/BusinessProductsList/index.tsx +51 -53
  103. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  104. package/themes/original/src/components/BusinessProductsListing/index.tsx +105 -22
  105. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
  106. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  107. package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
  108. package/themes/original/src/components/BusinessesListing/index.tsx +126 -65
  109. package/themes/original/src/components/BusinessesListing/styles.tsx +11 -3
  110. package/themes/original/src/components/Cart/index.tsx +60 -41
  111. package/themes/original/src/components/Checkout/index.tsx +48 -32
  112. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  113. package/themes/original/src/components/Favorite/index.tsx +92 -0
  114. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  115. package/themes/original/src/components/FavoriteList/index.tsx +298 -0
  116. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  117. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  118. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  119. package/themes/original/src/components/GoogleMap/index.tsx +11 -11
  120. package/themes/original/src/components/Help/index.tsx +21 -4
  121. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  122. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
  124. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  125. package/themes/original/src/components/LoginForm/index.tsx +332 -164
  126. package/themes/original/src/components/LoginForm/styles.tsx +1 -3
  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/OrderHistory.tsx +167 -0
  141. package/themes/original/src/components/OrderDetails/index.tsx +135 -49
  142. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  143. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  144. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
  146. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  147. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
  148. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  149. package/themes/original/src/components/OrdersOption/index.tsx +130 -38
  150. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  151. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  152. package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
  153. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  154. package/themes/original/src/components/PaymentOptions/index.tsx +57 -36
  155. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  156. package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
  157. package/themes/original/src/components/ProductForm/index.tsx +70 -62
  158. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  159. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  160. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  161. package/themes/original/src/components/Promotions/index.tsx +151 -133
  162. package/themes/original/src/components/Promotions/styles.tsx +3 -23
  163. package/themes/original/src/components/SearchBar/index.tsx +10 -4
  164. package/themes/original/src/components/Sessions/index.tsx +160 -0
  165. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  166. package/themes/original/src/components/SignupForm/index.tsx +237 -126
  167. package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
  168. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  169. package/themes/original/src/components/SingleProductCard/index.tsx +59 -17
  170. package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
  171. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  172. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  173. package/themes/original/src/components/UserDetails/index.tsx +5 -96
  174. package/themes/original/src/components/UserFormDetails/index.tsx +25 -26
  175. package/themes/original/src/components/UserProfile/index.tsx +52 -5
  176. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  177. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  178. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  179. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  180. package/themes/original/src/components/Wallets/index.tsx +76 -9
  181. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  182. package/themes/original/src/components/shared/OModal.tsx +4 -2
  183. package/themes/original/src/types/index.tsx +189 -35
  184. package/themes/original/src/utils/index.tsx +85 -2
  185. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
  186. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -7,6 +7,7 @@ import {
7
7
  TextInput,
8
8
  SafeAreaView,
9
9
  TouchableOpacity,
10
+ ScrollView,
10
11
  } from 'react-native';
11
12
  import {
12
13
  UserVerification as UserVerificationController,
@@ -81,7 +82,6 @@ const UserVerificationUI = (props: any) => {
81
82
  const [containerIsFocused, setContainerIsFocused] = useState(false);
82
83
 
83
84
  const [phoneState, setPhoneState] = useState<any>(null)
84
- const [modalIsOpen, setModalIsOpen] = useState(false)
85
85
  const [verificationState, setVerificationState] = useState({ email: false, phone: false })
86
86
 
87
87
  const codeDigitsArray = new Array(CODE_LENGTH).fill(0);
@@ -155,7 +155,7 @@ const UserVerificationUI = (props: any) => {
155
155
 
156
156
  const containerStyle =
157
157
  containerIsFocused && isFocused
158
- ? {...style.inputContainer, ...style.inputContainerFocused}
158
+ ? { ...style.inputContainer, ...style.inputContainerFocused }
159
159
  : style.inputContainer;
160
160
 
161
161
  return (
@@ -250,8 +250,8 @@ const UserVerificationUI = (props: any) => {
250
250
  showToast(
251
251
  ToastType.Error,
252
252
  verifyEmailState?.errorSendCode?.[0]
253
- ?? verifyEmailState?.errorCheckCode?.[0]
254
- ?? t('ERROR', 'Error'),
253
+ ?? verifyEmailState?.errorCheckCode?.[0]
254
+ ?? t('ERROR', 'Error'),
255
255
  );
256
256
  setTimeout(() => {
257
257
  cleanErrorsState();
@@ -264,8 +264,8 @@ const UserVerificationUI = (props: any) => {
264
264
  showToast(
265
265
  ToastType.Error,
266
266
  verifyPhoneState?.errorSendCode?.[0]
267
- ?? verifyPhoneState?.errorCheckCode?.[0]
268
- ?? t('ERROR', 'Error'),
267
+ ?? verifyPhoneState?.errorCheckCode?.[0]
268
+ ?? t('ERROR', 'Error'),
269
269
  );
270
270
  setTimeout(() => {
271
271
  cleanErrorsState();
@@ -296,209 +296,195 @@ const UserVerificationUI = (props: any) => {
296
296
 
297
297
  return (
298
298
  <SafeAreaView style={{ flex: 1 }}>
299
- <Container>
300
- <WrapperActions>
301
- <WrapperText>
302
- <OText size={22} weight='bold' style={{ marginBottom: 10 }}>
303
- {t('VERIFICATION_CODE', 'Verification Code')}
304
- </OText>
305
- {isEmailVerifyRequired && (
306
- <OText size={14} color={theme.colors.disabled} style={{ textAlign: 'center', paddingVertical: 20 }}>
307
- {!verificationState.email ? (
308
- t('VERIFICATION_EMAIL_CODE_MESSAGE', 'In order to continue using our platform please verify your email')
309
- ) : (
310
- t('VERIFICATION_EMAIL_CODE_SENT_MESSAGE', 'Please type the verification code sent to your email')
311
- )}
299
+ <ScrollView>
300
+ <Container>
301
+ <WrapperActions>
302
+ <WrapperText>
303
+ <OText size={22} weight='bold' style={{ marginBottom: 10 }}>
304
+ {t('VERIFICATION_CODE', 'Verification Code')}
312
305
  </OText>
313
- )}
314
-
315
- {isPhoneVerifyRequired && !isEmailVerifyRequired && (
316
- <OText size={14} color={theme.colors.disabled} style={{ textAlign: 'center', paddingVertical: 20 }}>
317
- {!verificationState.phone ? (
318
- t('VERIFICATION_PHONE_CODE_MESSAGE', 'In order to continue using our platform please verify your phone number')
319
- ) : (
320
- t('VERIFICATION_PHONE_CODE_SENT_MESSAGE', 'Please, enter the verification code we sent to your mobile ending with :number').replace(':number', lastNumbers)
321
- )}
322
- </OText>
323
- )}
324
- </WrapperText>
325
- <View style={{ position: 'absolute', top: 0, right: 0 }}>
326
- <LogoutButton iconSize={20} />
327
- </View>
328
- </WrapperActions>
329
-
330
- {isEmailVerifyRequired && (
331
- !verificationState.email ? (
332
- <InputWrapper>
333
- <OInput
334
- placeholder={user?.email}
335
- style={style.inputStyle}
336
- icon={theme.images.general.email}
337
- isDisabled
338
- />
339
- </InputWrapper>
340
- ) : (
341
- <>
342
- <WrappCountdown>
343
- <CountDownContainer color={timer === '00:00' ? theme.colors.error: theme.colors.success}>
344
- <OText
345
- size={26}
346
- color={timer === '00:00' ? theme.colors.error: theme.colors.success}
347
- >
348
- {timer}
349
- </OText>
350
- </CountDownContainer>
351
- </WrappCountdown>
352
-
353
- <InputsSection>
354
- <OtpSection>
355
- <DigitInput
356
- disabled={otpState.length === CODE_LENGTH}
357
- onPress={handleOnPress}
358
- >
359
- {codeDigitsArray.map(toDigitInput)}
360
- </DigitInput>
361
- <TextInput
362
- ref={ref}
363
- value={otpState}
364
- placeholder='0'
365
- onChangeText={setOtpState}
366
- onSubmitEditing={handleOnBlur}
367
- keyboardType="number-pad"
368
- returnKeyType="done"
369
- textContentType="oneTimeCode"
370
- maxLength={CODE_LENGTH}
371
- style={style.hiddenCodeInput}
372
- />
373
- </OtpSection>
374
- </InputsSection>
375
-
376
- <WrapperText>
377
- <TouchableOpacity
378
- onPress={() => handleSendOtp()}
379
- >
380
- <OText color={theme.colors.primary}>
381
- {t('RESEND_AGAIN', 'Resend again?')}
382
- </OText>
383
- </TouchableOpacity>
384
- </WrapperText>
385
- </>
386
- )
387
- )}
388
-
389
- {isPhoneVerifyRequired && !isEmailVerifyRequired && (
390
- !verificationState.phone ? (
391
- phoneState?.formatted ? (
392
- <>
393
- <InputWrapper phone>
394
- <PhoneInputNumber
395
- handleData={() => {}}
396
- defaultValue={phoneState?.cellphone}
397
- defaultCode={phoneState?.country_phone_code.replace('+', '')}
398
- boxStyle={style.phoneSelect}
399
- inputStyle={style.phoneInputStyle}
400
- textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
401
- noDropIcon
402
- isDisabled
403
- />
404
- </InputWrapper>
405
- </>
306
+ {isEmailVerifyRequired && (
307
+ <OText size={14} color={theme.colors.disabled} style={{ textAlign: 'center', paddingVertical: 20 }}>
308
+ {!verificationState.email ? (
309
+ t('VERIFICATION_EMAIL_CODE_MESSAGE', 'In order to continue using our platform please verify your email')
310
+ ) : (
311
+ t('VERIFICATION_EMAIL_CODE_SENT_MESSAGE', 'Please type the verification code sent to your email')
312
+ )}
313
+ </OText>
314
+ )}
315
+
316
+ {isPhoneVerifyRequired && !isEmailVerifyRequired && (
317
+ <OText size={14} color={theme.colors.disabled} style={{ textAlign: 'center', paddingVertical: 20 }}>
318
+ {!verificationState.phone ? (
319
+ t('VERIFICATION_PHONE_CODE_MESSAGE', 'In order to continue using our platform please verify your phone number')
320
+ ) : (
321
+ t('VERIFICATION_PHONE_CODE_SENT_MESSAGE', 'Please, enter the verification code we sent to your mobile ending with :number').replace(':number', lastNumbers)
322
+ )}
323
+ </OText>
324
+ )}
325
+ </WrapperText>
326
+ <View style={{ position: 'absolute', top: 0, right: 0 }}>
327
+ <LogoutButton iconSize={20} />
328
+ </View>
329
+ </WrapperActions>
330
+
331
+ {isEmailVerifyRequired && (
332
+ !verificationState.email ? (
333
+ <InputWrapper>
334
+ <OInput
335
+ placeholder={user?.email}
336
+ style={style.inputStyle}
337
+ icon={theme.images.general.email}
338
+ isDisabled
339
+ />
340
+ </InputWrapper>
406
341
  ) : (
407
342
  <>
343
+ <WrappCountdown>
344
+ <CountDownContainer color={timer === '00:00' ? theme.colors.error : theme.colors.success}>
345
+ <OText
346
+ size={26}
347
+ color={timer === '00:00' ? theme.colors.error : theme.colors.success}
348
+ >
349
+ {timer}
350
+ </OText>
351
+ </CountDownContainer>
352
+ </WrappCountdown>
353
+
354
+ <InputsSection>
355
+ <OtpSection>
356
+ <DigitInput
357
+ disabled={otpState.length === CODE_LENGTH}
358
+ onPress={handleOnPress}
359
+ >
360
+ {codeDigitsArray.map(toDigitInput)}
361
+ </DigitInput>
362
+ <TextInput
363
+ ref={ref}
364
+ value={otpState}
365
+ placeholder='0'
366
+ onChangeText={setOtpState}
367
+ onSubmitEditing={handleOnBlur}
368
+ keyboardType="number-pad"
369
+ returnKeyType="done"
370
+ textContentType="oneTimeCode"
371
+ maxLength={CODE_LENGTH}
372
+ style={style.hiddenCodeInput}
373
+ />
374
+ </OtpSection>
375
+ </InputsSection>
376
+
377
+ <WrapperText>
378
+ <TouchableOpacity
379
+ onPress={() => handleSendOtp()}
380
+ >
381
+ <OText color={theme.colors.primary}>
382
+ {t('RESEND_AGAIN', 'Resend again?')}
383
+ </OText>
384
+ </TouchableOpacity>
385
+ </WrapperText>
386
+ </>
387
+ )
388
+ )}
389
+
390
+ {isPhoneVerifyRequired && !isEmailVerifyRequired && (
391
+ !verificationState.phone ? (
392
+ phoneState?.formatted ? (
393
+ <>
394
+ <InputWrapper phone>
395
+ <PhoneInputNumber
396
+ handleData={() => { }}
397
+ defaultValue={phoneState?.cellphone}
398
+ defaultCode={phoneState?.country_phone_code.replace('+', '')}
399
+ boxStyle={style.phoneSelect}
400
+ inputStyle={style.phoneInputStyle}
401
+ textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
402
+ noDropIcon
403
+ isDisabled
404
+ />
405
+ </InputWrapper>
406
+ </>
407
+ ) : (
408
408
  <OText size={14} color={theme.colors.disabled} style={{ textAlign: 'center', paddingVertical: 20 }}>
409
409
  {t('WARNING_PHONE_CODE_VALIDATION', 'Please update your phone number to continue')}
410
410
  </OText>
411
+ )
412
+ ) : (
413
+ <>
414
+ <WrappCountdown>
415
+ <CountDownContainer color={timer === '00:00' ? theme.colors.error : theme.colors.success}>
416
+ <OText
417
+ size={26}
418
+ color={timer === '00:00' ? theme.colors.error : theme.colors.success}
419
+ >
420
+ {timer}
421
+ </OText>
422
+ </CountDownContainer>
423
+ </WrappCountdown>
424
+
425
+ <InputsSection>
426
+ <OtpSection>
427
+ <DigitInput
428
+ disabled={otpState.length === CODE_LENGTH}
429
+ onPress={handleOnPress}
430
+ >
431
+ {codeDigitsArray.map(toDigitInput)}
432
+ </DigitInput>
433
+ <TextInput
434
+ ref={ref}
435
+ value={otpState}
436
+ placeholder='0'
437
+ onChangeText={setOtpState}
438
+ onSubmitEditing={handleOnBlur}
439
+ keyboardType="number-pad"
440
+ returnKeyType="done"
441
+ textContentType="oneTimeCode"
442
+ maxLength={CODE_LENGTH}
443
+ style={style.hiddenCodeInput}
444
+ />
445
+ </OtpSection>
446
+ </InputsSection>
447
+
411
448
  <WrapperText>
412
449
  <TouchableOpacity
413
- onPress={() => setModalIsOpen(true)}
450
+ onPress={() => handleSendOtp('phone')}
451
+ disabled={verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
414
452
  >
415
453
  <OText color={theme.colors.primary}>
416
- {t('UPDATE_PROFILE', 'Update profile')}
454
+ {t('RESEND_AGAIN', 'Resend again?')}
417
455
  </OText>
418
456
  </TouchableOpacity>
419
457
  </WrapperText>
420
458
  </>
421
459
  )
422
- ) : (
423
- <>
424
- <WrappCountdown>
425
- <CountDownContainer color={timer === '00:00' ? theme.colors.error: theme.colors.success}>
426
- <OText
427
- size={26}
428
- color={timer === '00:00' ? theme.colors.error: theme.colors.success}
429
- >
430
- {timer}
431
- </OText>
432
- </CountDownContainer>
433
- </WrappCountdown>
434
-
435
- <InputsSection>
436
- <OtpSection>
437
- <DigitInput
438
- disabled={otpState.length === CODE_LENGTH}
439
- onPress={handleOnPress}
440
- >
441
- {codeDigitsArray.map(toDigitInput)}
442
- </DigitInput>
443
- <TextInput
444
- ref={ref}
445
- value={otpState}
446
- placeholder='0'
447
- onChangeText={setOtpState}
448
- onSubmitEditing={handleOnBlur}
449
- keyboardType="number-pad"
450
- returnKeyType="done"
451
- textContentType="oneTimeCode"
452
- maxLength={CODE_LENGTH}
453
- style={style.hiddenCodeInput}
454
- />
455
- </OtpSection>
456
- </InputsSection>
457
-
458
- <WrapperText>
459
- <TouchableOpacity
460
- onPress={() => handleSendOtp('phone')}
461
- disabled={verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
462
- >
463
- <OText color={theme.colors.primary}>
464
- {t('RESEND_AGAIN', 'Resend again?')}
465
- </OText>
466
- </TouchableOpacity>
467
- </WrapperText>
468
- </>
469
- )
470
- )}
471
-
472
- </Container>
473
- <ButtonsActions>
474
- <View style={{ width: '100%' }}>
475
- <OButton
476
- onClick={(verificationState.email || verificationState.phone)
477
- ? () => setVerificationState({ email: false, phone: false })
478
- : () => handleSendOtp(isPhoneVerifyRequired && !isEmailVerifyRequired ? 'phone' : '')
479
- }
480
- text={(verificationState.email || verificationState.phone) ? t('CANCEL', 'Cancel') : t('SEND_CODE', 'Send code')}
481
- bgColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
482
- borderColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
483
- textStyle={{ color: (verificationState.email || verificationState.phone) ? 'black' : 'white' }}
484
- imgRightSrc={null}
485
- isLoading={verifyEmailState?.loadingSendCode || verifyEmailState?.loadingCheckCode || verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
486
- style={(verificationState.email || verificationState.phone) ? style.btnStyle : { borderRadius: 7.6 }}
460
+ )}
461
+
462
+ </Container>
463
+ <ButtonsActions>
464
+ <View style={{ width: '100%' }}>
465
+ <OButton
466
+ onClick={(verificationState.email || verificationState.phone)
467
+ ? () => setVerificationState({ email: false, phone: false })
468
+ : () => handleSendOtp(isPhoneVerifyRequired && !isEmailVerifyRequired ? 'phone' : '')
469
+ }
470
+ text={(verificationState.email || verificationState.phone) ? t('CANCEL', 'Cancel') : t('SEND_CODE', 'Send code')}
471
+ bgColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
472
+ borderColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
473
+ textStyle={{ color: (verificationState.email || verificationState.phone) ? 'black' : 'white' }}
474
+ imgRightSrc={null}
475
+ isLoading={verifyEmailState?.loadingSendCode || verifyEmailState?.loadingCheckCode || verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
476
+ style={(verificationState.email || verificationState.phone) ? style.btnStyle : { borderRadius: 7.6 }}
477
+ />
478
+ </View>
479
+ </ButtonsActions>
480
+ <View style={{ paddingHorizontal: 20, paddingBottom: 80 }}>
481
+ <UserDetails
482
+ user={user}
483
+ isEdit
484
+ isVerifiedPhone
487
485
  />
488
486
  </View>
489
- </ButtonsActions>
490
-
491
- <OModal
492
- open={modalIsOpen}
493
- entireModal
494
- customClose
495
- onClose={() => setModalIsOpen(false)}
496
- >
497
- <UserDetails
498
- user={user}
499
- handleSuccessUpdate={() => setModalIsOpen(false)}
500
- />
501
- </OModal>
487
+ </ScrollView>
502
488
  </SafeAreaView>
503
489
  )
504
490
  }
@@ -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`
@@ -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')