MethodPayView.js 1.74 KB
Newer Older
Giang Tran committed
1
import React from 'react';
Giang Tran committed
2
import {View, Text, StyleSheet, FlatList, TouchableOpacity} from 'react-native';
Giang Tran committed
3 4 5
import R from '../../assets/R';
import HeaderBack from '../../components/Header/HeaderBack';
import Item from './Item';
Giang Tran committed
6 7 8 9
import {WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/Entypo';
import {useNavigation} from '@react-navigation/native';
import {ADDMETHODPAY} from '../../routers/ScreenNames';
Giang Tran committed
10 11

const MethodPayView = (props) => {
Giang Tran committed
12
  const navigate = useNavigation();
Giang Tran committed
13

Giang Tran committed
14 15
  const {isRefresh, listMethod, onRefresh} = props;

Giang Tran committed
16
  return (
Giang Tran committed
17
    <View style={{flex: 1}}>
Giang Tran committed
18
      <HeaderBack title={'PaymentSetting'} />
Giang Tran committed
19
      <View style={{flex: 1}}>
Giang Tran committed
20 21 22 23 24 25 26 27 28 29 30
        {listMethod.length > 0 ? (
          <FlatList
            keyExtractor={(item) => item.method}
            showsVerticalScrollIndicator={false}
            refreshing={isRefresh}
            onRefresh={onRefresh}
            onEndReachedThreshold={0.01}
            data={listMethod}
            renderItem={({item}) => <Item item={item} />}
          />
        ) : null}
Giang Tran committed
31 32 33 34 35 36

        <TouchableOpacity
          onPress={() => navigate.navigate(ADDMETHODPAY)}
          style={styles.containerBtn}>
          <Icon name={'plus'} size={27} color={R.colors.white} />
        </TouchableOpacity>
Giang Tran committed
37
      </View>
Giang Tran committed
38 39 40 41
    </View>
  );
};

Giang Tran committed
42 43 44 45
const styles = StyleSheet.create({
  containerBtn: {
    backgroundColor: R.colors.main,
    position: 'absolute',
Giang Tran committed
46
    bottom: 30,
Giang Tran committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
    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,
  },
});
Giang Tran committed
63

Giang Tran committed
64
export default MethodPayView;