Commit 1c89bb15 by Giang Tran

edit ui

parent a97072be
import React from 'react'; import React, {useState} from 'react';
import AccountVerificationView from './AccountVerificationView'; import AccountVerificationView from './AccountVerificationView';
......
import React from 'react'; import React, {useState} from 'react';
import { import {
View, View,
Text, Text,
......
...@@ -2,12 +2,14 @@ import React from 'react'; ...@@ -2,12 +2,14 @@ import React from 'react';
import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native'; import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native';
import TextField from '../../../components/Input/TextField'; import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import PickerImgUni from '../../../components/Picker/PickerImgUni';
import PickerDate from '../../../components/Picker/PickerDate'; import PickerDate from '../../../components/Picker/PickerDate';
import R from '../../../assets/R'; import R from '../../../assets/R';
import Button from '../../../components/Button'; import Button from '../../../components/Button';
const BankInfor = (props) => { const BankInfor = (props) => {
console.log(props.route.params);
return ( return (
<View <View
style={{ style={{
...@@ -18,16 +20,7 @@ const BankInfor = (props) => { ...@@ -18,16 +20,7 @@ const BankInfor = (props) => {
<TextField title={'Loại thẻ'} onChangeText={(val) => console.log(val)} /> <TextField title={'Loại thẻ'} onChangeText={(val) => console.log(val)} />
<TextField title={'Số thẻ'} onChangeText={(val) => console.log(val)} /> <TextField title={'Số thẻ'} onChangeText={(val) => console.log(val)} />
<PickerDate title={'Ngày cấp'} /> <PickerDate title={'Ngày cấp'} />
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
flexWrap: 'wrap',
}}>
<PickerImgUni title={'Ảnh mặt trước CMND'} />
<PickerImgUni title={'Ảnh mặt sau CMND'} />
<PickerImgUni title={'Ảnh chữ ký'} />
</View>
<View style={styles.btnSend}> <View style={styles.btnSend}>
<Button title={'Xác minh'} /> <Button title={'Xác minh'} />
</View> </View>
......
import React, {useState} from 'react'; import React, {useState} from 'react';
import {View, Text, Image, TouchableOpacity, StyleSheet} from 'react-native'; import {
View,
Text,
Image,
TouchableOpacity,
StyleSheet,
Alert,
} from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import TextField from '../../../components/Input/TextField'; import TextField from '../../../components/Input/TextField';
...@@ -7,28 +14,55 @@ import TextMulti from '../../../components/Input/TextMulti'; ...@@ -7,28 +14,55 @@ import TextMulti from '../../../components/Input/TextMulti';
import PickerDate from '../../../components/Picker/PickerDate'; import PickerDate from '../../../components/Picker/PickerDate';
import PickerImg from '../../../components/Picker/PickerImg'; import PickerImg from '../../../components/Picker/PickerImg';
import {checkFormatArray} from '../../../Config/Functions';
const GeneralInfor = (props) => { const GeneralInfor = (props) => {
const [email, setEmail] = useState('');
const [sponsorID, setSponsorID] = useState('');
const [lastName, setLastName] = useState('');
const [firstName, setFirstName] = useState('');
const [phone, setPhone] = useState('');
const [adress, setAdress] = useState('');
const [birth, setBirth] = useState(new Date()); const [birth, setBirth] = useState(new Date());
const onNextPress = () => {
const titles = ['email', 'tên', 'họ', 'số điện thoại', 'địa chỉ'];
const index = checkFormatArray([email, lastName, firstName, phone, adress]);
console.log(props);
if (index === true) {
props.navigation.navigate('Profile', {
email,
lastName,
firstName,
phone,
adress,
sponsorID,
birth,
});
} else {
Alert.alert('Vui lòng điền ' + titles[index]);
}
};
return ( return (
<View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}> <View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}>
<TextField title={'User name'} onChangeText={(val) => console.log(val)} /> <TextField title={'Email'} onChangeText={(val) => setEmail(val)} />
<TextField <TextField
title={'Sponsor ID'} title={'Sponsor ID'}
onChangeText={(val) => console.log(val)} onChangeText={(val) => setSponsorID(val)}
/> />
<View style={{flexDirection: 'row'}}> <View style={{flexDirection: 'row'}}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextField title={'Tên'} onChangeText={(val) => console.log(val)} /> <TextField title={'Tên'} onChangeText={(val) => setLastName(val)} />
</View> </View>
<View style={{width: 20}} /> <View style={{width: 20}} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextField title={'Họ'} onChangeText={(val) => console.log(val)} /> <TextField title={'Họ'} onChangeText={(val) => setFirstName(val)} />
</View> </View>
</View> </View>
<TextField <TextField
title={'Số điện thoại'} title={'Số điện thoại'}
onChangeText={(val) => console.log(val)} onChangeText={(val) => setPhone(val)}
/> />
<PickerDate <PickerDate
value={birth} value={birth}
...@@ -36,12 +70,8 @@ const GeneralInfor = (props) => { ...@@ -36,12 +70,8 @@ const GeneralInfor = (props) => {
title={'Ngày sinh'} title={'Ngày sinh'}
/> />
<TextMulti title={'Địa chỉ'} onChangeText={(val) => console.log(val)} /> <TextMulti title={'Địa chỉ'} onChangeText={(val) => setAdress(val)} />
<TouchableOpacity <TouchableOpacity onPress={onNextPress} style={styles.btnNext}>
onPress={() => {
props.navigation.navigate('Profile');
}}
style={styles.btnNext}>
<Image style={{width: 30, height: 30}} source={R.images.iconRight1} /> <Image style={{width: 30, height: 30}} source={R.images.iconRight1} />
</TouchableOpacity> </TouchableOpacity>
<View style={{height: 100}} /> <View style={{height: 100}} />
......
import React from 'react'; import React, {useState} from 'react';
import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native'; import {
import PickerImg from '../../../components/Picker/PickerImg'; View,
Text,
TouchableOpacity,
Image,
StyleSheet,
Alert,
} from 'react-native';
import PickerImgUni from '../../../components/Picker/PickerImgUni';
import R from '../../../assets/R'; import R from '../../../assets/R';
import {checkFormatArray} from '../../../Config/Functions';
const Profile = (props) => { const Profile = (props) => {
const [urlFont, setUrlFont] = useState('');
const [urlBack, setUrlBack] = useState('');
const [urlSign, setUrlSign] = useState('');
const onNextPress = () => {
const titles = ['CNND mặt trước', 'CMND mặt sau', 'chữ ký'];
const index = checkFormatArray([urlFont, urlBack, urlSign]);
if (index === true) {
props.navigation.navigate('BankInfor', {
urlFont,
urlBack,
urlSign,
...props.route.params,
});
} else {
Alert.alert('Vui lòng thêm ảnh ' + titles[index]);
}
};
return ( return (
<View> <View
<Text>Profile screen</Text> style={{
<TouchableOpacity flex: 1,
onPress={() => { paddingHorizontal: 10,
props.navigation.navigate('BankInfor'); paddingTop: 10,
}} }}>
style={styles.btnNext}> <View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
flexWrap: 'wrap',
}}>
<PickerImgUni
onSelectImg={(path) => setUrlFont(path)}
title={'Ảnh mặt trước CMND'}
/>
<PickerImgUni
onSelectImg={(path) => setUrlBack(path)}
title={'Ảnh mặt sau CMND'}
/>
<PickerImgUni
onSelectImg={(path) => setUrlSign(path)}
title={'Ảnh chữ ký'}
/>
</View>
<TouchableOpacity onPress={onNextPress} style={styles.btnNext}>
<Image style={{width: 30, height: 30}} source={R.images.iconRight1} /> <Image style={{width: 30, height: 30}} source={R.images.iconRight1} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
......
...@@ -55,6 +55,7 @@ const images = { ...@@ -55,6 +55,7 @@ const images = {
tradding: require('./images/tradding.png'), tradding: require('./images/tradding.png'),
noti: require('./images/noti1.png'), noti: require('./images/noti1.png'),
iconCopy: require('./images/iconCopy.png'),
}; };
export default images; export default images;
...@@ -34,15 +34,25 @@ const HeaderHome = (props) => { ...@@ -34,15 +34,25 @@ const HeaderHome = (props) => {
</ImageBackground> </ImageBackground>
<View style={{justifyContent: 'center', alignItems: 'center'}}> <View style={{justifyContent: 'center', alignItems: 'center'}}>
<View style={styles.containerTop}> <View style={styles.containerTop}>
<View <View style={styles.containerInfor}>
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}}>
<Image source={R.images.avartar} style={styles.imgAvatar} /> <Image source={R.images.avartar} style={styles.imgAvatar} />
<Text style={styles.txtMoney}> {toPriceVnd(1000000)}</Text> <View style={styles.wrapRight}>
<Text style={styles.txtTitle}> VNĐ</Text> <Text style={styles.txtName}>Vu Khac Minh</Text>
<View style={styles.row1}>
<Text style={styles.txtlink}>sponsorIDlink</Text>
<TouchableOpacity onPress={() => console.log('Hello')}>
<Image
source={R.images.iconCopy}
style={styles.imgIconCopy}
/>
</TouchableOpacity>
</View>
<View style={styles.row}>
<Text style={styles.txtMoney}> {toPriceVnd(1000000)}</Text>
<Text style={styles.txtTitle}> VNĐ</Text>
</View>
</View>
</View> </View>
<View style={styles.containerMenu}> <View style={styles.containerMenu}>
<TouchableOpacity <TouchableOpacity
...@@ -96,10 +106,9 @@ const styles = StyleSheet.create({ ...@@ -96,10 +106,9 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
}, },
containerTop: { containerTop: {
padding: 15,
height: HEIGHTXD(856), height: HEIGHTXD(856),
width: '90%', width: '90%',
backgroundColor: R.colors.white, backgroundColor: 'white',
borderRadius: 10, borderRadius: 10,
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { shadowOffset: {
...@@ -115,7 +124,7 @@ const styles = StyleSheet.create({ ...@@ -115,7 +124,7 @@ const styles = StyleSheet.create({
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
flexDirection: 'row', flexDirection: 'row',
marginTop: 10, padding: 10,
}, },
wraper: { wraper: {
justifyContent: 'center', justifyContent: 'center',
...@@ -127,17 +136,31 @@ const styles = StyleSheet.create({ ...@@ -127,17 +136,31 @@ const styles = StyleSheet.create({
marginBottom: 10, marginBottom: 10,
resizeMode: 'contain', resizeMode: 'contain',
}, },
imgIconCopy: {
width: WIDTHXD(134),
height: HEIGHTXD(134),
resizeMode: 'contain',
},
txt: { txt: {
fontSize: getFontXD(36), fontSize: getFontXD(36),
color: R.colors.txtMain, color: R.colors.txtMain,
}, },
txtName: {
fontSize: getFontXD(52),
color: '#00359C',
},
txtlink: {
fontSize: getFontXD(42),
color: '#A2A2A2',
},
imgAvatar: { imgAvatar: {
width: WIDTHXD(200), width: WIDTHXD(240),
height: WIDTHXD(200), height: WIDTHXD(240),
borderRadius: WIDTHXD(110), borderRadius: WIDTHXD(120),
}, },
txtMoney: { txtMoney: {
fontSize: getFontXD(52), fontSize: getFontXD(72),
color: '#FFB721', color: '#FFB721',
marginVertical: 5, marginVertical: 5,
fontWeight: 'bold', fontWeight: 'bold',
...@@ -146,5 +169,30 @@ const styles = StyleSheet.create({ ...@@ -146,5 +169,30 @@ const styles = StyleSheet.create({
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: '#A2A2A2', color: '#A2A2A2',
fontWeight: 'bold', fontWeight: 'bold',
marginTop: 5,
marginLeft: 5,
},
wrapRight: {
flex: 1,
paddingHorizontal: 20,
},
containerInfor: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
borderBottomWidth: 1,
borderBottomColor: '#EDEDF1',
flexDirection: 'row',
paddingHorizontal: 20,
},
row: {
flexDirection: 'row',
alignItems: 'center',
marginTop: 5,
},
row1: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
}, },
}); });
...@@ -23,7 +23,7 @@ const options = { ...@@ -23,7 +23,7 @@ const options = {
}; };
const PickerImgUni = (props) => { const PickerImgUni = (props) => {
const {title, height, width} = props; const {title, height, width, onSelectImg} = props;
const [isModalVisible, setModalVisible] = useState(false); const [isModalVisible, setModalVisible] = useState(false);
const [urlImg, setUrlImg] = useState(''); const [urlImg, setUrlImg] = useState('');
...@@ -36,6 +36,7 @@ const PickerImgUni = (props) => { ...@@ -36,6 +36,7 @@ const PickerImgUni = (props) => {
}).then((image) => { }).then((image) => {
setModalVisible(false); setModalVisible(false);
setUrlImg(image.path); setUrlImg(image.path);
onSelectImg(image.path);
}); });
}; };
...@@ -47,6 +48,7 @@ const PickerImgUni = (props) => { ...@@ -47,6 +48,7 @@ const PickerImgUni = (props) => {
}).then((image) => { }).then((image) => {
setModalVisible(false); setModalVisible(false);
setUrlImg(image.path); setUrlImg(image.path);
onSelectImg(image.path);
}); });
}; };
......
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