ordering-ui-react-native 0.16.82 → 0.16.84

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/components/BusinessProductsList/index.tsx +4 -4
  3. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +1 -0
  4. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  5. package/themes/business/src/types/index.tsx +1 -0
  6. package/themes/original/src/components/BusinessController/index.tsx +1 -23
  7. package/themes/original/src/components/BusinessItemAccordion/index.tsx +3 -3
  8. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  9. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  10. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  11. package/themes/original/src/components/BusinessListingSearch/index.tsx +11 -115
  12. package/themes/original/src/components/BusinessListingSearch/styles.tsx +4 -12
  13. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -0
  14. package/themes/original/src/components/CartContent/index.tsx +3 -3
  15. package/themes/original/src/components/Checkout/index.tsx +17 -10
  16. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
  17. package/themes/original/src/components/HelpGuide/index.tsx +8 -3
  18. package/themes/original/src/components/HelpOrder/index.tsx +8 -3
  19. package/themes/original/src/components/Messages/index.tsx +17 -17
  20. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  21. package/themes/original/src/components/NavBar/index.tsx +7 -1
  22. package/themes/original/src/components/OrderItAgain/index.tsx +5 -4
  23. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
  24. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +91 -104
  25. package/themes/original/src/components/OrdersOption/index.tsx +9 -10
  26. package/themes/original/src/components/PlaceSpot/index.tsx +4 -0
  27. package/themes/original/src/components/ProductForm/index.tsx +7 -7
  28. package/themes/original/src/components/SingleProductCard/index.tsx +9 -33
  29. package/themes/original/src/components/UpsellingProducts/index.tsx +7 -3
  30. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  31. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  32. package/themes/original/src/components/Wallets/index.tsx +172 -162
  33. package/themes/original/src/components/Wallets/styles.tsx +10 -8
  34. package/themes/original/src/components/shared/OButton.tsx +8 -3
  35. package/themes/original/src/types/index.tsx +6 -2
@@ -1,4 +1,4 @@
1
- import React, { useState, useRef, useEffect } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import {
3
3
  useLanguage,
4
4
  useConfig,
@@ -42,8 +42,6 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
42
42
  const theme = useTheme();
43
43
  const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
44
44
 
45
- const fadeAnim = useRef(new Animated.Value(enableIntersection ? 0 : 1)).current;
46
-
47
45
  const styles = StyleSheet.create({
48
46
  container: {
49
47
  borderWidth: 1,
@@ -123,14 +121,6 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
123
121
  maxCartProductConfig,
124
122
  maxCartProductInventory,
125
123
  );
126
-
127
- const fadeIn = () => {
128
- Animated.timing(fadeAnim, {
129
- toValue: 1,
130
- duration: 500,
131
- useNativeDriver: true
132
- }).start();
133
- };
134
124
 
135
125
  const handleChangeFavorite = () => {
136
126
  if (auth) {
@@ -143,14 +133,9 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
143
133
  const handleChangeIntersection = () => {
144
134
  if (enableIntersection) {
145
135
  setIsIntersectionObserver(true);
146
- fadeIn();
147
136
  }
148
137
  }
149
138
 
150
- useEffect(() => {
151
- if (enableIntersection) fadeIn()
152
- }, [enableIntersection])
153
-
154
139
  return (
155
140
  <InView style={{ minHeight: hideAddButton ? 125 : 165 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeIntersection()}>
156
141
  {isIntersectionObserver ? (
@@ -238,23 +223,14 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
238
223
  </RibbonBox>
239
224
  )}
240
225
  {product?.images && (
241
- <Animated.View
242
- style={[
243
- {
244
- // Bind opacity to animated value
245
- opacity: fadeAnim
246
- }
247
- ]}
248
- >
249
- <FastImage
250
- style={styles.productStyle}
251
- source={{
252
- uri: optimizeImage(product?.images, 'h_250,c_limit'),
253
- priority: FastImage.priority.normal,
254
- }}
255
- resizeMode={FastImage.resizeMode.cover}
256
- />
257
- </Animated.View>
226
+ <FastImage
227
+ style={styles.productStyle}
228
+ source={{
229
+ uri: optimizeImage(product?.images, 'h_250,c_limit'),
230
+ priority: FastImage.priority.normal,
231
+ }}
232
+ resizeMode={FastImage.resizeMode.cover}
233
+ />
258
234
  )}
259
235
  </LogoWrapper>
260
236
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Platform, StyleSheet, View } from 'react-native'
2
+ import { Platform, StyleSheet, TouchableOpacity, View } from 'react-native'
3
3
  import {
4
4
  UpsellingPage as UpsellingPageController,
5
5
  useUtils,
@@ -21,6 +21,7 @@ import {
21
21
  import { OrderSummary } from '../OrderSummary';
22
22
  import { ScrollView } from 'react-native-gesture-handler';
23
23
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
24
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
24
25
 
25
26
  const UpsellingProductsUI = (props: UpsellingProductsParams) => {
26
27
  const {
@@ -161,11 +162,14 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
161
162
  <>
162
163
  <View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 : 70 }}>
163
164
  <OButton
164
- imgLeftSrc={theme.images.general.arrow_left}
165
165
  imgRightSrc={null}
166
166
  style={styles.btnBackArrow}
167
167
  onClick={() => onGoBack()}
168
- imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
168
+ icon={AntDesignIcon}
169
+ iconProps={{
170
+ name: 'arrowleft',
171
+ size: 26
172
+ }}
169
173
  />
170
174
  </View>
171
175
  <ScrollView style={{ marginTop: 10, marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
@@ -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'
@@ -12,20 +12,21 @@ import {
12
12
 
13
13
  import {
14
14
  Container,
15
+ Header,
15
16
  BalanceElement,
16
- TransactionsWrapper,
17
17
  OTabs,
18
18
  OTab,
19
19
  SectionContent,
20
20
  LoyaltyContent,
21
21
  LoyaltyWrapp,
22
- LoyaltyImg
22
+ LoyaltyImg,
23
+ WalletTransactionsWrapper
23
24
  } from './styles'
24
25
 
25
26
  import NavBar from '../NavBar'
26
- import { OText } from '../shared';
27
+ import { OButton, OIcon, OText, OModal } from '../shared';
27
28
  import { NotFoundSource } from '../NotFoundSource';
28
- import { WalletTransactionItem } from '../WalletTransactionItem'
29
+ import { WalletTransactions } from '../WalletTransactions'
29
30
 
30
31
  const WalletsUI = (props: any) => {
31
32
  const {
@@ -46,6 +47,8 @@ const WalletsUI = (props: any) => {
46
47
  const [{ parsePrice }] = useUtils()
47
48
  const [{ configs }] = useConfig()
48
49
 
50
+ console.log(theme)
51
+
49
52
  const styles = StyleSheet.create({
50
53
  logoStyle: {
51
54
  width: 120,
@@ -60,6 +63,8 @@ const WalletsUI = (props: any) => {
60
63
  });
61
64
 
62
65
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
66
+ const [openHistory, setOpenHistory] = useState(false)
67
+ const isChewLayout = theme?.wallets_view?.components?.layout?.type === 'original'
63
68
 
64
69
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
65
70
 
@@ -105,173 +110,178 @@ const WalletsUI = (props: any) => {
105
110
  }, [refreshWallets])
106
111
 
107
112
  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
- />
117
-
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)}
132
- >
133
- <OTab isSelected={tabSelected === wallet.type}>
134
- <OText size={18}>
135
- {walletName[wallet.type]?.name}
136
- </OText>
137
- </OTab>
138
- </Pressable>
139
- ))}
140
- </OTabs>
113
+ <>
114
+ <Container>
115
+ <Header>
116
+ <NavBar
117
+ title={isChewLayout ? '' : t('WALLETS', 'Wallets')}
118
+ titleAlign={'center'}
119
+ onActionLeft={goToBack}
120
+ showCall={false}
121
+ paddingTop={10}
122
+ btnStyle={{ paddingLeft: 0 }}
123
+ style={{ flex: 1 }}
124
+ />
125
+ {isChewLayout && (
126
+ <OButton
127
+ text={t('WALLET_HISTORY', 'Wallet history')}
128
+ bgColor={theme.colors.white}
129
+ borderColor={theme.colors.lightGray}
130
+ imgRightSrc={null}
131
+ textStyle={{ fontSize: 12, color: theme.colors.disabled }}
132
+ onClick={() => setOpenHistory(true)}
133
+ style={{ borderRadius: 8, height: 40 }}
134
+ />
135
+ )}
136
+ </Header>
141
137
 
142
- <SectionContent>
143
- {!!loyaltyLevel && tabSelected === 'credit_point' && (
144
- <LoyaltyContent>
145
- <LoyaltyWrapp>
146
- <OText size={20}>
147
- {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
148
- </OText>
149
- {loyaltyLevel.image ? (
150
- <FastImage
151
- style={styles.logoStyle}
152
- source={{
153
- uri: loyaltyLevel.image,
154
- priority: FastImage.priority.high,
155
- cache:FastImage.cacheControl.web
156
- }}
157
- resizeMode={FastImage.resizeMode.contain}
158
- />
159
- ) : (
160
- <LoyaltyImg
161
- source={theme.images.dummies.loyaltyLevel}
162
- resizeMode='contain'
163
- />
164
- )}
165
- <OText
166
- size={22}
167
- weight='bold'
168
- style={{ textTransform: 'uppercase' }}
169
- color={theme.colors.primary}
170
- >
171
- {loyaltyLevel.name}
172
- </OText>
173
- </LoyaltyWrapp>
174
- </LoyaltyContent>
175
- )}
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>
138
+ {!walletList.loading &&
139
+ !userLoyaltyLevel.loading &&
140
+ !walletList.error &&
141
+ walletList.wallets?.length > 0 &&
142
+ (
143
+ <>
144
+ <OTabs
145
+ horizontal
146
+ showsHorizontalScrollIndicator={false}
147
+ >
148
+ {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
149
+ <Pressable
150
+ key={wallet.id}
151
+ onPress={() => handleChangeTab(wallet)}
152
+ >
153
+ <OTab isSelected={tabSelected === wallet.type}>
154
+ <OText size={18}>
155
+ {walletName[wallet.type]?.name}
156
+ </OText>
157
+ </OTab>
158
+ </Pressable>
159
+ ))}
160
+ </OTabs>
189
161
 
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'}
162
+ <SectionContent>
163
+ {!!loyaltyLevel && tabSelected === 'credit_point' && (
164
+ <LoyaltyContent>
165
+ <LoyaltyWrapp>
166
+ <OText size={20}>
167
+ {`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
168
+ </OText>
169
+ {loyaltyLevel.image ? (
170
+ <FastImage
171
+ style={styles.logoStyle}
172
+ source={{
173
+ uri: loyaltyLevel.image,
174
+ priority: FastImage.priority.high,
175
+ cache:FastImage.cacheControl.web
176
+ }}
177
+ resizeMode={FastImage.resizeMode.contain}
207
178
  />
208
- ))}
209
- </TransactionsWrapper>
210
- </>
211
- )}
212
-
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
- ))}
222
- </View>
179
+ ) : (
180
+ <LoyaltyImg
181
+ source={theme.images.dummies.loyaltyLevel}
182
+ resizeMode='contain'
183
+ />
184
+ )}
185
+ <OText
186
+ size={22}
187
+ weight='bold'
188
+ style={{ textTransform: 'uppercase' }}
189
+ color={theme.colors.primary}
190
+ >
191
+ {loyaltyLevel.name}
192
+ </OText>
193
+ </LoyaltyWrapp>
194
+ </LoyaltyContent>
223
195
  )}
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.')
196
+ <BalanceElement>
197
+ <OText size={20} style={{fontWeight: '600'}}>
198
+ {currentWalletSelected?.type === 'cash'
199
+ ? parsePrice(currentWalletSelected?.balance)
200
+ : currentWalletSelected?.balance
234
201
  }
202
+ </OText>
203
+ <OText style={{ paddingLeft: 5 }}>
204
+ {currentWalletSelected?.type === 'cash'
205
+ ? configs?.stripe_currency?.value
206
+ : t('POINTS', 'Points')}
207
+ </OText>
208
+ </BalanceElement>
209
+
210
+ {!isChewLayout && (
211
+ <WalletTransactions
212
+ transactionsList={transactionsList}
213
+ currentWalletSelected={currentWalletSelected}
235
214
  />
236
215
  )}
216
+ </SectionContent>
217
+ </>
218
+ )}
219
+
220
+ {(walletList?.loading || userLoyaltyLevel.loading) && (
221
+ <>
222
+ <View>
223
+ <Placeholder Animation={Fade}>
224
+ <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
225
+ </Placeholder>
226
+ </View>
227
+ <View style={{ marginTop: 10, marginBottom: 20 }}>
228
+ <Placeholder Animation={Fade}>
229
+ <PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
230
+ </Placeholder>
231
+ </View>
232
+ <View>
233
+ {[...Array(4).keys()].map(i => (
234
+ <View style={{ marginBottom: 10 }} key={i}>
235
+ <Placeholder Animation={Fade}>
236
+ <PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
237
+ </Placeholder>
238
+ </View>
239
+ ))}
237
240
  </View>
238
- </SectionContent>
239
- </>
240
- )}
241
+ </>
242
+ )}
241
243
 
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
- )}
244
+ {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
245
+ <NotFoundSource
246
+ content={walletList?.error
247
+ ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
248
+ : t('NOT_FOUND_WALLETS', 'No wallets to show at this time.')
249
+ }
250
+ />
251
+ )}
252
+ </Container>
265
253
 
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>
254
+ <OModal
255
+ open={openHistory}
256
+ onClose={() => setOpenHistory(false)}
257
+ entireModal
258
+ customClose
259
+ >
260
+ <ScrollView>
261
+ <WalletTransactionsWrapper>
262
+ <OButton
263
+ imgLeftSrc={theme.images.general.arrow_left}
264
+ imgLeftStyle={{ width: 18 }}
265
+ imgRightSrc={null}
266
+ style={{
267
+ borderWidth: 0,
268
+ backgroundColor: theme.colors.white,
269
+ padding: 0,
270
+ paddingHorizontal: 0,
271
+ width: 30,
272
+ paddingLeft: 0,
273
+ paddingRight: 0
274
+ }}
275
+ onClick={() => setOpenHistory(false)}
276
+ />
277
+ <WalletTransactions
278
+ transactionsList={transactionsList}
279
+ currentWalletSelected={currentWalletSelected}
280
+ />
281
+ </WalletTransactionsWrapper>
282
+ </ScrollView>
283
+ </OModal>
284
+ </>
275
285
  )
276
286
  }
277
287
 
@@ -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
+ `
@@ -79,6 +79,8 @@ interface Props {
79
79
  loadingStyle?: ViewStyle;
80
80
  showNextIcon?: boolean;
81
81
  isDisabledWithSameStyles?: boolean;
82
+ icon?: any;
83
+ iconProps?: any
82
84
  }
83
85
 
84
86
  const OButton = (props: Props): React.ReactElement => {
@@ -114,6 +116,9 @@ const OButton = (props: Props): React.ReactElement => {
114
116
  disabled={props.isDisabledWithSameStyles}
115
117
  >
116
118
  <StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
119
+ {props.icon ? (
120
+ <props.icon {...props.iconProps} />
121
+ ) : null}
117
122
  {props.imgLeftSrc ? (
118
123
  <OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
119
124
  ) : null}
@@ -122,9 +127,9 @@ const OButton = (props: Props): React.ReactElement => {
122
127
  ) : null}
123
128
  {props.imgRightSrc ? (
124
129
  <EndImage style={props.imgRightStyle} source={props.imgRightSrc} />
125
- ) : props.showNextIcon ?
126
- <EndImage source={theme.images.general.arrow_left}
127
- style={{width: 16, tintColor: 'white', transform: [{rotate: I18nManager.isRTL ? '0deg' : '180deg'}]}} /> : null }
130
+ ) : props.showNextIcon ?
131
+ <EndImage source={theme.images.general.arrow_left}
132
+ style={{ width: 16, tintColor: 'white', transform: [{ rotate: I18nManager.isRTL ? '0deg' : '180deg' }] }} /> : null}
128
133
  </StyledButton>
129
134
  </TouchableOpacity>
130
135
  );