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
import React from 'react';
import {View, Text, StyleSheet, FlatList, TouchableOpacity} from 'react-native';
import R from '../../assets/R';
import HeaderBack from '../../components/Header/HeaderBack';
import Item from './Item';
import {WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/Entypo';
import {useNavigation} from '@react-navigation/native';
import {ADDMETHODPAY} from '../../routers/ScreenNames';
import AppText from '../../components/AppText';
const MethodPayView = (props) => {
const navigate = useNavigation();
const {isRefresh, listMethod, onRefresh} = props;
return (
<View style={{flex: 1}}>
<HeaderBack title={'PaymentSetting'} />
<View style={{flex: 1}}>
{listMethod.length == 0 ? (
<View
style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<AppText
i18nKey={'NoData'}
style={{
fontSize: 18,
fontWeight: 'bold',
}}></AppText>
</View>
) : (
<FlatList
keyExtractor={(item) => item.method}
showsVerticalScrollIndicator={false}
refreshing={isRefresh}
onRefresh={onRefresh}
onEndReachedThreshold={0.01}
data={listMethod}
renderItem={({item}) => <Item item={item} />}
/>
)}
<TouchableOpacity
onPress={() => navigate.navigate(ADDMETHODPAY)}
style={styles.containerBtn}>
<Icon name={'plus'} size={27} color={R.colors.white} />
</TouchableOpacity>
</View>
</View>
);
};
const styles = StyleSheet.create({
containerBtn: {
backgroundColor: R.colors.main,
position: 'absolute',
bottom: 30,
right: 20,
width: WIDTHXD(144),
height: WIDTHXD(144),
justifyContent: 'center',
alignItems: 'center',
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 3,
borderRadius: 30,
},
});
export default MethodPayView;