ordering-ui-react-native 0.17.87 → 0.17.88-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 (216) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +1 -21
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +5 -0
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +33 -26
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +163 -123
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  21. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  22. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  23. package/themes/business/src/components/MapView/index.tsx +8 -8
  24. package/themes/business/src/components/MessagesOption/index.tsx +20 -93
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
  26. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  27. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +202 -12
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +81 -66
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  33. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  34. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  35. package/themes/business/src/components/OrdersOption/index.tsx +22 -22
  36. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  37. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  38. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
  39. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  40. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  41. package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  44. package/themes/business/src/components/StoresList/index.tsx +3 -4
  45. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  46. package/themes/business/src/components/shared/OModal.tsx +16 -9
  47. package/themes/business/src/types/index.tsx +25 -10
  48. package/themes/business/src/utils/index.tsx +29 -2
  49. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  51. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  53. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  54. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/original/index.tsx +1 -1
  61. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  62. package/themes/original/src/components/AddressForm/index.tsx +35 -17
  63. package/themes/original/src/components/AddressList/index.tsx +5 -8
  64. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  65. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  66. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +73 -37
  68. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  69. package/themes/original/src/components/BusinessController/index.tsx +35 -44
  70. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  71. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  72. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  73. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  74. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  75. package/themes/original/src/components/BusinessListingSearch/index.tsx +347 -336
  76. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  77. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  78. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  79. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  80. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  81. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  82. package/themes/original/src/components/BusinessProductsListing/index.tsx +663 -556
  83. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
  84. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +38 -405
  89. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  90. package/themes/original/src/components/Cart/index.tsx +60 -51
  91. package/themes/original/src/components/CartContent/index.tsx +102 -58
  92. package/themes/original/src/components/CartContent/styles.tsx +6 -6
  93. package/themes/original/src/components/Checkout/index.tsx +280 -35
  94. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  95. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  96. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  97. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  98. package/themes/original/src/components/Favorite/index.tsx +1 -5
  99. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  100. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  101. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
  102. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
  103. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +86 -10
  104. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  105. package/themes/original/src/components/GoogleMap/index.tsx +63 -7
  106. package/themes/original/src/components/Home/index.tsx +13 -4
  107. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  108. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  109. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  110. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  111. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  112. package/themes/original/src/components/MessageListing/index.tsx +9 -2
  113. package/themes/original/src/components/Messages/index.tsx +15 -4
  114. package/themes/original/src/components/MomentOption/index.tsx +193 -92
  115. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  116. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  117. package/themes/original/src/components/MultiCheckout/index.tsx +385 -52
  118. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  119. package/themes/original/src/components/MultiOrdersDetails/index.tsx +23 -19
  120. package/themes/original/src/components/MyOrders/index.tsx +25 -16
  121. package/themes/original/src/components/NavBar/index.tsx +20 -13
  122. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  123. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  124. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  125. package/themes/original/src/components/OrderDetails/index.tsx +50 -38
  126. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  127. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  128. package/themes/original/src/components/OrderProgress/index.tsx +34 -25
  129. package/themes/original/src/components/OrderSummary/index.tsx +83 -57
  130. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  131. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  132. package/themes/original/src/components/OrdersOption/index.tsx +59 -46
  133. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  134. package/themes/original/src/components/PageBanner/index.tsx +65 -29
  135. package/themes/original/src/components/PageBanner/styles.tsx +0 -3
  136. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  137. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  138. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  139. package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
  140. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  141. package/themes/original/src/components/ProductForm/index.tsx +88 -31
  142. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  143. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
  144. package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
  145. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  146. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  147. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  148. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  149. package/themes/original/src/components/Promotions/index.tsx +2 -2
  150. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  151. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  152. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  153. package/themes/original/src/components/ServiceForm/index.tsx +63 -20
  154. package/themes/original/src/components/Sessions/styles.tsx +1 -0
  155. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  156. package/themes/original/src/components/SingleOrderCard/index.tsx +42 -19
  157. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  158. package/themes/original/src/components/SingleProductCard/index.tsx +37 -26
  159. package/themes/original/src/components/SingleProductCard/styles.tsx +9 -3
  160. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  161. package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
  162. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  163. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  164. package/themes/original/src/components/UpsellingProducts/index.tsx +5 -10
  165. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  166. package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
  167. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  168. package/themes/original/src/components/UserProfile/index.tsx +8 -26
  169. package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
  170. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  171. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  172. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  173. package/themes/original/src/components/Wallets/index.tsx +52 -62
  174. package/themes/original/src/components/Wallets/styles.tsx +2 -4
  175. package/themes/original/src/components/shared/OButton.tsx +3 -3
  176. package/themes/original/src/components/shared/OInput.tsx +4 -5
  177. package/themes/original/src/components/shared/OModal.tsx +3 -3
  178. package/themes/original/src/types/index.tsx +37 -10
  179. package/themes/original/src/utils/index.tsx +185 -13
  180. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  181. package/src/navigators/BottomNavigator.tsx +0 -117
  182. package/src/navigators/CheckoutNavigator.tsx +0 -66
  183. package/src/navigators/HomeNavigator.tsx +0 -202
  184. package/src/navigators/NavigationRef.tsx +0 -7
  185. package/src/navigators/RootNavigator.tsx +0 -269
  186. package/src/pages/Account.tsx +0 -34
  187. package/src/pages/AddressForm.tsx +0 -62
  188. package/src/pages/AddressList.tsx +0 -24
  189. package/src/pages/BusinessProductsList.tsx +0 -81
  190. package/src/pages/BusinessesListing.tsx +0 -43
  191. package/src/pages/CartList.tsx +0 -49
  192. package/src/pages/Checkout.tsx +0 -101
  193. package/src/pages/ForgotPassword.tsx +0 -24
  194. package/src/pages/Help.tsx +0 -23
  195. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  196. package/src/pages/HelpGuide.tsx +0 -23
  197. package/src/pages/HelpOrder.tsx +0 -23
  198. package/src/pages/Home.tsx +0 -36
  199. package/src/pages/IntroductoryTutorial.tsx +0 -170
  200. package/src/pages/Login.tsx +0 -47
  201. package/src/pages/MomentOption.tsx +0 -30
  202. package/src/pages/MultiCheckout.tsx +0 -31
  203. package/src/pages/MultiOrdersDetails.tsx +0 -27
  204. package/src/pages/MyOrders.tsx +0 -40
  205. package/src/pages/NetworkError.tsx +0 -24
  206. package/src/pages/NotFound.tsx +0 -22
  207. package/src/pages/OrderDetails.tsx +0 -25
  208. package/src/pages/ProductDetails.tsx +0 -55
  209. package/src/pages/Profile.tsx +0 -36
  210. package/src/pages/ReviewDriver.tsx +0 -30
  211. package/src/pages/ReviewOrder.tsx +0 -32
  212. package/src/pages/ReviewProducts.tsx +0 -30
  213. package/src/pages/Sessions.tsx +0 -22
  214. package/src/pages/Signup.tsx +0 -53
  215. package/src/pages/SpinnerLoader.tsx +0 -10
  216. package/src/pages/Splash.tsx +0 -21
@@ -35,7 +35,6 @@ import {
35
35
  } from './styles';
36
36
  import { useWindowDimensions } from 'react-native';
37
37
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
38
- import styled from 'styled-components';
39
38
  import ToggleSwitch from 'toggle-switch-react-native';
40
39
 
41
40
  const ProfileListUI = (props: ProfileParams) => {
@@ -49,7 +48,7 @@ const ProfileListUI = (props: ProfileParams) => {
49
48
 
50
49
  const theme = useTheme();
51
50
 
52
- const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
51
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
53
52
  const hideProfileImage = theme?.profile?.components?.picture?.hidden
54
53
  const hideOrders = theme?.profile?.components?.orders?.hidden
55
54
  const hideProfile = theme?.profile?.components?.profile?.hidden
@@ -60,7 +59,7 @@ const ProfileListUI = (props: ProfileParams) => {
60
59
  const hideSession = theme?.bar_menu?.components?.sessions?.hidden
61
60
  const hidePromotions = theme?.bar_menu?.components?.promotions?.hidden
62
61
  const hideAddressList = theme?.profile?.components?.address_list?.hidden
63
- const showLanguages = !theme?.profile?.components?.languages?.hidden
62
+ const showLanguages = theme?.profile?.components?.languages?.hidden
64
63
  const showNotifications = !theme?.profile?.components?.notification_settings?.hidden
65
64
  const langPickerStyle = StyleSheet.create({
66
65
  inputAndroid: {
@@ -118,8 +117,6 @@ const ProfileListUI = (props: ProfileParams) => {
118
117
  const [, { showToast }] = useToast();
119
118
  const { errors } = useForm();
120
119
 
121
- const isAdmin = user?.level === 0
122
-
123
120
  const { height } = useWindowDimensions();
124
121
  const { top, bottom } = useSafeAreaInsets();
125
122
 
@@ -153,19 +150,8 @@ const ProfileListUI = (props: ProfileParams) => {
153
150
 
154
151
  const detailProps = {
155
152
  goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
156
- onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
157
- }
158
-
159
- const onRemoveAccount = () => {
160
- setConfirm({
161
- open: true,
162
- content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
163
- title: t('ACCOUNT_ALERT', 'Account alert'),
164
- handleOnAccept: () => {
165
- setConfirm({ ...confirm, open: false })
166
- handleRemoveAccount && handleRemoveAccount(user?.id)
167
- }
168
- })
153
+ onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params),
154
+ handleRemoveAccount
169
155
  }
170
156
 
171
157
  useEffect(() => {
@@ -175,7 +161,7 @@ const ProfileListUI = (props: ProfileParams) => {
175
161
  }, [removeAccountState])
176
162
 
177
163
  return (
178
- <View style={{ flex: 1, height: height - top - bottom, paddingTop: 20 }}>
164
+ <View style={{ flex: 1, height: '100%', paddingTop: 20 }}>
179
165
  <CenterView style={styles.pagePadding}>
180
166
  {user?.photo && !hideProfileImage && (
181
167
  <View style={styles.photo}>
@@ -238,11 +224,11 @@ const ProfileListUI = (props: ProfileParams) => {
238
224
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
239
225
  </ListItem>
240
226
  )}
241
- {!showNotifications && (
227
+ {showNotifications && (
242
228
  <ListItem onPress={() => navigation.navigate('Notifications', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
243
229
  <NotificationBadge style={{ borderRadius: 100 / 2 }} />
244
230
  <Ionicons name='notifications-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
245
- <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('NOTIFICATIONS', 'Notifications')}
231
+ <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MARKETING_NOTIFICATIONS', 'Marketing notifications')}
246
232
  </OText>
247
233
  <NotificationsWrapper>
248
234
  <ToggleSwitch
@@ -275,17 +261,13 @@ const ProfileListUI = (props: ProfileParams) => {
275
261
  )}
276
262
  </Actions>
277
263
 
278
- <Actions>
264
+ <Actions style={{ paddingTop: height * .02 }}>
279
265
  {!showLanguages && (
280
266
  <LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
281
267
  )}
282
268
  <View style={{ height: 17 }} />
283
269
  <LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
284
270
  <View style={{ height: 17 }} />
285
- <ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
286
- <OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
287
- <OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
288
- </ListItem>
289
271
  </Actions>
290
272
  </ListWrap>
291
273
  <OAlert
@@ -288,38 +288,37 @@ const ProfileUI = (props: ProfileParams) => {
288
288
  showCall={false}
289
289
  btnStyle={{ paddingLeft: 0 }}
290
290
  />
291
- <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
292
- <CenterView>
293
- <View style={styles.photo}>
294
- {user?.photo ? (
295
- <FastImage
296
- style={{ height: 60, width: 80, borderRadius: 8 }}
297
- source={{
298
- uri: user?.photo,
299
- priority: FastImage.priority.normal,
300
- }}
301
- resizeMode={FastImage.resizeMode.cover}
302
- />
303
- ) : (
304
- <Ionicons name='person-outline' size={50} />
305
- )}
306
- </View>
307
- <OIconButton
308
- icon={theme.images.general.camera}
309
- borderColor={theme.colors.clear}
310
- iconStyle={{ width: 20, height: 20 }}
311
- style={{ maxWidth: 40, position: 'absolute', alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
312
- onClick={() => handleImagePicker()}
313
- />
314
- </CenterView>
315
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
316
- <Spinner visible={formState?.loading || verifyPhoneState?.loading} />
317
- <UserFormDetailsUI
318
- {...props}
319
- isEdit
320
- setWillVerifyOtpState={setWillVerifyOtpState}
291
+ <CenterView>
292
+ <View style={styles.photo}>
293
+ {user?.photo ? (
294
+ <FastImage
295
+ style={{ height: 80, width: 80, borderRadius: 8 }}
296
+ source={{
297
+ uri: user?.photo,
298
+ priority: FastImage.priority.normal,
299
+ }}
300
+ resizeMode={FastImage.resizeMode.cover}
301
+ />
302
+ ) : (
303
+ <Ionicons name='person-outline' size={50} />
304
+ )}
305
+ </View>
306
+ <OIconButton
307
+ icon={theme.images.general.camera}
308
+ borderColor={theme.colors.clear}
309
+ iconStyle={{ width: 20, height: 20 }}
310
+ style={{ maxWidth: 40, position: 'absolute', alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
311
+ onClick={() => handleImagePicker()}
321
312
  />
322
- </KeyboardAvoidingView>
313
+ </CenterView>
314
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
315
+ <Spinner visible={formState?.loading || verifyPhoneState?.loading} />
316
+ <UserFormDetailsUI
317
+ {...props}
318
+ isProfile
319
+ isEdit
320
+ setWillVerifyOtpState={setWillVerifyOtpState}
321
+ />
323
322
  </Container>
324
323
  <OModal
325
324
  open={isModalVisible}
@@ -195,38 +195,39 @@ const UserVerificationUI = (props: any) => {
195
195
  }
196
196
 
197
197
  useEffect(() => {
198
- let _timer = TIME_COUNTDOWN - 1;
199
- let minutes = 0;
200
- let seconds = 0;
201
- const interval = setInterval(() => {
202
- minutes = _timer / 60;
203
- seconds = _timer % 60;
204
-
205
- minutes = minutes < 10 ? 0 + minutes : minutes;
206
- seconds = seconds < 10 ? 0 + seconds : seconds;
207
-
208
- const formatMinutes = parseInt(minutes.toString()) < 10
209
- ? `0${parseInt(minutes.toString())}`
210
- : parseInt(minutes.toString());
211
-
212
- const formatseconds = parseInt(seconds.toString()) < 10
213
- ? `0${parseInt(seconds.toString())}`
214
- : parseInt(seconds.toString());
215
-
216
- setTimer(`${formatMinutes}:${formatseconds}`);
217
-
218
- if (--_timer < 0) {
219
- clearInterval(interval);
220
- }
221
-
222
- if (timer === `${TIME_COUNTDOWN / 60}:00` && isSendCodeAgain) {
223
- setIsSendCodeAgain(false)
224
- clearInterval(interval);
225
- }
226
- }, 1000);
227
-
228
- return () => clearInterval(interval)
229
- }, [isSendCodeAgain])
198
+ if (verificationState.phone) {
199
+ let _timer = TIME_COUNTDOWN - 1;
200
+ let minutes = 0;
201
+ let seconds = 0;
202
+ const interval = setInterval(() => {
203
+ minutes = _timer / 60;
204
+ seconds = _timer % 60;
205
+
206
+ minutes = minutes < 10 ? 0 + minutes : minutes;
207
+ seconds = seconds < 10 ? 0 + seconds : seconds;
208
+
209
+ const formatMinutes = parseInt(minutes.toString()) < 10
210
+ ? `0${parseInt(minutes.toString())}`
211
+ : parseInt(minutes.toString());
212
+
213
+ const formatseconds = parseInt(seconds.toString()) < 10
214
+ ? `0${parseInt(seconds.toString())}`
215
+ : parseInt(seconds.toString());
216
+
217
+ setTimer(`${formatMinutes}:${formatseconds}`);
218
+
219
+ if (--_timer < 0) {
220
+ clearInterval(interval);
221
+ }
222
+
223
+ if (timer === `${TIME_COUNTDOWN / 60}:00` && isSendCodeAgain) {
224
+ setIsSendCodeAgain(false)
225
+ clearInterval(interval);
226
+ }
227
+ }, 1000);
228
+ return () => clearInterval(interval)
229
+ }
230
+ }, [isSendCodeAgain, verificationState.phone])
230
231
 
231
232
  useEffect(() => {
232
233
  if (otpState?.length === CODE_LENGTH) {
@@ -292,7 +293,7 @@ const UserVerificationUI = (props: any) => {
292
293
 
293
294
  useEffect(() => {
294
295
  setupUserPhoneNumber()
295
- }, [user])
296
+ }, [user?.cellphone, user?.country_phone_code])
296
297
 
297
298
  return (
298
299
  <SafeAreaView style={{ flex: 1 }}>
@@ -401,6 +402,7 @@ const UserVerificationUI = (props: any) => {
401
402
  textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
402
403
  noDropIcon
403
404
  isDisabled
405
+ updateStateWithSubmit
404
406
  />
405
407
  </InputWrapper>
406
408
  </>
@@ -460,28 +462,31 @@ const UserVerificationUI = (props: any) => {
460
462
  )}
461
463
 
462
464
  </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>
465
+ {!!phoneState?.cellphone && (
466
+ <ButtonsActions>
467
+ <View style={{ width: '100%' }}>
468
+ <OButton
469
+ onClick={(verificationState.email || verificationState.phone)
470
+ ? () => setVerificationState({ email: false, phone: false })
471
+ : () => handleSendOtp(isPhoneVerifyRequired && !isEmailVerifyRequired ? 'phone' : '')
472
+ }
473
+ text={(verificationState.email || verificationState.phone) ? t('CANCEL', 'Cancel') : t('SEND_CODE', 'Send code')}
474
+ bgColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
475
+ borderColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
476
+ textStyle={{ color: (verificationState.email || verificationState.phone) ? 'black' : 'white' }}
477
+ imgRightSrc={null}
478
+ isLoading={verifyEmailState?.loadingSendCode || verifyEmailState?.loadingCheckCode || verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
479
+ style={(verificationState.email || verificationState.phone) ? style.btnStyle : { borderRadius: 7.6 }}
480
+ />
481
+ </View>
482
+ </ButtonsActions>
483
+ )}
480
484
  <View style={{ paddingHorizontal: 20, paddingBottom: 80 }}>
481
485
  <UserDetails
482
486
  user={user}
483
487
  isEdit
484
488
  isVerifiedPhone
489
+ dontToggleEditMode
485
490
  />
486
491
  </View>
487
492
  </ScrollView>
@@ -54,7 +54,7 @@ export const WalletTransactionItem = (props: any) => {
54
54
  <OText>{item?.description}</OText>
55
55
  </DescriptionBlock>
56
56
  )}
57
- {!!item?.code && (
57
+ {/* {!!item?.code && (
58
58
  <DescriptionBlock>
59
59
  <OText weight={'bold'}>
60
60
  {t('CODE', 'Code')}
@@ -63,7 +63,7 @@ export const WalletTransactionItem = (props: any) => {
63
63
  </OText>
64
64
  </OText>
65
65
  </DescriptionBlock>
66
- )}
66
+ )} */}
67
67
  </Container>
68
68
  )
69
69
  }
@@ -63,12 +63,12 @@ export const WalletTransactions = (props: any) => {
63
63
  (transactionsList?.error ||
64
64
  !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
65
65
  (
66
- <NotFoundSource
67
- content={transactionsList?.error
66
+ <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>
67
+ {transactionsList?.error
68
68
  ? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
69
69
  : t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
70
70
  }
71
- />
71
+ </OText>
72
72
  )}
73
73
  </View>
74
74
  </Container>
@@ -3,6 +3,7 @@ import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity, Platform } f
3
3
  import { useTheme } from 'styled-components/native'
4
4
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
5
5
  import FastImage from 'react-native-fast-image'
6
+ import NavBar from '../NavBar'
6
7
  import {
7
8
  WalletList,
8
9
  useLanguage,
@@ -71,8 +72,8 @@ const WalletsUI = (props: any) => {
71
72
 
72
73
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
73
74
  const [openHistory, setOpenHistory] = useState(false)
74
- const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
75
- const hideWalletsTheme = theme?.bar_menu?.components?.wallets?.hidden
75
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
76
+ const hideWalletsTheme = theme?.bar_menu?.components?.wallet?.hidden === true
76
77
 
77
78
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
78
79
 
@@ -119,60 +120,42 @@ const WalletsUI = (props: any) => {
119
120
 
120
121
  return (
121
122
  <>
122
- <Container>
123
+ <Container
124
+ pdng={Platform.OS === 'ios' ? '10px' : '0'}
125
+ >
123
126
  <Header>
124
- <View style={{
125
- ...{
126
- width: '100%',
127
- display: 'flex',
128
- flexDirection: 'row',
129
- alignItems: 'center',
130
- },
131
- }}>
132
- {(!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout && (
127
+ <View style={{
128
+ ...{
129
+ width: '100%',
130
+ display: 'flex',
131
+ flexDirection: !hideWalletsTheme ? 'column' : 'row',
132
+ justifyContent: !hideWalletsTheme ? 'flex-start' : 'space-between',
133
+ alignItems: !hideWalletsTheme ? 'flex-start' : 'center',
134
+ marginTop: !hideWalletsTheme ? 0 : 10,
135
+ },
136
+ }}>
137
+ <NavBar
138
+ title={t('WALLETS', 'Wallets')}
139
+ titleAlign={'center'}
140
+ onActionLeft={goToBack}
141
+ showCall={false}
142
+ paddingTop={10}
143
+ btnStyle={{ paddingLeft: 0 }}
144
+ isVertical={!hideWalletsTheme}
145
+ hideArrowLeft={!hideWalletsTheme}
146
+ />
147
+ {isChewLayout && !openHistory && (
133
148
  <OButton
134
- imgLeftStyle={{ width: 18 }}
149
+ text={t('WALLET_HISTORY', 'Wallet history')}
150
+ bgColor={theme.colors.white}
151
+ borderColor={theme.colors.lightGray}
135
152
  imgRightSrc={null}
136
- style={{
137
- borderWidth: 0,
138
- width: 26,
139
- height: 26,
140
- backgroundColor: '#FFF',
141
- borderColor: '#FFF',
142
- shadowColor: '#FFF',
143
- paddingLeft: 0,
144
- paddingRight: 0,
145
- marginTop: 30,
146
- }}
147
- onClick={goToBack}
148
- icon={AntDesignIcon}
149
- iconProps={{
150
- name: 'arrowleft',
151
- size: 26
152
- }}
153
+ textStyle={{ fontSize: 12, color: theme.colors.disabled }}
154
+ onClick={() => setOpenHistory(true)}
155
+ style={{ borderRadius: 8, height: 40, width: !hideWalletsTheme ? '100%' : 150, marginTop: !hideWalletsTheme ? 10 : 0 }}
153
156
  />
154
157
  )}
155
- <OText
156
- size={20}
157
- style={{
158
- marginTop: 30,
159
- marginLeft: (!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout ? 10 : 0,
160
- color: theme.colors.textNormal,
161
- }}
162
- weight={Platform.OS === 'ios' ? '600' : 'bold'}
163
- >{t('WALLETS', 'Wallets')}</OText>
164
- </View>
165
- {isChewLayout && (
166
- <OButton
167
- text={t('WALLET_HISTORY', 'Wallet history')}
168
- bgColor={theme.colors.white}
169
- borderColor={theme.colors.lightGray}
170
- imgRightSrc={null}
171
- textStyle={{ fontSize: 12, color: theme.colors.disabled }}
172
- onClick={() => setOpenHistory(true)}
173
- style={{ borderRadius: 8, height: 40 }}
174
- />
175
- )}
158
+ </View>
176
159
  </Header>
177
160
 
178
161
  {!walletList.loading &&
@@ -213,9 +196,9 @@ const WalletsUI = (props: any) => {
213
196
  <LoyaltyContent>
214
197
  <LoyaltyWrapp>
215
198
  <OText size={20}>
216
- {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
199
+ {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}`}
217
200
  </OText>
218
- {/* {loyaltyLevel.image ? (
201
+ {loyaltyLevel.image ? (
219
202
  <FastImage
220
203
  style={styles.logoStyle}
221
204
  source={{
@@ -230,7 +213,7 @@ const WalletsUI = (props: any) => {
230
213
  source={theme.images.dummies.loyaltyLevel}
231
214
  resizeMode='contain'
232
215
  />
233
- )} */}
216
+ )}
234
217
  <OText
235
218
  size={22}
236
219
  weight='bold'
@@ -256,9 +239,13 @@ const WalletsUI = (props: any) => {
256
239
  </OText>
257
240
  </BalanceElement>
258
241
 
259
- <View style={styles.dividerStyle} />
260
- <GiftCardUI navigation={navigation} />
261
- <View style={styles.dividerStyle} />
242
+ {currentWalletSelected?.type === 'cash' && (
243
+ <>
244
+ <View style={styles.dividerStyle} />
245
+ <GiftCardUI navigation={navigation} />
246
+ <View style={styles.dividerStyle} />
247
+ </>
248
+ )}
262
249
 
263
250
  {!isChewLayout && (
264
251
  <WalletTransactions
@@ -313,15 +300,18 @@ const WalletsUI = (props: any) => {
313
300
  <ScrollView>
314
301
  <WalletTransactionsWrapper>
315
302
  <OButton
303
+ imgLeftStyle={{ width: 18 }}
316
304
  imgRightSrc={null}
317
305
  style={{
318
306
  borderWidth: 0,
319
- backgroundColor: theme.colors.white,
320
- padding: 0,
321
- paddingHorizontal: 0,
322
- width: 30,
307
+ width: 26,
308
+ height: 26,
309
+ backgroundColor: '#FFF',
310
+ borderColor: '#FFF',
311
+ shadowColor: '#FFF',
323
312
  paddingLeft: 0,
324
- paddingRight: 0
313
+ paddingRight: 0,
314
+ marginBottom: 10
325
315
  }}
326
316
  onClick={() => setOpenHistory(false)}
327
317
  icon={AntDesignIcon}
@@ -1,13 +1,11 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- display: flex;
5
- flex-direction: column;
4
+ padding-bottom: 20px;
5
+ padding-top: ${(props: any) => props.pdng};
6
6
  `
7
7
  export const Header = styled.View`
8
8
  flex-direction: row;
9
- align-items: center;
10
- justify-content: space-between;
11
9
  `
12
10
  export const SectionContent = styled.View`
13
11
  width: 100%;
@@ -27,8 +27,8 @@ const StyledButton = styled.View<Props>`
27
27
  padding-left: 20px;
28
28
  padding-right: 20px;
29
29
  position: relative;
30
- ${(props : any) => props?.theme?.general?.components?.buttons?.borderRadius && css`
31
- border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius};
30
+ ${(props: any) => props?.theme?.general?.components?.buttons?.borderRadius && css`
31
+ border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius}px;
32
32
  `}
33
33
  `
34
34
  const StyledButtonDisabled = styled(StyledButton)`
@@ -119,7 +119,7 @@ const OButton = (props: Props): React.ReactElement => {
119
119
  style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
120
120
  disabled={props.isDisabledWithSameStyles}
121
121
  >
122
- <StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
122
+ <StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius } : { ...props.style, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius }}>
123
123
  {props.icon ? (
124
124
  <props.icon {...props.iconProps} />
125
125
  ) : null}
@@ -3,7 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
3
3
  import styled from 'styled-components/native';
4
4
  import OIcon from './OIcon';
5
5
  import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
6
- import { useTheme, css } from 'styled-components/native';
6
+ import { useTheme } from 'styled-components/native';
7
7
 
8
8
  const Input = styled.TextInput`
9
9
  flex-grow: 1;
@@ -53,9 +53,6 @@ const Wrapper = styled.Pressable`
53
53
  align-items: center;
54
54
  justify-content: center;
55
55
  width: 100%;
56
- ${(props: any) => props.theme?.general?.components?.inputs?.borderRadius && css`
57
- border-radius: ${props?.theme?.general?.components?.inputs?.borderRadius};
58
- `}
59
56
  `;
60
57
 
61
58
  const OInput = (props: Props): React.ReactElement => {
@@ -104,7 +101,9 @@ const OInput = (props: Props): React.ReactElement => {
104
101
  props.forwardRef && (props.forwardRef.current = e)
105
102
  }}
106
103
  style={{
107
- color: theme?.general?.components?.inputs?.color,
104
+ ...(theme?.general?.components?.inputs?.color && {
105
+ color: theme?.general?.components?.inputs?.color
106
+ }),
108
107
  ...props?.inputStyle
109
108
  }}
110
109
  onFocus={() => setInputFocused(true)}
@@ -52,7 +52,7 @@ const OModal = (props: Props): React.ReactElement => {
52
52
 
53
53
  const theme = useTheme();
54
54
 
55
- const RenderSafeAreaView = () => (
55
+ const renderSafeAreaView = () => (
56
56
  <SafeAreaView style={styles.container}>
57
57
  {!entireModal ? (
58
58
  <View style={styles.centeredView}>
@@ -101,10 +101,10 @@ const OModal = (props: Props): React.ReactElement => {
101
101
  enabled
102
102
  behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
103
103
  >
104
- <RenderSafeAreaView/>
104
+ {renderSafeAreaView()}
105
105
  </KeyboardView>
106
106
  ) : (
107
- <RenderSafeAreaView/>
107
+ renderSafeAreaView()
108
108
  )}
109
109
  </Modal>
110
110
  );