1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import React, {useState} from 'react';
import {View, Text, StyleSheet, FlatList, TouchableOpacity} from 'react-native';
import HeaderSearch from '../../components/Header/HeaderSearch';
import {getFontXD} from '../../Config/Functions';
import Item from './Item';
const Fillters = [
{
id: '1',
name: 'Tất cả',
value: 'all',
},
{
id: '2',
name: 'Nạp tiền',
value: 'deposit',
},
{
id: '3',
name: 'Rút tiền',
value: 'withdraw',
},
{
id: '4',
name: 'Chuyển khoản',
value: 'exchange',
},
];
const data = [
{
id: '1',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 10000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '2',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 2000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '3',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 3000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '4',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 4000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '5',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 9000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
];
const ExchangeView = (props) => {
const [selected, setSelected] = useState('1');
return (
<View style={{flex: 1}}>
<HeaderSearch isWhite={true} title={'Giao dịch'} />
<View style={styles.headerContainer}>
<FlatList
showsHorizontalScrollIndicator={false}
horizontal
data={Fillters}
keyExtractor={(item) => item.id}
renderItem={({item}) => (
<TouchableOpacity
onPress={() => setSelected(item.id)}
style={[
styles.itemFillter,
selected == item.id ? {borderColor: '#1473E6'} : null,
]}>
<Text
style={[
styles.txtFillter,
selected == item.id ? {color: '#1473E6'} : {},
]}>
{item.name}
</Text>
</TouchableOpacity>
)}
/>
</View>
<View style={{flex: 1}}>
<FlatList
keyExtractor={(item) => item.id}
data={data}
renderItem={({item}) => <Item item={item} />}
/>
</View>
</View>
);
};
const styles = StyleSheet.create({
headerContainer: {
paddingVertical: 10,
backgroundColor: 'white',
},
itemFillter: {
borderRadius: 10,
paddingVertical: 5,
paddingHorizontal: 10,
borderWidth: 1,
borderColor: '#929292',
marginLeft: 15,
minWidth: 70,
},
txtFillter: {
fontSize: getFontXD(36),
color: '#929292',
},
});
export default ExchangeView;