Commit 5422de2c by Giang Tran

edit moment

parent c8fb8023
...@@ -893,7 +893,7 @@ ...@@ -893,7 +893,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10; CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -926,7 +926,7 @@ ...@@ -926,7 +926,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10; CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
...@@ -58,14 +58,14 @@ const GeneralInfor = (props) => { ...@@ -58,14 +58,14 @@ const GeneralInfor = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextField <TextField
title={'Họ và tên đệm'} title={'Họ và tên đệm'}
onChangeText={(val) => setFirstName(val)} onChangeText={(val) => setLastName(val)}
/> />
</View> </View>
<View style={{width: 20}} /> <View style={{width: 20}} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextField <TextField
title={'Tên'} title={'Tên'}
onChangeText={(val) => setLastName(val)} onChangeText={(val) => setFirstName(val)}
/> />
</View> </View>
</View> </View>
......
...@@ -127,8 +127,9 @@ const styles = StyleSheet.create({ ...@@ -127,8 +127,9 @@ const styles = StyleSheet.create({
}, },
txtBtn: { txtBtn: {
color: R.colors.white, color: R.colors.white,
fontSize: getFontXD(52), fontSize: getFontXD(46),
textTransform: 'uppercase', textTransform: 'uppercase',
paddingHorizontal: 10,
}, },
txtSend: { txtSend: {
marginTop: 30, marginTop: 30,
......
...@@ -31,7 +31,6 @@ const ConfirmOTP = (propsa) => { ...@@ -31,7 +31,6 @@ const ConfirmOTP = (propsa) => {
const [value, setValue] = useState(''); const [value, setValue] = useState('');
const navigate = useNavigation(); const navigate = useNavigation();
console.log(propsa.route.params.email);
const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT}); const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT});
const [props, getCellOnLayoutHandler] = useClearByFocusCell({ const [props, getCellOnLayoutHandler] = useClearByFocusCell({
......
import React, {useState} from 'react'; import React, {useState, useEffect} from 'react';
import { import {
View, View,
Text, Text,
...@@ -34,13 +34,25 @@ const Login = (props) => { ...@@ -34,13 +34,25 @@ const Login = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const onSubmitLogin = async () => { useEffect(() => {
getAccount();
}, []);
const getAccount = async () => {
const jsonValue = await AsyncStorage.getItem(KEY.ACCOUNT);
const account = JSON.parse(jsonValue);
if (account) {
onSubmitLogin(account.email, account.pass);
}
};
const onSubmitLogin = async (email, pass) => {
const titles = ['tên đăng nhập', 'mật khẩu']; const titles = ['tên đăng nhập', 'mật khẩu'];
const index = checkFormatArray([email, pass]); const index = checkFormatArray([email, pass]);
if (index === true) { if (index === true) {
props.showLoading(); props.showLoading();
const firebase = await AsyncStorage.getItem(KEY.FIREBASE); firebase = await AsyncStorage.getItem(KEY.FIREBASE);
const res = await loginApi({ const res = await loginApi({
email, email,
password: pass, password: pass,
...@@ -51,7 +63,9 @@ const Login = (props) => { ...@@ -51,7 +63,9 @@ const Login = (props) => {
props.hideLoading(); props.hideLoading();
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
const jsonValue = JSON.stringify({email, pass});
AsyncStorage.setItem(KEY.TOKEN, res.data.data.token); AsyncStorage.setItem(KEY.TOKEN, res.data.data.token);
AsyncStorage.setItem(KEY.ACCOUNT, jsonValue);
props.saveUserToRedux(res.data.data); props.saveUserToRedux(res.data.data);
navigate.reset({ navigate.reset({
index: 1, index: 1,
...@@ -67,6 +81,8 @@ const Login = (props) => { ...@@ -67,6 +81,8 @@ const Login = (props) => {
} }
}; };
return ( return (
<View <View
style={{ style={{
...@@ -101,7 +117,9 @@ const Login = (props) => { ...@@ -101,7 +117,9 @@ const Login = (props) => {
marginVertical: 20, marginVertical: 20,
alignItems: 'center', alignItems: 'center',
}}> }}>
<TouchableOpacity onPress={onSubmitLogin} style={styles.wrapLogin}> <TouchableOpacity
onPress={() => onSubmitLogin(email, pass)}
style={styles.wrapLogin}>
<Text style={styles.txtLogin}>Đăng nhp</Text> <Text style={styles.txtLogin}>Đăng nhp</Text>
<Image source={R.images.iconRight1} style={styles.imgIcon} /> <Image source={R.images.iconRight1} style={styles.imgIcon} />
</TouchableOpacity> </TouchableOpacity>
......
...@@ -50,6 +50,7 @@ const NewPassword = (props) => { ...@@ -50,6 +50,7 @@ const NewPassword = (props) => {
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
console.log('response', res.data);
Alert.alert('Thông báo!', res.data.message); Alert.alert('Thông báo!', res.data.message);
}, 500); }, 500);
} }
......
import React, {useEffect, useState} from 'react';
import {
View,
Text,
Image,
StatusBar,
StyleSheet,
SafeAreaView,
ImageBackground,
TouchableOpacity,
Platform,
Alert,
} from 'react-native';
import R from '../../assets/R';
import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions';
import LinearGradient from 'react-native-linear-gradient';
import {connect} from 'react-redux';
import {HEIGHTXD, toPriceVnd} from '../../Config/Functions';
import Clipboard from '@react-native-clipboard/clipboard';
import {useNavigation} from '@react-navigation/native';
import {
WITHDRAW,
DEPOSIT,
CHOOSEMETHOD,
TRANSFER,
HISTORY,
PROFILE,
} from '../../routers/ScreenNames';
const HeaderHome = (props) => {
const navigate = useNavigation();
const [sponsorID, setSponsorID] = useState('sponsorIDlink');
const copyToClipboard = () => {
Alert.alert('Đã sao chép!');
Clipboard.setString(sponsorID);
};
return (
<View style={{justifyContent: 'center', alignItems: 'center'}}>
<View style={styles.containerTop}>
<View style={styles.containerInfor}>
<Image source={R.images.avartar} style={styles.imgAvatar} />
<View style={styles.wrapRight}>
<TouchableOpacity onPress={() => navigate.navigate(PROFILE)}>
<Text style={styles.txtName}>Vu Khac Minh</Text>
</TouchableOpacity>
<View style={styles.row1}>
<Text style={styles.txtlink}>{sponsorID}</Text>
<TouchableOpacity onPress={copyToClipboard}>
<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}> Đ</Text>
</View>
</View>
</View>
<View style={styles.containerMenu}>
<TouchableOpacity
onPress={() => navigate.navigate(CHOOSEMETHOD)}
style={styles.wraper}>
<Image style={styles.imgIcon} source={R.images.iconRecharge} />
<Text style={styles.txt}>Np tin</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigate.navigate(WITHDRAW)}
style={styles.wraper}>
<Image style={styles.imgIcon} source={R.images.iconWithdrawal} />
<Text style={styles.txt}>Rút tin</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigate.navigate(TRANSFER)}
style={styles.wraper}>
<Image style={styles.imgIcon} source={R.images.iconTransfer} />
<Text style={styles.txt}>Chuyn khon</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigate.navigate(HISTORY)}
style={styles.wraper}>
<Image style={styles.imgIcon} source={R.images.iconHistory} />
<Text style={styles.txt}>Lch s</Text>
</TouchableOpacity>
</View>
</View>
</View>
);
};
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {})(HeaderHome);
const styles = StyleSheet.create({
img: {
height: Platform.OS == 'ios' ? HEIGHTXD(728) : HEIGHTXD(808),
width: '100%',
justifyContent: 'center',
alignItems: 'center',
},
containerTop: {
height: HEIGHTXD(856),
width: '90%',
backgroundColor: 'white',
borderRadius: 10,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.25,
shadowRadius: 2.84,
elevation: 3,
},
containerMenu: {
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
padding: 10,
},
wraper: {
justifyContent: 'center',
alignItems: 'center',
},
imgIcon: {
width: WIDTHXD(134),
height: HEIGHTXD(134),
marginBottom: 10,
resizeMode: 'contain',
},
imgIconCopy: {
width: WIDTHXD(134),
height: HEIGHTXD(134),
resizeMode: 'contain',
},
txt: {
fontSize: getFontXD(36),
color: R.colors.txtMain,
},
txtName: {
fontSize: getFontXD(52),
color: '#00359C',
},
txtlink: {
fontSize: getFontXD(42),
color: '#A2A2A2',
},
imgAvatar: {
width: WIDTHXD(240),
height: WIDTHXD(240),
borderRadius: WIDTHXD(120),
},
txtMoney: {
fontSize: getFontXD(62),
color: '#FFB721',
marginVertical: 5,
fontWeight: 'bold',
},
txtTitle: {
fontSize: getFontXD(42),
color: '#A2A2A2',
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',
},
});
...@@ -3,7 +3,6 @@ import {View, Text, StatusBar, SafeAreaView} from 'react-native'; ...@@ -3,7 +3,6 @@ import {View, Text, StatusBar, SafeAreaView} from 'react-native';
import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions'; import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions';
import Tab1 from './Tab1/Tab1'; import Tab1 from './Tab1/Tab1';
import Tab2 from './Tab2/Tab2'; import Tab2 from './Tab2/Tab2';
import Tab3 from './Tab3/Tab3';
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs'; import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
const Tab = createMaterialTopTabNavigator(); const Tab = createMaterialTopTabNavigator();
......
...@@ -80,6 +80,34 @@ const data = [ ...@@ -80,6 +80,34 @@ const data = [
const NewFeed = (props) => { const NewFeed = (props) => {
const [selected, setSelected] = useState(1); const [selected, setSelected] = useState(1);
const [page, setPage] = useState(1);
const [tottalPage, setTotalPage] = useState(1);
const [isRefresh, setisRefresh] = useState(false);
const onRefresh = () => {
console.log('On Refersh');
};
const onLoadMore = () => {
console.log('Load more');
};
// const getDataLoadMore=async ()=>{
// setisRefresh(true)
// const res=await GetListNotification({keyword:txtSearch,page_index:page+1,page_size:8,platform:Platform.OS})
// setPage(page+1)
// if(res.data.code==200){
// setData(data.concat(res.data.data))
// }
// setisRefresh(false)
// }
// const onLoadMore=()=>{
// if(page<tottalPage)
// getDataLoadMore()
// }
return ( return (
<View style={{flex: 1, backgroundColor: 'white'}}> <View style={{flex: 1, backgroundColor: 'white'}}>
...@@ -108,6 +136,12 @@ const NewFeed = (props) => { ...@@ -108,6 +136,12 @@ const NewFeed = (props) => {
<FlatList <FlatList
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
keyExtractor={(item, index) => item.id} keyExtractor={(item, index) => item.id}
refreshing={isRefresh}
onRefresh={() => onRefresh()}
onEndReachedThreshold={0.01}
onEndReached={(info) => {
onLoadMore();
}}
data={data} data={data}
renderItem={({item}) => <Item item={item} />} renderItem={({item}) => <Item item={item} />}
/> />
......
import React, {Component} from 'react';
import {View, Text} from 'react-native';
const NewFeed = (props) => {
return (
<View>
<Text>New feed 3</Text>
</View>
);
};
export default NewFeed;
...@@ -15,6 +15,7 @@ import { ...@@ -15,6 +15,7 @@ import {
PROFILE, PROFILE,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {connect} from 'react-redux';
const menus = [ const menus = [
{ {
...@@ -61,8 +62,8 @@ const Drawer = (props) => { ...@@ -61,8 +62,8 @@ const Drawer = (props) => {
props.toggleModal(); props.toggleModal();
navigate.navigate(PROFILE); navigate.navigate(PROFILE);
}}> }}>
<Text style={styles.txtTop}>NGUYEN VAN A</Text> <Text style={styles.txtTop}>{props.user.fullname}</Text>
<Text>SponsorIDLink</Text> <Text>{props.user.sponsor_id}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
...@@ -168,4 +169,10 @@ const styles = StyleSheet.create({ ...@@ -168,4 +169,10 @@ const styles = StyleSheet.create({
}, },
}); });
export default Drawer; const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {})(Drawer);
...@@ -30,11 +30,12 @@ import { ...@@ -30,11 +30,12 @@ import {
const HeaderHome = (props) => { const HeaderHome = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const [sponsorID, setSponsorID] = useState('sponsorIDlink');
console.log();
const copyToClipboard = () => { const copyToClipboard = () => {
Alert.alert('Đã sao chép!'); Alert.alert('Đã sao chép!');
Clipboard.setString(sponsorID); Clipboard.setString(props.user.sponsor_id);
}; };
return ( return (
...@@ -48,11 +49,11 @@ const HeaderHome = (props) => { ...@@ -48,11 +49,11 @@ const HeaderHome = (props) => {
<Image source={R.images.avartar} style={styles.imgAvatar} /> <Image source={R.images.avartar} style={styles.imgAvatar} />
<View style={styles.wrapRight}> <View style={styles.wrapRight}>
<TouchableOpacity onPress={() => navigate.navigate(PROFILE)}> <TouchableOpacity onPress={() => navigate.navigate(PROFILE)}>
<Text style={styles.txtName}>Vu Khac Minh</Text> <Text style={styles.txtName}>{props.user.fullname}</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={styles.row1}> <View style={styles.row1}>
<Text style={styles.txtlink}>{sponsorID}</Text> <Text style={styles.txtlink}>{props.user.sponsor_id}</Text>
<TouchableOpacity onPress={copyToClipboard}> <TouchableOpacity onPress={copyToClipboard}>
<Image <Image
source={R.images.iconCopy} source={R.images.iconCopy}
...@@ -62,7 +63,12 @@ const HeaderHome = (props) => { ...@@ -62,7 +63,12 @@ const HeaderHome = (props) => {
</View> </View>
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtMoney}> {toPriceVnd(1000000)}</Text> <Text style={styles.txtMoney}>
{' '}
{props.user.current_money == 0
? 0
: toPriceVnd(props.user.current_money)}
</Text>
<Text style={styles.txtTitle}> Đ</Text> <Text style={styles.txtTitle}> Đ</Text>
</View> </View>
</View> </View>
......
...@@ -57,8 +57,14 @@ const PickerImgUni = (props) => { ...@@ -57,8 +57,14 @@ const PickerImgUni = (props) => {
return ( return (
<TouchableOpacity <TouchableOpacity
onPress={() => setModalVisible(true)} onPress={() => setModalVisible(true)}
style={{marginTop: 10, width: WIDTHXD(480)}}> style={{
<Text style={styles.txt}>{title}</Text> marginTop: 10,
width: WIDTHXD(480),
alignItems: 'center',
}}>
<View style={{width: WIDTHXD(480), marginBottom: 5}}>
<Text style={styles.txt}>{title}:</Text>
</View>
{urlImg ? ( {urlImg ? (
<Image source={{uri: urlImg}} style={styles.container} /> <Image source={{uri: urlImg}} style={styles.container} />
...@@ -112,7 +118,7 @@ const PickerImgUni = (props) => { ...@@ -112,7 +118,7 @@ const PickerImgUni = (props) => {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
width: WIDTHXD(350), width: WIDTHXD(350),
height: HEIGHTXD(280), height: HEIGHTXD(320),
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
borderRadius: 10, borderRadius: 10,
...@@ -123,7 +129,6 @@ const styles = StyleSheet.create({ ...@@ -123,7 +129,6 @@ const styles = StyleSheet.create({
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: R.colors.color777, color: R.colors.color777,
marginBottom: 5, marginBottom: 5,
paddingLeft: 10,
}, },
selectionImg: { selectionImg: {
padding: 10, padding: 10,
......
...@@ -42,7 +42,7 @@ function MyStack(props) { ...@@ -42,7 +42,7 @@ function MyStack(props) {
headerStatusBarHeight: 0, headerStatusBarHeight: 0,
}} }}
headerMode={'none'} headerMode={'none'}
initialRouteName={ScreenName.AUTHEN}> initialRouteName={ScreenName.TABNAVIGATOR}>
<Stack.Screen name={ScreenName.LOGINSCREEN} component={Login} /> <Stack.Screen name={ScreenName.LOGINSCREEN} component={Login} />
<Stack.Screen name={ScreenName.NOTIFICATION} component={Notification} /> <Stack.Screen name={ScreenName.NOTIFICATION} component={Notification} />
<Stack.Screen name={ScreenName.TABNAVIGATOR} component={TabNavigator} /> <Stack.Screen name={ScreenName.TABNAVIGATOR} component={TabNavigator} />
......
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