Commit c8fb8023 by Giang Tran

edit drawer

parent a7c661dd
......@@ -21,6 +21,7 @@ import PickerItem from '../../../components/Picker/PickerItem';
import {verifyAccountApi} from '../../../apis/Functions/users';
import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {useNavigation} from '@react-navigation/native';
const {width} = Dimensions.get('window');
const dataType = [
......@@ -39,6 +40,8 @@ const BankInfor = (props) => {
const [bank_no, setBackNo] = useState('');
const [account_no, setAccountNo] = useState('');
console.log(props.user.uid);
const createFormData = (identity_after, identity_before, sign_img, body) => {
const data = new FormData();
......@@ -76,7 +79,7 @@ const BankInfor = (props) => {
const onPress = async () => {
const titles = ['loại thẻ', 'mã ngân hàng', 'số thẻ/tài khoản'];
const index = checkFormatArray([acc_type, bank_no, account_no]);
console.log(props.route.params.body);
if (index === true) {
const data = createFormData(
props.route.params.img.urlBack,
......@@ -90,9 +93,22 @@ const BankInfor = (props) => {
...props.route.params.body,
},
);
props.showLoading();
const res = await verifyAccountApi(data);
props.hideLoading();
console.log('Response', res.data);
if (res.data.code == 200) {
setTimeout(() => {
Alert.alert('Thông báo!', res.data.message);
}, 500);
setBackNo('');
setAccountNo('');
setAccType('');
} else {
setTimeout(() => {
Alert.alert('Thông báo!', res.data.message);
}, 500);
}
} else {
Alert.alert('Vui lòng điền ' + titles[index]);
}
......
......@@ -57,15 +57,15 @@ const GeneralInfor = (props) => {
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1}}>
<TextField
title={'Tên'}
onChangeText={(val) => setLastName(val)}
title={'Họ và tên đệm'}
onChangeText={(val) => setFirstName(val)}
/>
</View>
<View style={{width: 20}} />
<View style={{flex: 1}}>
<TextField
title={'Họ'}
onChangeText={(val) => setFirstName(val)}
title={'Tên'}
onChangeText={(val) => setLastName(val)}
/>
</View>
</View>
......
......@@ -9,11 +9,11 @@ export const HIDELOADING = 'HIDELOADING';
export const PUSHNOTI = 'PUSHNOTI';
export const HIDENOTI = 'HIDENOTI';
export const UPDATE_NOTIFICATION = 'UPDATE_NOTIFICATION';
export const UPDATE_NOTIFICATION_SUCCESSED="UPDATE_NOTIFICATION_SUCCESSED"
export const UPDATE_NOTIFICATION_FAIL="UPDATE_NOTIeFICATION_FAIL"
export const UPDATE_NOTIFICATION_SUCCESSED = 'UPDATE_NOTIFICATION_SUCCESSED';
export const UPDATE_NOTIFICATION_FAIL = 'UPDATE_NOTIeFICATION_FAIL';
export const UPDATE_REPORT_SUCCESSED="UPDATE_REPORT_SUCCESSED"
export const UPDATE_REPORT_SUCCESSED = 'UPDATE_REPORT_SUCCESSED';
export const UPDATE_REPORT ="UPDATE_REPORT"
export const UPDATE_REPORT = 'UPDATE_REPORT';
export const SAVENAVIGATE = 'SAVENAVIGATE';
......@@ -45,6 +45,7 @@ const images = {
iconEmail: require('./images/iconEmail1.png'),
iconUser3: require('./images/iconUser3.png'),
iconRight1: require('./images/iconRight1.png'),
iconRight2: require('./images/iconRight2.png'),
iconNganLuong: require('./images/iconNganLuong.png'),
iconVisa: require('./images/iconVisa.png'),
......
......@@ -12,6 +12,7 @@ import {
SETTING,
NOTIFICATION,
AUTHEN,
PROFILE,
} from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native';
......@@ -55,7 +56,21 @@ const Drawer = (props) => {
<View style={styles.container}>
<View style={styles.header}>
<Image source={R.images.avartar} style={styles.imgAvatar} />
<Text style={styles.txtTitle}>NGUYEN VAN A</Text>
<TouchableOpacity
onPress={() => {
props.toggleModal();
navigate.navigate(PROFILE);
}}>
<Text style={styles.txtTop}>NGUYEN VAN A</Text>
<Text>SponsorIDLink</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.toggleModal();
navigate.navigate(PROFILE);
}}>
<Image source={R.images.iconRight2} style={styles.imgIcon} />
</TouchableOpacity>
</View>
<View style={styles.body}>
......@@ -103,6 +118,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 10,
justifyContent: 'space-around',
},
body: {
flex: 1,
......@@ -124,6 +140,15 @@ const styles = StyleSheet.create({
marginLeft: 10,
color: '#0C0D2C',
},
txtTop: {
fontSize: getFontXD(42),
color: '#1E2F70',
},
txtLink: {
fontSize: getFontXD(36),
color: '#929292',
},
footer: {
paddingVertical: 10,
backgroundColor: '#EEEEEE',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment