ordering-ui-react-native 0.16.24 → 0.16.25-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 (201) hide show
  1. package/package.json +7 -4
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  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 +10 -8
  8. package/src/components/BusinessInformation/index.tsx +33 -4
  9. package/src/components/BusinessInformation/styles.tsx +2 -2
  10. package/src/components/BusinessProductsList/index.tsx +10 -10
  11. package/src/components/BusinessesListing/index.tsx +1 -1
  12. package/src/components/Checkout/index.tsx +2 -1
  13. package/src/components/LanguageSelector/index.tsx +21 -16
  14. package/src/components/LoginForm/index.tsx +118 -30
  15. package/src/components/LoginForm/styles.tsx +6 -0
  16. package/src/components/Messages/index.tsx +2 -2
  17. package/src/components/NotificationSetting/index.tsx +85 -0
  18. package/src/components/OrderDetails/index.tsx +2 -20
  19. package/src/components/OrdersOption/index.tsx +54 -56
  20. package/src/components/PaymentOptions/index.tsx +335 -365
  21. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  22. package/src/components/ReviewDriver/index.tsx +1 -1
  23. package/src/components/ReviewOrder/index.tsx +2 -1
  24. package/src/components/ReviewProducts/index.tsx +11 -0
  25. package/src/components/SignupForm/index.tsx +143 -61
  26. package/src/components/SingleProductReview/index.tsx +8 -5
  27. package/src/components/StripeElementsForm/index.tsx +25 -16
  28. package/src/components/VerifyPhone/styles.tsx +1 -2
  29. package/src/components/shared/OBottomPopup.tsx +6 -2
  30. package/src/index.tsx +2 -0
  31. package/src/pages/BusinessesListing.tsx +7 -6
  32. package/src/pages/OrderDetails.tsx +1 -1
  33. package/src/pages/ReviewDriver.tsx +2 -2
  34. package/src/pages/ReviewOrder.tsx +2 -2
  35. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  36. package/src/types/index.tsx +13 -9
  37. package/src/utils/index.tsx +0 -1
  38. package/themes/business/index.tsx +4 -0
  39. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  40. package/themes/business/src/components/Chat/index.tsx +42 -34
  41. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  42. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  43. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  44. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  45. package/themes/business/src/components/MapView/index.tsx +12 -1
  46. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  47. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  48. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  49. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  50. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  51. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  52. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  53. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  54. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  55. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  56. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  57. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  58. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  59. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  60. package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
  61. package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
  62. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  63. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  64. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  65. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  66. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  67. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  68. package/themes/business/src/components/shared/OModal.tsx +40 -37
  69. package/themes/business/src/types/index.tsx +15 -9
  70. package/themes/business/src/utils/index.tsx +10 -0
  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/Checkout/index.tsx +6 -0
  75. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  76. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  77. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  78. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  79. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  80. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  81. package/themes/kiosk/src/types/index.d.ts +2 -0
  82. package/themes/original/index.tsx +12 -0
  83. package/themes/original/src/components/AddressForm/index.tsx +139 -135
  84. package/themes/original/src/components/AddressList/index.tsx +1 -1
  85. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  86. package/themes/original/src/components/BusinessBasicInformation/index.tsx +311 -161
  87. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  88. package/themes/original/src/components/BusinessController/index.tsx +190 -113
  89. package/themes/original/src/components/BusinessController/styles.tsx +0 -7
  90. package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -4
  91. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  92. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  93. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  94. package/themes/original/src/components/BusinessListingSearch/index.tsx +101 -125
  95. package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
  96. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  97. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  98. package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
  99. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  100. package/themes/original/src/components/BusinessProductsListing/index.tsx +287 -175
  101. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -8
  102. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  103. package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
  104. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  105. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
  106. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -10
  107. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
  108. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  109. package/themes/original/src/components/BusinessesListing/index.tsx +105 -519
  110. package/themes/original/src/components/Cart/index.tsx +42 -10
  111. package/themes/original/src/components/Cart/styles.tsx +4 -0
  112. package/themes/original/src/components/CartContent/index.tsx +22 -16
  113. package/themes/original/src/components/Checkout/index.tsx +90 -53
  114. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  115. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  116. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  117. package/themes/original/src/components/Favorite/index.tsx +1 -0
  118. package/themes/original/src/components/FavoriteList/index.tsx +32 -2
  119. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  120. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  121. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  122. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
  123. package/themes/original/src/components/HelpGuide/index.tsx +8 -3
  124. package/themes/original/src/components/HelpOrder/index.tsx +8 -3
  125. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  126. package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
  127. package/themes/original/src/components/LoginForm/index.tsx +82 -44
  128. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  129. package/themes/original/src/components/Messages/index.tsx +17 -17
  130. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  131. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  132. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  133. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  135. package/themes/original/src/components/MyOrders/index.tsx +70 -6
  136. package/themes/original/src/components/NavBar/index.tsx +15 -9
  137. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  138. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  139. package/themes/original/src/components/Notifications/index.tsx +148 -0
  140. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  141. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  142. package/themes/original/src/components/OrderDetails/index.tsx +190 -35
  143. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  144. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  145. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  146. package/themes/original/src/components/OrderProgress/index.tsx +8 -2
  147. package/themes/original/src/components/OrderSummary/index.tsx +1 -34
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  149. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  150. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +100 -106
  151. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +17 -12
  152. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  153. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  154. package/themes/original/src/components/PaymentOptions/index.tsx +42 -24
  155. package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
  156. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  157. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  158. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  159. package/themes/original/src/components/ProductForm/index.tsx +710 -653
  160. package/themes/original/src/components/ProductForm/styles.tsx +9 -7
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  162. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  163. package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
  164. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  165. package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
  166. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  167. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  168. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  169. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  170. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  171. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  172. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  173. package/themes/original/src/components/ServiceForm/index.tsx +631 -0
  174. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  175. package/themes/original/src/components/SignupForm/index.tsx +350 -206
  176. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  177. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  178. package/themes/original/src/components/SingleProductCard/index.tsx +207 -107
  179. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -10
  180. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  181. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  182. package/themes/original/src/components/StripeElementsForm/index.tsx +15 -7
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  184. package/themes/original/src/components/UserDetails/index.tsx +31 -17
  185. package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
  186. package/themes/original/src/components/UserProfile/index.tsx +54 -29
  187. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  188. package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
  189. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  190. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  191. package/themes/original/src/components/Wallets/index.tsx +174 -162
  192. package/themes/original/src/components/Wallets/styles.tsx +10 -8
  193. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  194. package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
  195. package/themes/original/src/components/shared/OButton.tsx +10 -3
  196. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  197. package/themes/original/src/components/shared/OInput.tsx +3 -2
  198. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  199. package/themes/original/src/types/index.tsx +122 -30
  200. package/themes/original/src/utils/index.tsx +77 -0
  201. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -0,0 +1,76 @@
1
+ import React from 'react'
2
+ import { View } from 'react-native'
3
+ import { useLanguage } from 'ordering-components/native'
4
+ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
5
+ import { useTheme } from 'styled-components/native'
6
+ import { OText } from '../shared';
7
+ import { WalletTransactionItem } from '../WalletTransactionItem'
8
+ import { NotFoundSource } from '../NotFoundSource';
9
+
10
+ import {
11
+ Container,
12
+ TransactionsWrapper
13
+ } from './styles'
14
+
15
+ export const WalletTransactions = (props: any) => {
16
+ const {
17
+ transactionsList,
18
+ currentWalletSelected
19
+ } = props
20
+
21
+ const theme = useTheme()
22
+ const [, t] = useLanguage()
23
+
24
+ return (
25
+ <Container>
26
+ <View style={{ width: '100%', paddingHorizontal: 1, paddingBottom: 40 }}>
27
+ {!transactionsList?.loading &&
28
+ !transactionsList?.error &&
29
+ transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length > 0 &&
30
+ (
31
+ <>
32
+ <OText style={{fontSize: 20, color: theme.colors.textNormal, marginBottom: 30}}>
33
+ {t('TRANSACTIONS_HISTORY', 'Transactions history')}
34
+ </OText>
35
+ <TransactionsWrapper>
36
+ {transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction: any, i: number) =>(
37
+ <WalletTransactionItem
38
+ idx={i}
39
+ type={currentWalletSelected?.type}
40
+ key={transaction.id}
41
+ item={transaction}
42
+ withFormatPrice={currentWalletSelected?.type === 'cash'}
43
+ />
44
+ ))}
45
+ </TransactionsWrapper>
46
+ </>
47
+ )}
48
+
49
+ {(transactionsList?.loading || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) && (
50
+ <View>
51
+ {[...Array(4).keys()].map(i => (
52
+ <View style={{ marginBottom: 10 }} key={i}>
53
+ <Placeholder Animation={Fade}>
54
+ <PlaceholderLine width={100} height={100} style={{ marginBottom: 0, borderRadius: 8 }} />
55
+ </Placeholder>
56
+ </View>
57
+ ))}
58
+ </View>
59
+ )}
60
+
61
+ {!transactionsList?.loading &&
62
+ !(transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) &&
63
+ (transactionsList?.error ||
64
+ !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
65
+ (
66
+ <NotFoundSource
67
+ content={transactionsList?.error
68
+ ? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
69
+ : t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
70
+ }
71
+ />
72
+ )}
73
+ </View>
74
+ </Container>
75
+ )
76
+ }
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const Container = styled.View`
4
+ display: flex;
5
+ flex-direction: column;
6
+ `
7
+
8
+ export const TransactionsWrapper = styled.View`
9
+ display: flex;
10
+ flex-direction: column;
11
+ border-left-width: 2px;
12
+ border-left-color: ${(props: any) => props.theme.colors.disabled};
13
+ `
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Pressable, StyleSheet, View } from 'react-native';
2
+ import { Pressable, StyleSheet, View, ScrollView } from 'react-native';
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'
@@ -9,23 +9,25 @@ import {
9
9
  useUtils,
10
10
  useConfig
11
11
  } from 'ordering-components/native'
12
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
12
13
 
13
14
  import {
14
15
  Container,
16
+ Header,
15
17
  BalanceElement,
16
- TransactionsWrapper,
17
18
  OTabs,
18
19
  OTab,
19
20
  SectionContent,
20
21
  LoyaltyContent,
21
22
  LoyaltyWrapp,
22
- LoyaltyImg
23
+ LoyaltyImg,
24
+ WalletTransactionsWrapper
23
25
  } from './styles'
24
26
 
25
27
  import NavBar from '../NavBar'
26
- import { OText } from '../shared';
28
+ import { OButton, OIcon, OText, OModal } from '../shared';
27
29
  import { NotFoundSource } from '../NotFoundSource';
28
- import { WalletTransactionItem } from '../WalletTransactionItem'
30
+ import { WalletTransactions } from '../WalletTransactions'
29
31
 
30
32
  const WalletsUI = (props: any) => {
31
33
  const {
@@ -60,6 +62,8 @@ const WalletsUI = (props: any) => {
60
62
  });
61
63
 
62
64
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
65
+ const [openHistory, setOpenHistory] = useState(false)
66
+ const isChewLayout = theme?.wallets_view?.components?.layout?.type === 'chew'
63
67
 
64
68
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
65
69
 
@@ -98,180 +102,188 @@ const WalletsUI = (props: any) => {
98
102
  }, [configs])
99
103
 
100
104
  useEffect(() => {
101
- if(refreshWallets){
105
+ if (refreshWallets) {
102
106
  getWallets()
103
107
  setRefreshWallets && setRefreshWallets(false)
104
108
  }
105
109
  }, [refreshWallets])
106
110
 
107
111
  return (
108
- <Container>
109
- <NavBar
110
- title={t('WALLETS', 'Wallets')}
111
- titleAlign={'center'}
112
- onActionLeft={goToBack}
113
- showCall={false}
114
- paddingTop={10}
115
- btnStyle={{ paddingLeft: 0 }}
116
- />
112
+ <>
113
+ <Container>
114
+ <Header>
115
+ <NavBar
116
+ title={isChewLayout ? '' : t('WALLETS', 'Wallets')}
117
+ titleAlign={'center'}
118
+ onActionLeft={goToBack}
119
+ showCall={false}
120
+ paddingTop={10}
121
+ btnStyle={{ paddingLeft: 0 }}
122
+ style={{ flex: 1 }}
123
+ />
124
+ {isChewLayout && (
125
+ <OButton
126
+ text={t('WALLET_HISTORY', 'Wallet history')}
127
+ bgColor={theme.colors.white}
128
+ borderColor={theme.colors.lightGray}
129
+ imgRightSrc={null}
130
+ textStyle={{ fontSize: 12, color: theme.colors.disabled }}
131
+ onClick={() => setOpenHistory(true)}
132
+ style={{ borderRadius: 8, height: 40 }}
133
+ />
134
+ )}
135
+ </Header>
117
136
 
118
- {!walletList.loading &&
119
- !userLoyaltyLevel.loading &&
120
- !walletList.error &&
121
- walletList.wallets?.length > 0 &&
122
- (
123
- <>
124
- <OTabs
125
- horizontal
126
- showsHorizontalScrollIndicator={false}
127
- >
128
- {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
129
- <Pressable
130
- key={wallet.id}
131
- onPress={() => handleChangeTab(wallet)}
137
+ {!walletList.loading &&
138
+ !userLoyaltyLevel.loading &&
139
+ !walletList.error &&
140
+ walletList.wallets?.length > 0 &&
141
+ (
142
+ <>
143
+ <OTabs
144
+ horizontal
145
+ showsHorizontalScrollIndicator={false}
132
146
  >
133
- <OTab isSelected={tabSelected === wallet.type}>
134
- <OText size={18}>
135
- {walletName[wallet.type]?.name}
136
- </OText>
137
- </OTab>
138
- </Pressable>
139
- ))}
140
- </OTabs>
147
+ {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
148
+ <Pressable
149
+ key={wallet.id}
150
+ onPress={() => handleChangeTab(wallet)}
151
+ >
152
+ <OTab isSelected={tabSelected === wallet.type}>
153
+ <OText size={18} color={tabSelected === wallet.type && theme.colors.primary}>
154
+ {walletName[wallet.type]?.name}
155
+ </OText>
156
+ </OTab>
157
+ </Pressable>
158
+ ))}
159
+ </OTabs>
141
160
 
142
- <SectionContent>
143
- {!!loyaltyLevel && tabSelected === 'credit_point' && (
144
- <LoyaltyContent>
145
- <LoyaltyWrapp>
146
- <OText size={20}>
147
- {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
161
+ <SectionContent>
162
+ {!!loyaltyLevel && tabSelected === 'credit_point' && (
163
+ <LoyaltyContent>
164
+ <LoyaltyWrapp>
165
+ <OText size={20}>
166
+ {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
167
+ </OText>
168
+ {/* {loyaltyLevel.image ? (
169
+ <FastImage
170
+ style={styles.logoStyle}
171
+ source={{
172
+ uri: loyaltyLevel.image,
173
+ priority: FastImage.priority.high,
174
+ cache: FastImage.cacheControl.web
175
+ }}
176
+ resizeMode={FastImage.resizeMode.contain}
177
+ />
178
+ ) : (
179
+ <LoyaltyImg
180
+ source={theme.images.dummies.loyaltyLevel}
181
+ resizeMode='contain'
182
+ />
183
+ )} */}
184
+ <OText
185
+ size={22}
186
+ weight='bold'
187
+ style={{ textTransform: 'uppercase' }}
188
+ color={theme.colors.primary}
189
+ >
190
+ {loyaltyLevel.name}
191
+ </OText>
192
+ </LoyaltyWrapp>
193
+ </LoyaltyContent>
194
+ )}
195
+ <BalanceElement>
196
+ <OText size={20} style={{ fontWeight: '600' }}>
197
+ {currentWalletSelected?.type === 'cash'
198
+ ? parsePrice(currentWalletSelected?.balance)
199
+ : currentWalletSelected?.balance
200
+ }
148
201
  </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}
202
+ <OText style={{ paddingLeft: 5 }}>
203
+ {currentWalletSelected?.type === 'cash'
204
+ ? configs?.stripe_currency?.value
205
+ : t('POINTS', 'Points')}
172
206
  </OText>
173
- </LoyaltyWrapp>
174
- </LoyaltyContent>
175
- )}
176
- <BalanceElement>
177
- <OText size={20} style={{fontWeight: '600'}}>
178
- {currentWalletSelected?.type === 'cash'
179
- ? parsePrice(currentWalletSelected?.balance)
180
- : currentWalletSelected?.balance
181
- }
182
- </OText>
183
- <OText style={{ paddingLeft: 5 }}>
184
- {currentWalletSelected?.type === 'cash'
185
- ? configs?.stripe_currency?.value
186
- : t('POINTS', 'Points')}
187
- </OText>
188
- </BalanceElement>
207
+ </BalanceElement>
189
208
 
190
- <View style={{ marginTop: 20, width: '100%', paddingHorizontal: 1, paddingBottom: 40 }}>
191
- {!transactionsList?.loading &&
192
- !transactionsList?.error &&
193
- transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length > 0 &&
194
- (
195
- <>
196
- <OText style={{fontSize: 20}}>
197
- {t('TRANSACTIONS_HISTORY', 'Transactions history')}
198
- </OText>
199
- <TransactionsWrapper>
200
- {transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction: any, i: number) =>(
201
- <WalletTransactionItem
202
- idx={i}
203
- type={currentWalletSelected?.type}
204
- key={transaction.id}
205
- item={transaction}
206
- withFormatPrice={currentWalletSelected?.type === 'cash'}
207
- />
208
- ))}
209
- </TransactionsWrapper>
210
- </>
211
- )}
209
+ {!isChewLayout && (
210
+ <WalletTransactions
211
+ transactionsList={transactionsList}
212
+ currentWalletSelected={currentWalletSelected}
213
+ />
214
+ )}
215
+ </SectionContent>
216
+ </>
217
+ )}
212
218
 
213
- {(transactionsList?.loading || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) && (
214
- <View>
215
- {[...Array(4).keys()].map(i => (
216
- <View style={{ marginBottom: 10 }} key={i}>
217
- <Placeholder Animation={Fade}>
218
- <PlaceholderLine width={100} height={100} style={{ marginBottom: 0, borderRadius: 8 }} />
219
- </Placeholder>
220
- </View>
221
- ))}
219
+ {(walletList?.loading || userLoyaltyLevel.loading) && (
220
+ <>
221
+ <View>
222
+ <Placeholder Animation={Fade}>
223
+ <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
224
+ </Placeholder>
225
+ </View>
226
+ <View style={{ marginTop: 10, marginBottom: 20 }}>
227
+ <Placeholder Animation={Fade}>
228
+ <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
229
+ </Placeholder>
230
+ </View>
231
+ <View>
232
+ {[...Array(4).keys()].map(i => (
233
+ <View style={{ marginBottom: 10 }} key={i}>
234
+ <Placeholder Animation={Fade}>
235
+ <PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
236
+ </Placeholder>
222
237
  </View>
223
- )}
224
-
225
- {!transactionsList?.loading &&
226
- !(transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) &&
227
- (transactionsList?.error ||
228
- !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
229
- (
230
- <NotFoundSource
231
- content={transactionsList?.error
232
- ? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
233
- : t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
234
- }
235
- />
236
- )}
238
+ ))}
237
239
  </View>
238
- </SectionContent>
239
- </>
240
- )}
240
+ </>
241
+ )}
241
242
 
242
- {(walletList?.loading || userLoyaltyLevel.loading) && (
243
- <>
244
- <View>
245
- <Placeholder Animation={Fade}>
246
- <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
247
- </Placeholder>
248
- </View>
249
- <View style={{ marginTop: 10, marginBottom: 20 }}>
250
- <Placeholder Animation={Fade}>
251
- <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
252
- </Placeholder>
253
- </View>
254
- <View>
255
- {[...Array(4).keys()].map(i => (
256
- <View style={{ marginBottom: 10 }} key={i}>
257
- <Placeholder Animation={Fade}>
258
- <PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
259
- </Placeholder>
260
- </View>
261
- ))}
262
- </View>
263
- </>
264
- )}
243
+ {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
244
+ <NotFoundSource
245
+ content={walletList?.error
246
+ ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
247
+ : t('NOT_FOUND_WALLETS', 'No wallets to show at this time.')
248
+ }
249
+ />
250
+ )}
251
+ </Container>
265
252
 
266
- {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
267
- <NotFoundSource
268
- content={walletList?.error
269
- ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
270
- : t('NOT_FOUND_WALLETS', 'No wallets to show at this time.')
271
- }
272
- />
273
- )}
274
- </Container>
253
+ <OModal
254
+ open={openHistory}
255
+ onClose={() => setOpenHistory(false)}
256
+ entireModal
257
+ customClose
258
+ >
259
+ <ScrollView>
260
+ <WalletTransactionsWrapper>
261
+ <OButton
262
+ imgRightSrc={null}
263
+ style={{
264
+ borderWidth: 0,
265
+ backgroundColor: theme.colors.white,
266
+ padding: 0,
267
+ paddingHorizontal: 0,
268
+ width: 30,
269
+ paddingLeft: 0,
270
+ paddingRight: 0
271
+ }}
272
+ onClick={() => setOpenHistory(false)}
273
+ icon={AntDesignIcon}
274
+ iconProps={{
275
+ name: 'arrowleft',
276
+ size: 26
277
+ }}
278
+ />
279
+ <WalletTransactions
280
+ transactionsList={transactionsList}
281
+ currentWalletSelected={currentWalletSelected}
282
+ />
283
+ </WalletTransactionsWrapper>
284
+ </ScrollView>
285
+ </OModal>
286
+ </>
275
287
  )
276
288
  }
277
289
 
@@ -4,7 +4,11 @@ export const Container = styled.View`
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  `
7
-
7
+ export const Header = styled.View`
8
+ flex-direction: row;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ `
8
12
  export const SectionContent = styled.View`
9
13
  width: 100%;
10
14
  display: flex;
@@ -14,13 +18,6 @@ export const SectionContent = styled.View`
14
18
  margin-top: 20px;
15
19
  `
16
20
 
17
- export const TransactionsWrapper = styled.View`
18
- display: flex;
19
- flex-direction: column;
20
- border-left-width: 2px;
21
- border-left-color: ${(props: any) => props.theme.colors.disabled};
22
- `
23
-
24
21
  export const BalanceElement = styled.View`
25
22
  width: 100%;
26
23
  padding: 10px 0;
@@ -30,6 +27,7 @@ export const BalanceElement = styled.View`
30
27
  align-items: center;
31
28
  background-color: ${(props: any) => props.theme.colors.backgroundGray100};
32
29
  border-radius: 8px;
30
+ margin-bottom: 20px;
33
31
  `
34
32
 
35
33
  export const OTabs = styled.View`
@@ -62,3 +60,7 @@ export const LoyaltyImg = styled.ImageBackground`
62
60
  justify-content: center;
63
61
  align-items: center;
64
62
  `
63
+ export const WalletTransactionsWrapper = styled.View`
64
+ padding-horizontal: 40px;
65
+ padding-top: 20px;
66
+ `
@@ -0,0 +1,47 @@
1
+ import React, { useState } from 'react'
2
+ import { StyleSheet, ViewStyle } from 'react-native'
3
+ import styled from 'styled-components/native'
4
+
5
+ const CardContainerTouchable = styled.TouchableOpacity``
6
+
7
+ interface Props {
8
+ children: React.ReactChildren | Element,
9
+ style?: Array<ViewStyle> | any,
10
+ onClick: any
11
+ }
12
+
13
+ export const CardAnimation = (props: Props) => {
14
+ const {
15
+ children,
16
+ onClick,
17
+ style
18
+ } = props
19
+ const [isPressed, setIsPressed] = useState(false)
20
+ const styles = StyleSheet.create({
21
+ cardAnimation: {
22
+ elevation: isPressed ? 2 : 0,
23
+ shadowColor: '#888',
24
+ shadowOffset: { width: 0, height: 0 },
25
+ shadowRadius: 0,
26
+ shadowOpacity: isPressed ? 0.8 : 0,
27
+ borderRadius: 12,
28
+ }
29
+ })
30
+
31
+ const styleProvided = style || []
32
+ return (
33
+ <CardContainerTouchable
34
+ onPress={onClick}
35
+ activeOpacity={0.8}
36
+ delayPressIn={20}
37
+ onPressIn={() => setIsPressed(true)}
38
+ onPressOut={() => setIsPressed(false)}
39
+ style={[
40
+ ...styleProvided,
41
+ styles.cardAnimation
42
+ ]}
43
+ >
44
+ {children}
45
+ </CardContainerTouchable>
46
+ )
47
+ }
@@ -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