Commit c8fb8023 by Giang Tran

edit drawer

parent a7c661dd
...@@ -21,6 +21,7 @@ import PickerItem from '../../../components/Picker/PickerItem'; ...@@ -21,6 +21,7 @@ import PickerItem from '../../../components/Picker/PickerItem';
import {verifyAccountApi} from '../../../apis/Functions/users'; import {verifyAccountApi} from '../../../apis/Functions/users';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction'; import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {useNavigation} from '@react-navigation/native';
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
const dataType = [ const dataType = [
...@@ -39,6 +40,8 @@ const BankInfor = (props) => { ...@@ -39,6 +40,8 @@ const BankInfor = (props) => {
const [bank_no, setBackNo] = useState(''); const [bank_no, setBackNo] = useState('');
const [account_no, setAccountNo] = useState(''); const [account_no, setAccountNo] = useState('');
console.log(props.user.uid);
const createFormData = (identity_after, identity_before, sign_img, body) => { const createFormData = (identity_after, identity_before, sign_img, body) => {
const data = new FormData(); const data = new FormData();
...@@ -76,7 +79,7 @@ const BankInfor = (props) => { ...@@ -76,7 +79,7 @@ const BankInfor = (props) => {
const onPress = async () => { const onPress = async () => {
const titles = ['loại thẻ', 'mã ngân hàng', 'số thẻ/tài khoản']; 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]); const index = checkFormatArray([acc_type, bank_no, account_no]);
console.log(props.route.params.body);
if (index === true) { if (index === true) {
const data = createFormData( const data = createFormData(
props.route.params.img.urlBack, props.route.params.img.urlBack,
...@@ -90,9 +93,22 @@ const BankInfor = (props) => { ...@@ -90,9 +93,22 @@ const BankInfor = (props) => {
...props.route.params.body, ...props.route.params.body,
}, },
); );
props.showLoading();
const res = await verifyAccountApi(data); 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 { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert('Vui lòng điền ' + titles[index]);
} }
......
...@@ -57,15 +57,15 @@ const GeneralInfor = (props) => { ...@@ -57,15 +57,15 @@ const GeneralInfor = (props) => {
<View style={{flexDirection: 'row'}}> <View style={{flexDirection: 'row'}}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextField <TextField
title={'Tên'} title={'Họ và tên đệm'}
onChangeText={(val) => setLastName(val)} onChangeText={(val) => setFirstName(val)}
/> />
</View> </View>
<View style={{width: 20}} /> <View style={{width: 20}} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextField <TextField
title={'Họ'} title={'Tên'}
onChangeText={(val) => setFirstName(val)} onChangeText={(val) => setLastName(val)}
/> />
</View> </View>
</View> </View>
......
...@@ -9,11 +9,11 @@ export const HIDELOADING = 'HIDELOADING'; ...@@ -9,11 +9,11 @@ export const HIDELOADING = 'HIDELOADING';
export const PUSHNOTI = 'PUSHNOTI'; export const PUSHNOTI = 'PUSHNOTI';
export const HIDENOTI = 'HIDENOTI'; export const HIDENOTI = 'HIDENOTI';
export const UPDATE_NOTIFICATION = 'UPDATE_NOTIFICATION'; export const UPDATE_NOTIFICATION = 'UPDATE_NOTIFICATION';
export const UPDATE_NOTIFICATION_SUCCESSED="UPDATE_NOTIFICATION_SUCCESSED" export const UPDATE_NOTIFICATION_SUCCESSED = 'UPDATE_NOTIFICATION_SUCCESSED';
export const UPDATE_NOTIFICATION_FAIL="UPDATE_NOTIeFICATION_FAIL" 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 = { ...@@ -45,6 +45,7 @@ const images = {
iconEmail: require('./images/iconEmail1.png'), iconEmail: require('./images/iconEmail1.png'),
iconUser3: require('./images/iconUser3.png'), iconUser3: require('./images/iconUser3.png'),
iconRight1: require('./images/iconRight1.png'), iconRight1: require('./images/iconRight1.png'),
iconRight2: require('./images/iconRight2.png'),
iconNganLuong: require('./images/iconNganLuong.png'), iconNganLuong: require('./images/iconNganLuong.png'),
iconVisa: require('./images/iconVisa.png'), iconVisa: require('./images/iconVisa.png'),
......
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
SETTING, SETTING,
NOTIFICATION, NOTIFICATION,
AUTHEN, AUTHEN,
PROFILE,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
...@@ -55,7 +56,21 @@ const Drawer = (props) => { ...@@ -55,7 +56,21 @@ const Drawer = (props) => {
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <View style={styles.header}>
<Image source={R.images.avartar} style={styles.imgAvatar} /> <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>
<View style={styles.body}> <View style={styles.body}>
...@@ -103,6 +118,7 @@ const styles = StyleSheet.create({ ...@@ -103,6 +118,7 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
paddingHorizontal: 10, paddingHorizontal: 10,
justifyContent: 'space-around',
}, },
body: { body: {
flex: 1, flex: 1,
...@@ -124,6 +140,15 @@ const styles = StyleSheet.create({ ...@@ -124,6 +140,15 @@ const styles = StyleSheet.create({
marginLeft: 10, marginLeft: 10,
color: '#0C0D2C', color: '#0C0D2C',
}, },
txtTop: {
fontSize: getFontXD(42),
color: '#1E2F70',
},
txtLink: {
fontSize: getFontXD(36),
color: '#929292',
},
footer: { footer: {
paddingVertical: 10, paddingVertical: 10,
backgroundColor: '#EEEEEE', 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