ordering-ui-react-native 0.15.78 → 0.15.79-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 (220) hide show
  1. package/package.json +7 -3
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +1 -1
  5. package/src/components/AddressForm/index.tsx +18 -2
  6. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  7. package/src/components/BusinessController/index.tsx +16 -8
  8. package/src/components/BusinessInformation/index.tsx +14 -0
  9. package/src/components/BusinessTypeFilter/index.tsx +1 -2
  10. package/src/components/BusinessesListing/index.tsx +1 -1
  11. package/src/components/Checkout/index.tsx +25 -3
  12. package/src/components/DriverTips/index.tsx +11 -6
  13. package/src/components/LanguageSelector/index.tsx +6 -2
  14. package/src/components/LoginForm/index.tsx +120 -30
  15. package/src/components/LoginForm/styles.tsx +6 -0
  16. package/src/components/NotificationSetting/index.tsx +85 -0
  17. package/src/components/OrderDetails/index.tsx +7 -21
  18. package/src/components/PaymentOptions/index.tsx +335 -365
  19. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  20. package/src/components/ReviewDriver/index.tsx +1 -1
  21. package/src/components/ReviewOrder/index.tsx +2 -1
  22. package/src/components/ReviewProducts/index.tsx +11 -0
  23. package/src/components/SignupForm/index.tsx +145 -61
  24. package/src/components/SingleProductCard/index.tsx +16 -4
  25. package/src/components/SingleProductReview/index.tsx +1 -1
  26. package/src/components/StripeElementsForm/index.tsx +25 -16
  27. package/src/components/StripeMethodForm/index.tsx +22 -24
  28. package/src/components/UpsellingProducts/index.tsx +1 -1
  29. package/src/components/UserProfileForm/index.tsx +63 -6
  30. package/src/components/UserProfileForm/styles.tsx +8 -0
  31. package/src/components/VerifyPhone/styles.tsx +1 -2
  32. package/src/components/shared/OBottomPopup.tsx +6 -2
  33. package/src/components/shared/OModal.tsx +1 -1
  34. package/src/hooks/useCountdownTimer.tsx +26 -0
  35. package/src/index.tsx +2 -0
  36. package/src/navigators/CheckoutNavigator.tsx +6 -0
  37. package/src/navigators/HomeNavigator.tsx +12 -0
  38. package/src/pages/BusinessesListing.tsx +7 -6
  39. package/src/pages/MultiCheckout.tsx +31 -0
  40. package/src/pages/MultiOrdersDetails.tsx +27 -0
  41. package/src/pages/OrderDetails.tsx +1 -1
  42. package/src/pages/ReviewDriver.tsx +2 -2
  43. package/src/pages/ReviewOrder.tsx +2 -2
  44. package/src/pages/Sessions.tsx +22 -0
  45. package/src/theme.json +0 -1
  46. package/src/types/index.tsx +18 -11
  47. package/src/utils/index.tsx +28 -29
  48. package/themes/business/index.tsx +4 -0
  49. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +100 -60
  50. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  51. package/themes/business/src/components/Chat/index.tsx +51 -91
  52. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  53. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  54. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  55. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  56. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  57. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  58. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
  59. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  60. package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
  61. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +26 -18
  62. package/themes/business/src/components/OrdersListManager/index.tsx +11 -4
  63. package/themes/business/src/components/OrdersOption/index.tsx +16 -4
  64. package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
  65. package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
  66. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  67. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  68. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  69. package/themes/business/src/components/shared/OModal.tsx +41 -38
  70. package/themes/business/src/types/index.tsx +15 -7
  71. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  72. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  73. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  74. package/themes/kiosk/src/components/BusinessMenu/index.tsx +39 -28
  75. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  76. package/themes/kiosk/src/components/Cart/index.tsx +11 -12
  77. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
  78. package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
  79. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  80. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
  81. package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
  82. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  83. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  84. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  85. package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
  86. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  87. package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
  88. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
  89. package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
  90. package/themes/kiosk/src/components/ProductForm/index.tsx +6 -7
  91. package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
  92. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
  93. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  94. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
  95. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  96. package/themes/kiosk/src/types/index.d.ts +1 -0
  97. package/themes/original/index.tsx +24 -0
  98. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  99. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  100. package/themes/original/src/components/AddressForm/index.tsx +7 -6
  101. package/themes/original/src/components/AddressList/index.tsx +2 -2
  102. package/themes/original/src/components/AppleLogin/index.tsx +6 -8
  103. package/themes/original/src/components/BusinessBasicInformation/index.tsx +291 -150
  104. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  105. package/themes/original/src/components/BusinessController/index.tsx +201 -96
  106. package/themes/original/src/components/BusinessController/styles.tsx +5 -0
  107. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
  108. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  109. package/themes/original/src/components/BusinessListingSearch/index.tsx +234 -64
  110. package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
  111. package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
  112. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
  113. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  114. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  115. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  116. package/themes/original/src/components/BusinessProductsList/index.tsx +65 -73
  117. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  118. package/themes/original/src/components/BusinessProductsListing/index.tsx +315 -176
  119. package/themes/original/src/components/BusinessProductsListing/styles.tsx +11 -0
  120. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  121. package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -38
  122. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  123. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +560 -0
  124. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
  125. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +661 -0
  126. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  127. package/themes/original/src/components/BusinessesListing/index.tsx +104 -462
  128. package/themes/original/src/components/Cart/index.tsx +84 -39
  129. package/themes/original/src/components/Cart/styles.tsx +4 -0
  130. package/themes/original/src/components/Checkout/index.tsx +100 -50
  131. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  132. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  133. package/themes/original/src/components/Favorite/index.tsx +92 -0
  134. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  135. package/themes/original/src/components/FavoriteList/index.tsx +298 -0
  136. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  137. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  138. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  139. package/themes/original/src/components/GoogleMap/index.tsx +11 -11
  140. package/themes/original/src/components/Help/index.tsx +21 -4
  141. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  142. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  143. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
  144. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  145. package/themes/original/src/components/LoginForm/index.tsx +332 -164
  146. package/themes/original/src/components/LoginForm/styles.tsx +1 -3
  147. package/themes/original/src/components/Messages/index.tsx +1 -1
  148. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  149. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  150. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  151. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  152. package/themes/original/src/components/MultiCheckout/index.tsx +304 -0
  153. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  154. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  155. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  156. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  157. package/themes/original/src/components/MyOrders/index.tsx +132 -27
  158. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  159. package/themes/original/src/components/NavBar/index.tsx +4 -4
  160. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  161. package/themes/original/src/components/OrderDetails/index.tsx +148 -63
  162. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  163. package/themes/original/src/components/OrderItAgain/index.tsx +72 -0
  164. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  165. package/themes/original/src/components/OrderSummary/index.tsx +5 -5
  166. package/themes/original/src/components/OrderTypeSelector/index.tsx +77 -35
  167. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  168. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
  169. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  170. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
  171. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  172. package/themes/original/src/components/OrdersOption/index.tsx +139 -46
  173. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  174. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  175. package/themes/original/src/components/PaymentOptionWallet/index.tsx +15 -22
  176. package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
  177. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  178. package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
  179. package/themes/original/src/components/ProductForm/index.tsx +712 -673
  180. package/themes/original/src/components/ProductForm/styles.tsx +9 -7
  181. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  182. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  183. package/themes/original/src/components/ProductOptionSubOption/index.tsx +13 -9
  184. package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
  185. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  186. package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
  187. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  188. package/themes/original/src/components/Promotions/index.tsx +145 -128
  189. package/themes/original/src/components/Promotions/styles.tsx +2 -0
  190. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  191. package/themes/original/src/components/ReviewOrder/index.tsx +1 -1
  192. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  193. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  194. package/themes/original/src/components/SearchBar/index.tsx +13 -5
  195. package/themes/original/src/components/ServiceForm/index.tsx +579 -0
  196. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  197. package/themes/original/src/components/Sessions/index.tsx +160 -0
  198. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  199. package/themes/original/src/components/SignupForm/index.tsx +237 -126
  200. package/themes/original/src/components/SingleOrderCard/index.tsx +316 -0
  201. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  202. package/themes/original/src/components/SingleProductCard/index.tsx +220 -94
  203. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  204. package/themes/original/src/components/StripeElementsForm/index.tsx +25 -9
  205. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  206. package/themes/original/src/components/UpsellingProducts/index.tsx +2 -6
  207. package/themes/original/src/components/UserDetails/index.tsx +32 -18
  208. package/themes/original/src/components/UserFormDetails/index.tsx +108 -74
  209. package/themes/original/src/components/UserProfile/index.tsx +10 -1
  210. package/themes/original/src/components/UserProfileForm/index.tsx +14 -9
  211. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  212. package/themes/original/src/components/Wallets/index.tsx +2 -2
  213. package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
  214. package/themes/original/src/components/shared/OButton.tsx +2 -0
  215. package/themes/original/src/components/shared/OInput.tsx +3 -2
  216. package/themes/original/src/components/shared/OModal.tsx +4 -2
  217. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  218. package/themes/original/src/types/index.tsx +199 -36
  219. package/themes/original/src/utils/index.tsx +94 -1
  220. 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
  }
@@ -61,7 +61,7 @@ const WalletsUI = (props: any) => {
61
61
 
62
62
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
63
63
 
64
- const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
64
+ const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
65
65
 
66
66
  const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
67
67
 
@@ -140,7 +140,7 @@ const WalletsUI = (props: any) => {
140
140
  </OTabs>
141
141
 
142
142
  <SectionContent>
143
- {!!loyaltyLevel && (
143
+ {!!loyaltyLevel && tabSelected === 'credit_point' && (
144
144
  <LoyaltyContent>
145
145
  <LoyaltyWrapp>
146
146
  <OText size={20}>
@@ -1,33 +1,45 @@
1
1
  import React from 'react'
2
- import { Modal, TouchableWithoutFeedback, Dimensions, StyleSheet, View, Text, Platform, StatusBar } from 'react-native'
2
+ import { Modal, TouchableWithoutFeedback, TouchableOpacity, Dimensions, StyleSheet, View, Text, Platform, StatusBar } from 'react-native'
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
+ import { OIcon } from '.';
4
5
  const deviceHeight = Dimensions.get('window').height
5
6
 
6
7
  interface Props {
7
8
  open: boolean;
9
+ transparent?: boolean;
8
10
  title?: string;
9
11
  children?: any;
10
12
  onClose?: any;
11
13
  isStatusBar?: boolean;
14
+ bottomContainerStyle?: any;
15
+ titleStyle?: any;
16
+ closeIcon?: any;
17
+ presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen" | undefined
12
18
  }
13
19
  const OBottomPopup = (props: Props) => {
14
20
  const {
15
21
  open,
22
+ transparent,
16
23
  title,
17
24
  onClose,
18
25
  children,
19
- isStatusBar
26
+ isStatusBar,
27
+ titleStyle,
28
+ bottomContainerStyle,
29
+ closeIcon,
30
+ presentationStyle
20
31
  } = props
21
32
  const { top, bottom } = useSafeAreaInsets();
33
+
22
34
  return (
23
35
  <Modal
24
36
  animationType='slide'
25
- transparent={false}
37
+ transparent={transparent}
26
38
  visible={open}
27
39
  onRequestClose={() => onClose()}
28
- presentationStyle={'fullScreen'}
40
+ presentationStyle={presentationStyle || 'fullScreen'}
29
41
  >
30
- {isStatusBar && <StatusBar translucent={false} />}
42
+ {isStatusBar && <StatusBar translucent={false} />}
31
43
  <View style={styles.container}>
32
44
  <TouchableWithoutFeedback
33
45
  style={styles.touchableOutsideStyle}
@@ -35,13 +47,24 @@ const OBottomPopup = (props: Props) => {
35
47
  >
36
48
  <View style={styles.touchableOutsideStyle} />
37
49
  </TouchableWithoutFeedback>
38
- <View style={styles.bottomContainer}>
50
+ <View style={{ ...styles.bottomContainer, ...bottomContainerStyle }}>
39
51
  <View style={{ paddingTop: top, paddingBottom: bottom }}>
40
- {title != '' && (
41
- <Text style={styles.titleStyle}>
42
- {title}
43
- </Text>
44
- )}
52
+ <View style={styles.modalTitleStyle}>
53
+ {closeIcon && (
54
+ <TouchableOpacity onPress={() => onClose()} style={styles.closeIconStyle}>
55
+ <OIcon
56
+ src={closeIcon}
57
+ width={20}
58
+ height={20}
59
+ />
60
+ </TouchableOpacity>
61
+ )}
62
+ {!!title && (
63
+ <Text style={{ ...styles.titleStyle, ...titleStyle }}>
64
+ {title}
65
+ </Text>
66
+ )}
67
+ </View>
45
68
  {children}
46
69
  </View>
47
70
  </View>
@@ -54,7 +77,7 @@ const styles = StyleSheet.create({
54
77
  container: {
55
78
  flex: 1,
56
79
  backgroundColor: '#000000AA',
57
- justifyContent: 'flex-end',
80
+ justifyContent: 'flex-end'
58
81
  },
59
82
  touchableOutsideStyle: {
60
83
  flex: 1,
@@ -68,8 +91,18 @@ const styles = StyleSheet.create({
68
91
  },
69
92
  titleStyle: {
70
93
  fontSize: 20,
71
- fontWeight: 'bold',
72
- marginVertical: 15
94
+ fontWeight: 'bold'
95
+ },
96
+ closeIconStyle: {
97
+ position: 'absolute',
98
+ left: 25,
99
+ top: 25,
100
+ zIndex: 100
101
+ },
102
+ modalTitleStyle: {
103
+ position: 'relative',
104
+ paddingHorizontal: 10,
105
+ paddingVertical: 20
73
106
  }
74
107
  })
75
108
 
@@ -78,6 +78,7 @@ interface Props {
78
78
  borderColor?: string;
79
79
  loadingStyle?: ViewStyle;
80
80
  showNextIcon?: boolean;
81
+ isDisabledWithSameStyles?: boolean;
81
82
  }
82
83
 
83
84
  const OButton = (props: Props): React.ReactElement => {
@@ -110,6 +111,7 @@ const OButton = (props: Props): React.ReactElement => {
110
111
  activeOpacity={props.activeOpacity}
111
112
  onPress={props.onClick}
112
113
  style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
114
+ disabled={props.isDisabledWithSameStyles}
113
115
  >
114
116
  <StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
115
117
  {props.imgLeftSrc ? (
@@ -56,7 +56,7 @@ const Wrapper = styled.Pressable`
56
56
  const OInput = (props: Props): React.ReactElement => {
57
57
  return (
58
58
  <Wrapper
59
- onPress={() => {props.forwardRef?.current?.focus?.(); props.onPress && props.onPress()}}
59
+ onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
60
60
  style={{
61
61
  backgroundColor: props.bgColor,
62
62
  borderColor: props.borderColor,
@@ -75,6 +75,7 @@ const OInput = (props: Props): React.ReactElement => {
75
75
  <MaterialIcon name={props?.vertorIcon} size={20} color={props?.vectorIconColor} style={{ marginHorizontal: 10 }} />
76
76
  )}
77
77
  <Input
78
+ autoFocus={props?.autoFocus}
78
79
  name={props.name}
79
80
  secureTextEntry={props.isSecured}
80
81
  onChangeText={(txt: any) => props.name ? props.onChange({ target: { name: props.name, value: txt } }) : props.onChange(txt)}
@@ -90,7 +91,7 @@ const OInput = (props: Props): React.ReactElement => {
90
91
  returnKeyType={props.returnKeyType}
91
92
  onSubmitEditing={props.onSubmitEditing}
92
93
  blurOnSubmit={props.blurOnSubmit}
93
- ref={(e : any) => {
94
+ ref={(e: any) => {
94
95
  props.forwardRef && (props.forwardRef.current = e)
95
96
  }}
96
97
  style={props?.inputStyle}
@@ -21,6 +21,7 @@ interface Props {
21
21
  isNotDecoration?: boolean;
22
22
  styleCloseButton?: any,
23
23
  isAvoidKeyBoardView?: boolean;
24
+ styleContainerCloseButton?: any;
24
25
  }
25
26
  const KeyboardView = styled.KeyboardAvoidingView`
26
27
  flex-grow: 1;
@@ -45,6 +46,7 @@ const OModal = (props: Props): React.ReactElement => {
45
46
  isNotDecoration,
46
47
  style,
47
48
  styleCloseButton,
49
+ styleContainerCloseButton,
48
50
  isAvoidKeyBoardView
49
51
  } = props
50
52
 
@@ -55,7 +57,7 @@ const OModal = (props: Props): React.ReactElement => {
55
57
  {!entireModal ? (
56
58
  <View style={styles.centeredView}>
57
59
  <View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
58
- <TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
60
+ <TouchableOpacity style={{...styles.wrapperIcon, ...styleContainerCloseButton}} onPress={onClose}>
59
61
  <OIcon
60
62
  src={theme.images.general.close}
61
63
  width={16}
@@ -91,7 +93,7 @@ const OModal = (props: Props): React.ReactElement => {
91
93
  animationType="slide"
92
94
  transparent={isTransparent}
93
95
  visible={open}
94
- onRequestClose={() => onClose()}
96
+ onRequestClose={() => onClose && onClose()}
95
97
  style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
96
98
  >
97
99
  {isAvoidKeyBoardView ? (
@@ -19,7 +19,11 @@ export const Container = styled.View`
19
19
 
20
20
  export const FloatingBottomContainer = (props: any) => {
21
21
  return (
22
- <Container style={{ width: windowWidth }}>
22
+ <Container style={{
23
+ width: windowWidth,
24
+ borderTopWidth: props?.borderTopWidth ?? 1,
25
+ borderRadius: props?.borderRadius ?? 0
26
+ }}>
23
27
  {props.children}
24
28
  </Container>
25
29
  )