Commit cebec552 by Giang Tran

update laguage

parent 456d9095
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
</dict> </dict>
</dict> </dict>
</dict> </dict>
<key>NSCameraUsageDescription</key>
<string>Accect connect camera</string>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string></string> <string></string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
import moment from 'moment'; import moment from 'moment';
import _ from 'lodash'; import _ from 'lodash';
import I18n from '../helper/i18/i18n'; import I18n from '../helper/i18/i18n';
import AppText from '../components/AppText';
import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames'; import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames';
import R from '../assets/R'; import R from '../assets/R';
...@@ -50,58 +51,58 @@ export const renderStatus = (status) => { ...@@ -50,58 +51,58 @@ export const renderStatus = (status) => {
switch (status) { switch (status) {
case 2: case 2:
return ( return (
<Text <AppText
i18nKey={'WaitVerification'}
style={{ style={{
color: '#F99D1D', color: '#F99D1D',
fontSize: getFontXD(42), fontSize: getFontXD(42),
fontWeight: 'bold', fontWeight: 'bold',
}}> }}
Ch xác minh />
</Text>
); );
case 3: case 3:
return ( return (
<Text <AppText
i18nKey={'Verified'}
style={{ style={{
color: '#17B217', color: '#17B217',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: getFontXD(42), fontSize: getFontXD(42),
}}> }}
Đã xác minh />
</Text>
); );
case 5: case 5:
return ( return (
<Text <AppText
i18nKey={'Request_Open_Account_CQG'}
style={{ style={{
color: '#F99D1D', color: '#F99D1D',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: getFontXD(42), fontSize: getFontXD(42),
}}> }}
Yêu cu m TK CQG />
</Text>
); );
case 6: case 6:
return ( return (
<Text <AppText
i18nKey={'EnableCQG'}
style={{ style={{
color: R.colors.main, color: R.colors.main,
fontWeight: 'bold', fontWeight: 'bold',
fontSize: getFontXD(42), fontSize: getFontXD(42),
}}> }}
Có tài khon CQG />
</Text>
); );
default: default:
return ( return (
<Text <AppText
i18nKey={'NotVerified'}
style={{ style={{
color: '#929292', color: '#929292',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: getFontXD(42), fontSize: getFontXD(42),
}}> }}
Chưa xác minh />
</Text>
); );
} }
}; };
...@@ -116,11 +117,11 @@ export const confirmAlert = (title, callback) => { ...@@ -116,11 +117,11 @@ export const confirmAlert = (title, callback) => {
title, title,
[ [
{ {
text: 'Hủy', text: I18n.t('Cancel'),
style: 'cancel', style: 'cancel',
}, },
{ {
text: 'Đồng ý', text: I18n.t(Ok),
onPress: () => { onPress: () => {
callback(); callback();
}, },
...@@ -164,17 +165,17 @@ export const Gender = { ...@@ -164,17 +165,17 @@ export const Gender = {
female: 1, female: 1,
}; };
export const converType = (type) => { export const converType = (type) => {
if (type == 'DEPOSIT') return 'Nạp tiền'; if (type == 'DEPOSIT') return I18n.t('Deposit');
return 'Rút tiền'; return I18n.t('Withdraw');
}; };
export const converStatus = (status) => { export const converStatus = (status) => {
switch (status) { switch (status) {
case 0: case 0:
return 'Chờ xử lý'; return I18n.t('Waiting_for_Progress');
case 1: case 1:
return 'Thành công'; return I18n.t('Success');
case 2: case 2:
return 'Huỷ'; return I18n.t('Cancel');
} }
}; };
......
...@@ -4,6 +4,7 @@ import HeaderBack from '../../../components/Header/HeaderBack'; ...@@ -4,6 +4,7 @@ import HeaderBack from '../../../components/Header/HeaderBack';
import CheckBox from '@react-native-community/checkbox'; import CheckBox from '@react-native-community/checkbox';
import R from '../../../assets/R'; import R from '../../../assets/R';
import {getFontXD, toPriceVnd} from '../../../Config/Functions'; import {getFontXD, toPriceVnd} from '../../../Config/Functions';
import AppText from '../../../components/AppText';
const ContainerTop = (props) => { const ContainerTop = (props) => {
const {fee} = props; const {fee} = props;
...@@ -23,9 +24,10 @@ const ContainerTop = (props) => { ...@@ -23,9 +24,10 @@ const ContainerTop = (props) => {
alignItems: 'flex-end', alignItems: 'flex-end',
}}> }}>
{e.price_package.price == 0 ? ( {e.price_package.price == 0 ? (
<Text style={[styles.txtMoney, {color: '#18B918'}]}> <AppText
Min phí i18nKey={'Free'}
</Text> style={[styles.txtMoney, {color: '#18B918'}]}
/>
) : ( ) : (
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}>
{toPriceVnd(e.price_package.price)} {toPriceVnd(e.price_package.price)}
......
...@@ -2,20 +2,24 @@ import React, {Component} from 'react'; ...@@ -2,20 +2,24 @@ import React, {Component} from 'react';
import {View, Text, StyleSheet, TouchableOpacity, Linking} from 'react-native'; import {View, Text, StyleSheet, TouchableOpacity, Linking} from 'react-native';
import {getFontXD, toPriceVnd} from '../../../Config/Functions'; import {getFontXD, toPriceVnd} from '../../../Config/Functions';
import R from '../../../assets/R'; import R from '../../../assets/R';
import AppText from '../../../components/AppText';
import I18n from '../../../helper/i18/i18n';
const Footer = (props) => { const Footer = (props) => {
return ( return (
<View style={{flex: 1, paddingHorizontal: 10, marginTop: 10}}> <View style={{flex: 1, paddingHorizontal: 10, marginTop: 10}}>
<View style={{flexDirection: 'row', marginVertical: 5}}> <View style={{flexDirection: 'row', marginVertical: 5}}>
<Text style={styles.txtTitle}>Bn có th m tài khon th </Text> <AppText i18nKey={'Open_account_demo'} style={styles.txtTitle} />
<TouchableOpacity <TouchableOpacity
onPress={() => onPress={() =>
Linking.openURL('https://mdemo.cqg.com/cqg/desktop/demorequest') Linking.openURL('https://mdemo.cqg.com/cqg/desktop/demorequest')
}> }>
<Text style={styles.txtLink}>Ti đây.</Text> <AppText i18nKey={'Here'} style={styles.txtLink} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<Text style={styles.txtTitle}>Tm tính:{toPriceVnd(props.price)}</Text> <Text style={styles.txtTitle}>
{I18n.t('Provisional')}:{toPriceVnd(props.price)}
</Text>
<View <View
style={{ style={{
justifyContent: 'center', justifyContent: 'center',
...@@ -26,7 +30,7 @@ const Footer = (props) => { ...@@ -26,7 +30,7 @@ const Footer = (props) => {
onPress={props.onClick} onPress={props.onClick}
onClick onClick
style={styles.btnSend}> style={styles.btnSend}>
<Text style={styles.txtSend}>M tài khon</Text> <AppText i18nKey={'Open_account'} style={styles.txtSend} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
......
...@@ -12,30 +12,7 @@ import {getListPacketCQG, openCQG} from '../../../apis/Functions/packetCQG'; ...@@ -12,30 +12,7 @@ import {getListPacketCQG, openCQG} from '../../../apis/Functions/packetCQG';
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'; import {useNavigation} from '@react-navigation/native';
import {saveUserToRedux} from '../../../actions/users';
const Item = () => {
const [isSelected, setSelection] = useState(false);
return (
<View style={styles.item}>
<View style={{flex: 1}}>
<Text>M tài khon giao dch CQG</Text>
</View>
<View
style={{
width: 120,
marginRight: 30,
alignItems: 'flex-end',
}}>
<Text style={[styles.txtMoney, {color: '#18B918'}]}>Min phí</Text>
</View>
<CheckBox
value={isSelected}
onValueChange={setSelection}
boxType={'square'}
/>
</View>
);
};
const PacketCQG = (props) => { const PacketCQG = (props) => {
const [listData, setListData] = useState([]); const [listData, setListData] = useState([]);
...@@ -60,6 +37,7 @@ const PacketCQG = (props) => { ...@@ -60,6 +37,7 @@ const PacketCQG = (props) => {
props.hideLoading(); props.hideLoading();
console.log(res); console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
props.saveUserToRedux(res.data.data);
setTimeout(() => { setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
...@@ -236,4 +214,5 @@ const mapStateToProps = (state) => { ...@@ -236,4 +214,5 @@ const mapStateToProps = (state) => {
export default connect(mapStateToProps, { export default connect(mapStateToProps, {
showLoading, showLoading,
hideLoading, hideLoading,
saveUserToRedux,
})(PacketCQG); })(PacketCQG);
...@@ -82,7 +82,6 @@ const BankInfor = (props) => { ...@@ -82,7 +82,6 @@ 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('Data', props.route.params.body);
if (index === true) { if (index === true) {
const data = createFormData( const data = createFormData(
...@@ -114,7 +113,10 @@ const BankInfor = (props) => { ...@@ -114,7 +113,10 @@ const BankInfor = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
......
...@@ -41,7 +41,10 @@ const GeneralInfor = (props) => { ...@@ -41,7 +41,10 @@ const GeneralInfor = (props) => {
address, address,
}); });
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
......
...@@ -119,39 +119,13 @@ const Profile = (props) => { ...@@ -119,39 +119,13 @@ const Profile = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
// const onNextPress = () => {
// const titles = [
// 'loại thẻ',
// 'số thẻ',
// 'ảnh CNND mặt trước',
// 'ảnh CMND mặt sau',
// 'ảnh chữ ký',
// ];
// const index = checkFormatArray([urlFont, urlBack, urlSign]);
// if (index === true) {
// props.navigation.navigate('BankInfor', {
// body: {
// cmnd,
// card_type: type.value,
// date_range: convertTime(date_range),
// ...props.route.params,
// },
// img: {
// urlFont,
// urlBack,
// urlSign,
// },
// });
// } else {
// Alert.alert('Vui lòng thêm ' + titles[index]);
// }
// };
return ( return (
<KeyboardAvoidingView <KeyboardAvoidingView
behavior={Platform.Os === 'ios' ? 'padding' : 'height'} behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
......
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import moment from 'moment'; import moment from 'moment';
import AppText from '../../../components/AppText';
import TextField from '../../../components/Input/TextField'; import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
...@@ -47,14 +48,14 @@ const GeneralInfor = (props) => { ...@@ -47,14 +48,14 @@ const GeneralInfor = (props) => {
alignItems: 'center', alignItems: 'center',
}}> }}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text <AppText
i18nKey={'Status'}
style={{ style={{
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: R.colors.color777, color: R.colors.color777,
marginBottom: 5, marginBottom: 5,
}}> }}
Trng thái />
</Text>
</View> </View>
<View style={{flex: 1}}>{renderStatus(props.user.status)}</View> <View style={{flex: 1}}>{renderStatus(props.user.status)}</View>
</View> </View>
......
...@@ -5,6 +5,7 @@ import TextField from '../../../components/Input/TextField'; ...@@ -5,6 +5,7 @@ import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import Button from '../../../components/Button'; import Button from '../../../components/Button';
import {HEIGHTXD} from '../../../Config/Functions'; import {HEIGHTXD} from '../../../Config/Functions';
import AppText from '../../../components/AppText';
const TransferView = (props) => { const TransferView = (props) => {
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
...@@ -16,33 +17,15 @@ const TransferView = (props) => { ...@@ -16,33 +17,15 @@ const TransferView = (props) => {
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
}}> }}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau!
</Text>
</View>
{/* <View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}>
<TextField
onChangeText={(val) => consoele.log(val)}
title={'Số tiền'}
/>
<TextField
onChangeText={(val) => consoele.log(val)}
title={'Phương thức nạp'}
/>
<TextMulti
onChangeText={(val) => consoele.log(val)}
numberLines={3}
title={'Ghi chú'}
/> />
</View> </View>
<View style={styles.containerBtn}>
<Button title={'Chuyển tiền'} />
</View> */}
</View> </View>
); );
}; };
......
...@@ -56,7 +56,10 @@ const WalletDeposit = (props) => { ...@@ -56,7 +56,10 @@ const WalletDeposit = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
return ( return (
......
...@@ -72,10 +72,7 @@ const WalletWithdraw = (props) => { ...@@ -72,10 +72,7 @@ const WalletWithdraw = (props) => {
setData(newList); setData(newList);
} }
} else { } else {
Alert.alert( Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
I18n.t('Notification'),
'Không lấy được danh sách phương thức!',
);
} }
}; };
...@@ -108,7 +105,10 @@ const WalletWithdraw = (props) => { ...@@ -108,7 +105,10 @@ const WalletWithdraw = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
......
...@@ -5,6 +5,7 @@ import HeaderBack from '../../../components/Header/HeaderBack'; ...@@ -5,6 +5,7 @@ import HeaderBack from '../../../components/Header/HeaderBack';
import Item from './Item'; import Item from './Item';
import {getListWidthDraw} from '../../../apis/Functions/Widthdraw'; import {getListWidthDraw} from '../../../apis/Functions/Widthdraw';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import I18n from '../../../helper/i18/i18n';
const WithdrawView = (props) => { const WithdrawView = (props) => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
...@@ -20,7 +21,7 @@ const WithdrawView = (props) => { ...@@ -20,7 +21,7 @@ const WithdrawView = (props) => {
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setData(res.data.data); setData(res.data.data);
} else { } else {
alert('Không lấy được danh sách phương thức!'); Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
} }
}; };
......
...@@ -18,6 +18,7 @@ import Login from './Login'; ...@@ -18,6 +18,7 @@ import Login from './Login';
import Registor from './Registor'; import Registor from './Registor';
import {ScrollView} from 'react-native-gesture-handler'; import {ScrollView} from 'react-native-gesture-handler';
import R from '../../assets/R'; import R from '../../assets/R';
import I18n from '../../helper/i18/i18n';
const {width, height} = Dimensions.get('window'); const {width, height} = Dimensions.get('window');
...@@ -51,12 +52,12 @@ const Authen = (props) => { ...@@ -51,12 +52,12 @@ const Authen = (props) => {
<Tab.Screen <Tab.Screen
name="LOGIN" name="LOGIN"
component={Login} component={Login}
options={{tabBarLabel: 'Đăng nhập'}} options={{tabBarLabel: I18n.t('Login')}}
/> />
<Tab.Screen <Tab.Screen
name="REGISTOR" name="REGISTOR"
component={Registor} component={Registor}
options={{tabBarLabel: 'Đăng ký'}} options={{tabBarLabel: I18n.t('Register')}}
/> />
</Tab.Navigator> </Tab.Navigator>
</ImageBackground> </ImageBackground>
......
...@@ -22,6 +22,7 @@ import {NEWPASSWORD} from '../../routers/ScreenNames'; ...@@ -22,6 +22,7 @@ import {NEWPASSWORD} from '../../routers/ScreenNames';
import {verifyOTPApi} from '../../apis/Functions/users'; import {verifyOTPApi} from '../../apis/Functions/users';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import AppText from '../../components/AppText';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
...@@ -73,7 +74,7 @@ const ConfirmOTP = (propsa) => { ...@@ -73,7 +74,7 @@ const ConfirmOTP = (propsa) => {
<View style={{height: 20}} /> <View style={{height: 20}} />
<View style={styles.wrap}> <View style={styles.wrap}>
<Text style={styles.txtTitle}>Mã xác thc:</Text> <AppText i18nKey={'Verify_code'} style={styles.txtTitle} />
<View style={styles.containerCode}> <View style={styles.containerCode}>
<CodeField <CodeField
ref={ref} ref={ref}
...@@ -100,13 +101,13 @@ const ConfirmOTP = (propsa) => { ...@@ -100,13 +101,13 @@ const ConfirmOTP = (propsa) => {
</View> </View>
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity onPress={confirm} style={styles.btn}> <TouchableOpacity onPress={confirm} style={styles.btn}>
<Text style={styles.txtBtn}>Tiếp tc</Text> <AppText i18nKey={'Continue'} style={styles.txtBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
style={styles.wrapFooter} style={styles.wrapFooter}
onPress={() => console.log('Hello')}> onPress={() => navigate.goBack()}>
<Text style={styles.txtNote}>Mã OTP có hiu lc trong 5 phút.</Text> <Text style={styles.txtNote}>Mã OTP có hiu lc trong 5 phút.</Text>
<Text style={styles.txtSend}>Gi li</Text> <AppText i18nKey={'Re_send'} style={styles.txtSend} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
......
...@@ -27,6 +27,7 @@ import {saveUserToRedux} from '../../actions/users'; ...@@ -27,6 +27,7 @@ import {saveUserToRedux} from '../../actions/users';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import messaging from '@react-native-firebase/messaging'; import messaging from '@react-native-firebase/messaging';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import AppText from '../../components/AppText';
const Login = (props) => { const Login = (props) => {
const {navigation} = props; const {navigation} = props;
...@@ -91,7 +92,10 @@ const Login = (props) => { ...@@ -91,7 +92,10 @@ const Login = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
...@@ -105,14 +109,14 @@ const Login = (props) => { ...@@ -105,14 +109,14 @@ const Login = (props) => {
}}> }}>
<InputIcon <InputIcon
icon={R.images.iconUser3} icon={R.images.iconUser3}
title={'Tên đăng nhập'} title={'Email'}
placeholder={'Nhập tên đăng nhập'} placeholder={'Nhập email'}
onChangeText={(val) => setEmail(val)} onChangeText={(val) => setEmail(val)}
value={email} value={email}
/> />
<InputIcon <InputIcon
icon={R.images.iconLock} icon={R.images.iconLock}
title={'Mật khẩu'} title={'Password'}
placeholder={'Nhập mật khẩu'} placeholder={'Nhập mật khẩu'}
isPassWord={true} isPassWord={true}
onChangeText={(val) => setPass(val)} onChangeText={(val) => setPass(val)}
...@@ -121,7 +125,7 @@ const Login = (props) => { ...@@ -121,7 +125,7 @@ const Login = (props) => {
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(CONFIRMEMAIL)} onPress={() => navigate.navigate(CONFIRMEMAIL)}
style={styles.forgotView}> style={styles.forgotView}>
<Text style={styles.txtTitle}>Quên mt khu?</Text> <AppText i18nKey={'ForgotPassword'} style={styles.txtTitle} />
</TouchableOpacity> </TouchableOpacity>
<View <View
...@@ -132,17 +136,17 @@ const Login = (props) => { ...@@ -132,17 +136,17 @@ const Login = (props) => {
<TouchableOpacity <TouchableOpacity
onPress={() => onSubmitLogin(email, pass)} onPress={() => onSubmitLogin(email, pass)}
style={styles.wrapLogin}> style={styles.wrapLogin}>
<Text style={styles.txtLogin}>Đăng nhp</Text> <AppText i18nKey={'Login'} style={styles.txtLogin} />
<Image source={R.images.iconRight1} style={styles.imgIcon} /> <Image source={R.images.iconRight1} style={styles.imgIcon} />
</TouchableOpacity> </TouchableOpacity>
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtTitle}>Bn chưa có tài khon?</Text> <AppText i18nKey={'Have_account'} style={styles.txtTitle} />
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
navigation.navigate('REGISTOR'); navigation.navigate('REGISTOR');
}}> }}>
<Text style={styles.txtRegistor}>Đăng ký</Text> <AppText i18nKey={'Register'} style={styles.txtRegistor} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
......
...@@ -15,6 +15,7 @@ import {showLoading, hideLoading} from '../../actions/loadingAction'; ...@@ -15,6 +15,7 @@ import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {registorApi} from '../../apis/Functions/users'; import {registorApi} from '../../apis/Functions/users';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import AppText from '../../components/AppText';
const Registor = (props) => { const Registor = (props) => {
const {navigation} = props; const {navigation} = props;
...@@ -61,7 +62,10 @@ const Registor = (props) => { ...@@ -61,7 +62,10 @@ const Registor = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
...@@ -75,28 +79,28 @@ const Registor = (props) => { ...@@ -75,28 +79,28 @@ const Registor = (props) => {
}}> }}>
<InputIcon <InputIcon
icon={R.images.iconEmail} icon={R.images.iconEmail}
title={'Email đăng ký'} title={'Email'}
placeholder={'Nhập email'} placeholder={'Nhập email'}
onChangeText={(val) => setEmail(val)} onChangeText={(val) => setEmail(val)}
/> />
<InputIcon <InputIcon
icon={R.images.iconLock} icon={R.images.iconLock}
title={'Mật khẩu'} title={'Password'}
placeholder={'Nhập mật khẩu'} placeholder={'Nhập mật khẩu'}
onChangeText={(val) => setPassword(val)} onChangeText={(val) => setPassword(val)}
isPassWord={true} isPassWord={true}
/> />
<InputIcon <InputIcon
icon={R.images.iconLock} icon={R.images.iconLock}
title={'Nhập lại mật khẩu'} title={'Confirm_pass'}
placeholder={'Nhập mật khẩu'} placeholder={'Nhập mật khẩu'}
onChangeText={(val) => setPasswordConfirm(val)} onChangeText={(val) => setPasswordConfirm(val)}
isPassWord={true} isPassWord={true}
/> />
<InputIcon <InputIcon
icon={R.images.iconIntroduct} icon={R.images.iconIntroduct}
title={'Mã giới thiệu'} title={'Code_introduce'}
placeholder={'Nhập mã giới thiệu nếu có'} placeholder={'Nhập mã giới thiệu nếu có'}
onChangeText={(val) => setSponsor_id(val)} onChangeText={(val) => setSponsor_id(val)}
isPassWord={true} isPassWord={true}
...@@ -108,17 +112,17 @@ const Registor = (props) => { ...@@ -108,17 +112,17 @@ const Registor = (props) => {
alignItems: 'center', alignItems: 'center',
}}> }}>
<TouchableOpacity onPress={registorClick} style={styles.wrapLogin}> <TouchableOpacity onPress={registorClick} style={styles.wrapLogin}>
<Text style={styles.txtLogin}>Đăng ký</Text> <AppText i18nKey={'Register'} style={styles.txtLogin} />
<Image source={R.images.iconRight1} style={styles.imgIcon} /> <Image source={R.images.iconRight1} style={styles.imgIcon} />
</TouchableOpacity> </TouchableOpacity>
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtTitle}>Bn đã có tài khon?</Text> <AppText i18nKey={'Account_already'} style={styles.txtTitle} />
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
navigation.navigate('LOGIN'); navigation.navigate('LOGIN');
}}> }}>
<Text style={styles.txtRegistor}>Đăng nhp</Text> <AppText i18nKey={'Login'} style={styles.txtRegistor} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
......
...@@ -11,7 +11,6 @@ import {AccountVerification, PACKETCQG} from '../../routers/ScreenNames'; ...@@ -11,7 +11,6 @@ import {AccountVerification, PACKETCQG} from '../../routers/ScreenNames';
const Home = (props) => { const Home = (props) => {
const [data, setData] = useState({total_deposit: 0, total_withdraw: 0}); const [data, setData] = useState({total_deposit: 0, total_withdraw: 0});
const navigate = useNavigation();
useEffect(() => { useEffect(() => {
getData(); getData();
}, []); }, []);
...@@ -20,7 +19,7 @@ const Home = (props) => { ...@@ -20,7 +19,7 @@ const Home = (props) => {
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setData(res.data.data); setData(res.data.data);
} else { } else {
Alert.alert(I18n.t('Notification'), 'Không lấy được thông tin!'); Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
} }
}; };
......
...@@ -25,9 +25,7 @@ const HomeView = (props) => { ...@@ -25,9 +25,7 @@ const HomeView = (props) => {
<View style={styles.row}> <View style={styles.row}>
<View style={styles.row}> <View style={styles.row}>
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<AppText i18nKey={'Deposit'} style={styles.txtTitle}> <AppText i18nKey={'Deposit'} style={styles.txtTitle} />
Np tin
</AppText>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}>
{' '} {' '}
{total_deposit == 0 ? 0 : toPriceVnd(total_deposit)} Đ{' '} {total_deposit == 0 ? 0 : toPriceVnd(total_deposit)} Đ{' '}
...@@ -37,9 +35,7 @@ const HomeView = (props) => { ...@@ -37,9 +35,7 @@ const HomeView = (props) => {
style={{width: 0.5, backgroundColor: R.colors.borderGray}} style={{width: 0.5, backgroundColor: R.colors.borderGray}}
/> />
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<AppText i18nKey={'Withdraw'} style={styles.txtTitle}> <AppText i18nKey={'Withdraw'} style={styles.txtTitle} />
Rút tin
</AppText>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}>
{' '} {' '}
{total_withdraw == 0 ? 0 : toPriceVnd(total_withdraw)} Đ{' '} {total_withdraw == 0 ? 0 : toPriceVnd(total_withdraw)} Đ{' '}
...@@ -50,16 +46,12 @@ const HomeView = (props) => { ...@@ -50,16 +46,12 @@ const HomeView = (props) => {
<View style={{height: 0.5, backgroundColor: R.colors.borderGray}} /> <View style={{height: 0.5, backgroundColor: R.colors.borderGray}} />
<View style={styles.row}> <View style={styles.row}>
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<AppText i18nKey={'Rose'} style={styles.txtTitle}> <AppText i18nKey={'Rose'} style={styles.txtTitle} />
Hoa hng
</AppText>
<Text style={styles.txtMoney1}>0 Đ </Text> <Text style={styles.txtMoney1}>0 Đ </Text>
</View> </View>
<View style={{width: 0.5, backgroundColor: R.colors.borderGray}} /> <View style={{width: 0.5, backgroundColor: R.colors.borderGray}} />
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<AppText i18nKey={'Profit'} style={styles.txtTitle}> <AppText i18nKey={'Profit'} style={styles.txtTitle} />
Li nhun
</AppText>
<Text style={styles.txtMoney1}>0 Đ</Text> <Text style={styles.txtMoney1}>0 Đ</Text>
</View> </View>
</View> </View>
......
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 I18n from '../../helper/i18/i18n';
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(I18n.t('Notification'), 'Đã 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',
},
});
...@@ -4,6 +4,7 @@ import R from '../../assets/R'; ...@@ -4,6 +4,7 @@ import R from '../../assets/R';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import {getFontXD} from '../../Config/Functions'; import {getFontXD} from '../../Config/Functions';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import AppText from '../../components/AppText';
const Business = (props) => { const Business = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -11,14 +12,14 @@ const Business = (props) => { ...@@ -11,14 +12,14 @@ const Business = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'GeneralBusiness'} /> <HeaderBack title={'GeneralBusiness'} />
<View style={styles.container}> <View style={styles.container}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
</View> </View>
</View> </View>
); );
......
...@@ -4,6 +4,7 @@ import R from '../../assets/R'; ...@@ -4,6 +4,7 @@ import R from '../../assets/R';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import {getFontXD} from '../../Config/Functions'; import {getFontXD} from '../../Config/Functions';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import AppText from '../../components/AppText';
const Customer = (props) => { const Customer = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -11,14 +12,14 @@ const Customer = (props) => { ...@@ -11,14 +12,14 @@ const Customer = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Customer'} /> <HeaderBack title={'Customer'} />
<View style={styles.container}> <View style={styles.container}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
</View> </View>
</View> </View>
); );
......
...@@ -4,6 +4,7 @@ import R from '../../assets/R'; ...@@ -4,6 +4,7 @@ import R from '../../assets/R';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import {getFontXD} from '../../Config/Functions'; import {getFontXD} from '../../Config/Functions';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import AppText from '../../components/AppText';
const Partner = (props) => { const Partner = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -11,14 +12,14 @@ const Partner = (props) => { ...@@ -11,14 +12,14 @@ const Partner = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Partnership'} /> <HeaderBack title={'Partnership'} />
<View style={styles.container}> <View style={styles.container}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
</View> </View>
</View> </View>
); );
......
...@@ -3,6 +3,7 @@ import {View, Text} from 'react-native'; ...@@ -3,6 +3,7 @@ import {View, Text} from 'react-native';
import {getFontXD} from '../../../Config/Functions'; import {getFontXD} from '../../../Config/Functions';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import PickerSearch from '../../../components/Picker/PickerSearch'; import PickerSearch from '../../../components/Picker/PickerSearch';
import AppText from '../../../components/AppText';
const BonusTeam = (props) => { const BonusTeam = (props) => {
return ( return (
...@@ -15,15 +16,14 @@ const BonusTeam = (props) => { ...@@ -15,15 +16,14 @@ const BonusTeam = (props) => {
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
}}> }}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: getFontXD(52), fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
{/* <PickerSearch {/* <PickerSearch
findData={() => { findData={() => {
console.log('Call api'); console.log('Call api');
......
...@@ -2,22 +2,7 @@ import React from 'react'; ...@@ -2,22 +2,7 @@ import React from 'react';
import {View, FlatList, Text} from 'react-native'; import {View, FlatList, Text} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import Item from './Item'; import Item from './Item';
import AppText from '../../../components/AppText';
const data = [
{
id: '1',
time: '20/02/2021',
money: 5000000,
content: 'Mua kim loại ở sàn CBOT',
},
{
id: '2',
time: '20/02/2021',
money: 8000000,
content:
'Nhà đầu tư vẫn thu được lợi nhuận ngay cả khi thị trường đi xuống do có thể bán trước',
},
];
const Payments = (props) => { const Payments = (props) => {
return ( return (
...@@ -25,14 +10,14 @@ const Payments = (props) => { ...@@ -25,14 +10,14 @@ const Payments = (props) => {
<HeaderBack isWhite={false} title={'Payments'} /> <HeaderBack isWhite={false} title={'Payments'} />
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}> <View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
</View> </View>
{/* <FlatList {/* <FlatList
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
......
...@@ -57,7 +57,10 @@ const GeneralInfor = (props) => { ...@@ -57,7 +57,10 @@ const GeneralInfor = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
......
...@@ -6,59 +6,6 @@ import TextMoney from '../../../components/Input/InputMoney'; ...@@ -6,59 +6,6 @@ import TextMoney from '../../../components/Input/InputMoney';
import {toPriceVnd, numberFormat} from '../../../Config/Functions'; import {toPriceVnd, numberFormat} from '../../../Config/Functions';
import {changeLanguage} from '../../../actions/language'; import {changeLanguage} from '../../../actions/language';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
const data = [
{
id: '1',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 10000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '2',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 2000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '3',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 3000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '4',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 4000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
{
id: '5',
month: 2,
day: '20',
name: 'Nạp tiền',
money: 9000000,
note: 'Ghi chú nap tiền để đầu tư',
status: 1,
date: '20/02/2021',
},
];
import AppText from '../../../components/AppText'; import AppText from '../../../components/AppText';
const Rose = (props) => { const Rose = (props) => {
...@@ -73,14 +20,14 @@ const Rose = (props) => { ...@@ -73,14 +20,14 @@ const Rose = (props) => {
<AppText i18nKey={'SetLanguage'}></AppText> <AppText i18nKey={'SetLanguage'}></AppText>
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}> <View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
</View> </View>
{/* <View style={{flex: 1}}> {/* <View style={{flex: 1}}>
<FlatList <FlatList
......
...@@ -48,10 +48,7 @@ const AddMethodPay = (props) => { ...@@ -48,10 +48,7 @@ const AddMethodPay = (props) => {
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setData(res.data.data); setData(res.data.data);
} else { } else {
Alert.alert( Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
I18n.t('Notification'),
'Không lấy được danh sách ngân hàng!',
);
} }
}; };
...@@ -89,7 +86,10 @@ const AddMethodPay = (props) => { ...@@ -89,7 +86,10 @@ const AddMethodPay = (props) => {
}, 500); }, 500);
} }
} else { } else {
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
......
...@@ -3,6 +3,7 @@ import React, {useState, useEffect} from 'react'; ...@@ -3,6 +3,7 @@ import React, {useState, useEffect} from 'react';
import MethodPayView from './MethodPayView'; import MethodPayView from './MethodPayView';
import {getListWidthDraw} from '../../apis/Functions/Widthdraw'; import {getListWidthDraw} from '../../apis/Functions/Widthdraw';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import I18n from '../../helper/i18/i18n';
const MethodPay = (props) => { const MethodPay = (props) => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
...@@ -25,7 +26,7 @@ const MethodPay = (props) => { ...@@ -25,7 +26,7 @@ const MethodPay = (props) => {
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setData(res.data.data); setData(res.data.data);
} else { } else {
alert('Không lấy được danh sách phương thức thanh toán!'); Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
} }
}; };
......
...@@ -73,7 +73,10 @@ const MethodPayDetail = (props) => { ...@@ -73,7 +73,10 @@ const MethodPayDetail = (props) => {
Alert.alert(I18n.t('Notification'), 'Không có gì thay đổi'); Alert.alert(I18n.t('Notification'), 'Không có gì thay đổi');
} }
} else } else
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]); Alert.alert(
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
}; };
const onRemove = async () => { const onRemove = async () => {
......
...@@ -10,12 +10,10 @@ import { ...@@ -10,12 +10,10 @@ import {
import {getFontXD, HEIGHTXD, WIDTHXD, toPriceVnd} from '../../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD, toPriceVnd} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import Block from '../../components/Block'; import Block from '../../components/Block';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
const Item = (props) => { const Item = (props) => {
const {item} = props; const {item} = props;
return ( return (
<TouchableOpacity onPress={() => Alert.alert('Hello')}>
<View style={styles.container}> <View style={styles.container}>
<Block flex={1} row> <Block flex={1} row>
<View style={styles.wrapLeft} /> <View style={styles.wrapLeft} />
...@@ -25,14 +23,13 @@ const Item = (props) => { ...@@ -25,14 +23,13 @@ const Item = (props) => {
<Block padding={[5, 10]} space={'between'} flex={1}> <Block padding={[5, 10]} space={'between'} flex={1}>
<View style={{justifyContent: 'center', flex: 1}}> <View style={{justifyContent: 'center', flex: 1}}>
<Text numberOfLines={2} style={styles.txtBlack}> <Text numberOfLines={2} style={styles.txtBlack}>
Np tin thành công vi s lượng: 750.000 {item.body}
</Text> </Text>
</View> </View>
<Text style={styles.txt}>10:52 09/04/2021</Text> <Text style={styles.txt}>{item.pushed_at}</Text>
</Block> </Block>
</Block> </Block>
</View> </View>
</TouchableOpacity>
); );
}; };
......
...@@ -18,40 +18,6 @@ import create_payment_link from './setup'; ...@@ -18,40 +18,6 @@ import create_payment_link from './setup';
const Payment = (props) => { const Payment = (props) => {
const [text, setText] = useState('OpenSDK'); const [text, setText] = useState('OpenSDK');
// console.log('Link create payment');
// useEffect(() => {
// // mở sdk
// eventEmitter.addListener('PaymentBack', (e) => {
// console.log('Sdk back!');
// // Đã available trên cả ios, android
// if (e) {
// switch (e.resultCode) {
// case 0:
// console.log('Sdk closed');
// break;
// case -1:
// console.log('Người dùng nhấn back từ sdk để quay lại');
// break;
// case 10: //ios
// console.log(
// 'Người dùng nhấn chọn thanh toán qua app thanh toán (Mobile Banking, Ví...)',
// );
// break;
// case 99:
// console.log(
// 'Người dùng nhấn back từ trang thanh toán thành công khi thanh toán qua thẻ khi gọi đến http://sdk.merchantbackapp',
// );
// }
// }
// });
// return () => {
// // khi tắt sdk
// eventEmitter.removeAllListeners('PaymentBack');
// };
// }, []);
return ( return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<TouchableOpacity <TouchableOpacity
......
import React from 'react'; import React from 'react';
import {View, Text} from 'react-native'; import {View, Text} from 'react-native';
import AppText from '../../components/AppText';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
...@@ -14,14 +15,14 @@ const ServiceCustomerView = (props) => { ...@@ -14,14 +15,14 @@ const ServiceCustomerView = (props) => {
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
}}> }}>
<Text <AppText
i18nKey={'Features_develop'}
style={{ style={{
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}}> }}
Tính năng đang được phát trin, vui lòng quay li sau! />
</Text>
</View> </View>
</View> </View>
); );
......
import React, {useState} from 'react'; import React, {useEffect, useState} from 'react';
import {View, Text, Switch, StyleSheet} from 'react-native'; import {View, Text, Switch, StyleSheet} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import Block from '../../components/Block';
import {getFontXD} from '../../Config/Functions'; import {getFontXD} from '../../Config/Functions';
import PickerItem from '../../components/Picker/PickerItem'; import PickerItem from '../../components/Picker/PickerItem';
import AppText from '../../components/AppText';
const dataTest = [ import {changeLanguage} from '../../actions/language';
import {connect} from 'react-redux';
import AsyncStorage from '@react-native-community/async-storage';
import KEY from '../../assets/AsynStorage';
const dataLanguage = [
{ {
value: '1', value: 'vi',
name: 'Vietnamese', name: 'Vietnamese',
}, },
{ {
value: '2', value: 'en',
name: 'English', name: 'English',
}, },
]; ];
...@@ -19,12 +22,21 @@ const dataTest = [ ...@@ -19,12 +22,21 @@ const dataTest = [
const SettingView = (props) => { const SettingView = (props) => {
const [isEnabled, setIsEnabled] = useState(true); const [isEnabled, setIsEnabled] = useState(true);
const toggleSwitch = () => setIsEnabled((previousState) => !previousState); const toggleSwitch = () => setIsEnabled((previousState) => !previousState);
const [language, setLanguage] = useState(dataTest[0].name); const [language, setLanguage] = useState();
useEffect(() => {
convertLanguage();
}, []);
const convertLanguage = () => {
const temp = dataLanguage.filter((e) => e.value == props.language.language);
setLanguage(temp[0].name);
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Setting'} /> <HeaderBack title={'Setting'} />
<View style={{flex: 1, padding: 10}}> <View style={{flex: 1, padding: 10}}>
<View style={styles.row}> {/* <View style={styles.row}>
<Text style={styles.txtTitle}>Bật thông báo</Text> <Text style={styles.txtTitle}>Bật thông báo</Text>
<Switch <Switch
trackColor={{false: '#DBDBDB', true: '#1C6AF6'}} trackColor={{false: '#DBDBDB', true: '#1C6AF6'}}
...@@ -33,28 +45,27 @@ const SettingView = (props) => { ...@@ -33,28 +45,27 @@ const SettingView = (props) => {
onValueChange={toggleSwitch} onValueChange={toggleSwitch}
value={isEnabled} value={isEnabled}
/> />
</View> </View> */}
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtTitle}>Ngôn ng</Text> <AppText i18nKey={'Language'} style={styles.txtTitle} />
<PickerItem <PickerItem
defaultValue={language}
width={200} width={200}
defaultValue={language}
value={language} value={language}
data={dataTest} data={dataLanguage}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setLanguage(items.name); setLanguage(items.name);
props.changeLanguage(items.value);
AsyncStorage.setItem(KEY.LANGUAGE, items.value);
}} }}
/> />
</View> </View>
</View> </View>
<Text>SettingView 1 screen</Text>
</View> </View>
); );
}; };
export default SettingView;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
txtTitle: { txtTitle: {
fontSize: getFontXD(46), fontSize: getFontXD(46),
...@@ -68,3 +79,11 @@ const styles = StyleSheet.create({ ...@@ -68,3 +79,11 @@ const styles = StyleSheet.create({
marginBottom: 20, marginBottom: 20,
}, },
}); });
const mapStateToProps = (state) => {
return {
language: state.languageReducer,
};
};
export default connect(mapStateToProps, {changeLanguage})(SettingView);
...@@ -2,6 +2,7 @@ const KEY = { ...@@ -2,6 +2,7 @@ const KEY = {
TOKEN: '@TOKEN', TOKEN: '@TOKEN',
FIREBASE: '@Firebase', FIREBASE: '@Firebase',
ACCOUNT: '@ACCOUNT', ACCOUNT: '@ACCOUNT',
LANGUAGE: '@LANGUAGE',
}; };
export default KEY; export default KEY;
...@@ -19,7 +19,7 @@ const InputIcon = (props) => { ...@@ -19,7 +19,7 @@ const InputIcon = (props) => {
<View style={container}> <View style={container}>
<Image source={icon} style={iconImg} /> <Image source={icon} style={iconImg} />
<View style={wrapRight}> <View style={wrapRight}>
<AppText i18nKey={title}> </AppText> <AppText i18nKey={title} />
<TextInput <TextInput
maxLength={maxLength} maxLength={maxLength}
autoCapitalize="none" autoCapitalize="none"
......
...@@ -3,13 +3,13 @@ import {View, Text, StyleSheet, TouchableOpacity} from 'react-native'; ...@@ -3,13 +3,13 @@ import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
import NetInfo from '@react-native-community/netinfo'; import NetInfo from '@react-native-community/netinfo';
import FastImage from 'react-native-fast-image'; import FastImage from 'react-native-fast-image';
import R from '../assets/R'; import R from '../assets/R';
import AppText from '../components/AppText';
const NoInternetComponent = (props) => { const NoInternetComponent = (props) => {
const [isConnected, setConnect] = useState(true); const [isConnected, setConnect] = useState(true);
useEffect(() => { useEffect(() => {
const unsubscribe = NetInfo.addEventListener((state) => { const unsubscribe = NetInfo.addEventListener((state) => {
console.log(state);
setConnect(state.isConnected); setConnect(state.isConnected);
}); });
return unsubscribe; return unsubscribe;
...@@ -21,8 +21,8 @@ const NoInternetComponent = (props) => { ...@@ -21,8 +21,8 @@ const NoInternetComponent = (props) => {
source={R.images.bg_cannot_connect} source={R.images.bg_cannot_connect}
style={styles.imageStyle} style={styles.imageStyle}
/> />
<Text style={styles.textStyle}>Không có kết nt Internet</Text> <AppText i18nKey={'No_Internet'} style={styles.textStyle} />
<Text style={styles.subTextStyle}>Kim tra li đường truyn!</Text> <AppText i18nKey={'Check_Internet_Connect'} style={styles.subTextStyle} />
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
setTimeout(() => { setTimeout(() => {
...@@ -31,7 +31,10 @@ const NoInternetComponent = (props) => { ...@@ -31,7 +31,10 @@ const NoInternetComponent = (props) => {
}); });
}, 3000); }, 3000);
}}> }}>
<Text style={{alignSelf: 'center', color: 'blue'}}>Th li</Text> <AppText
i18nKey={'Retry'}
style={{alignSelf: 'center', fontSize: 20, color: 'blue'}}
/>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
) : ( ) : (
......
...@@ -13,6 +13,7 @@ import Icon from 'react-native-vector-icons/AntDesign'; ...@@ -13,6 +13,7 @@ import Icon from 'react-native-vector-icons/AntDesign';
import Modal from 'react-native-modal'; import Modal from 'react-native-modal';
import Block from '../Block'; import Block from '../Block';
import ImagePicker from 'react-native-image-crop-picker'; import ImagePicker from 'react-native-image-crop-picker';
import AppText from '../AppText';
const options = { const options = {
title: 'Select Avatar', title: 'Select Avatar',
customButtons: [{name: 'fb', title: 'Choose Photo from Facebook'}], customButtons: [{name: 'fb', title: 'Choose Photo from Facebook'}],
...@@ -73,29 +74,29 @@ const PickerImg = (props) => { ...@@ -73,29 +74,29 @@ const PickerImg = (props) => {
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
<View style={styles.containerSelect}> <View style={styles.containerSelect}>
<Text <AppText
i18nKey={'Select_source_image'}
style={{ style={{
textAlign: 'center', textAlign: 'center',
fontSize: getFontXD(42), fontSize: getFontXD(42),
fontWeight: 'bold', fontWeight: 'bold',
color: '#1473E6', color: '#1473E6',
}}> }}
Chn ngun ly nh />
</Text>
<View style={styles.line} /> <View style={styles.line} />
<Block row space={'around'} center> <Block row space={'around'} center>
<TouchableOpacity style={styles.selectionImg} onPress={onCapture}> <TouchableOpacity style={styles.selectionImg} onPress={onCapture}>
<Image style={styles.imgIcon} source={R.images.iconCamera} /> <Image style={styles.imgIcon} source={R.images.iconCamera} />
<Text style={styles.txtTitleBtn}>Chp nh</Text> <AppText i18nKey={'Take_photo'} style={styles.txtTitleBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
style={styles.selectionImg} style={styles.selectionImg}
onPress={onchoosGalery}> onPress={onchoosGalery}>
<Image style={styles.imgIcon} source={R.images.iconImg} /> <Image style={styles.imgIcon} source={R.images.iconImg} />
<Text style={styles.txtTitleBtn}>Thư vin nh</Text> <AppText i18nKey={'Photo_library'} style={styles.txtTitleBtn} />
</TouchableOpacity> </TouchableOpacity>
</Block> </Block>
</View> </View>
......
...@@ -20,6 +20,8 @@ import Icon from 'react-native-vector-icons/AntDesign'; ...@@ -20,6 +20,8 @@ import Icon from 'react-native-vector-icons/AntDesign';
import Modal from 'react-native-modal'; import Modal from 'react-native-modal';
import Block from '../Block'; import Block from '../Block';
import ImagePicker from 'react-native-image-crop-picker'; import ImagePicker from 'react-native-image-crop-picker';
import AppText from '../AppText';
const options = { const options = {
title: 'Select Avatar', title: 'Select Avatar',
customButtons: [{name: 'fb', title: 'Choose Photo from Facebook'}], customButtons: [{name: 'fb', title: 'Choose Photo from Facebook'}],
...@@ -98,29 +100,29 @@ const PickerImgUni = (props) => { ...@@ -98,29 +100,29 @@ const PickerImgUni = (props) => {
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
<View style={styles.containerSelect}> <View style={styles.containerSelect}>
<Text <AppText
i18nKey={'Select_source_image'}
style={{ style={{
textAlign: 'center', textAlign: 'center',
fontSize: getFontXD(42), fontSize: getFontXD(42),
fontWeight: 'bold', fontWeight: 'bold',
color: '#1473E6', color: '#1473E6',
}}> }}
Chn ngun ly nh />
</Text>
<View style={styles.line} /> <View style={styles.line} />
<Block row space={'around'} center> <Block row space={'around'} center>
<TouchableOpacity style={styles.selectionImg} onPress={onCapture}> <TouchableOpacity style={styles.selectionImg} onPress={onCapture}>
<Image style={styles.imgIcon} source={R.images.iconCamera} /> <Image style={styles.imgIcon} source={R.images.iconCamera} />
<Text style={styles.txtTitleBtn}>Chp nh</Text> <AppText i18nKey={'Take_photo'} style={styles.txtTitleBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
style={styles.selectionImg} style={styles.selectionImg}
onPress={onchoosGalery}> onPress={onchoosGalery}>
<Image style={styles.imgIcon} source={R.images.iconImg} /> <Image style={styles.imgIcon} source={R.images.iconImg} />
<Text style={styles.txtTitleBtn}>Thư vin nh</Text> <AppText i18nKey={'Photo_library'} style={styles.txtTitleBtn} />
</TouchableOpacity> </TouchableOpacity>
</Block> </Block>
</View> </View>
......
...@@ -15,7 +15,7 @@ import Modal from 'react-native-modal'; ...@@ -15,7 +15,7 @@ import Modal from 'react-native-modal';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showNotificaton, hideNotification} from '../actions/SnackBarAction'; import {showNotificaton, hideNotification} from '../actions/SnackBarAction';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import AppText from '../components/AppText';
const SnackBar = (props) => { const SnackBar = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const {isOpen, title, content, screen, id_record} = props.snackReducer; const {isOpen, title, content, screen, id_record} = props.snackReducer;
...@@ -47,7 +47,7 @@ const SnackBar = (props) => { ...@@ -47,7 +47,7 @@ const SnackBar = (props) => {
<TouchableOpacity <TouchableOpacity
onPress={() => props.hideNotification()} onPress={() => props.hideNotification()}
style={styles.btn}> style={styles.btn}>
<Text style={styles.txtBtn}>Đóng</Text> <AppText i18nKey={'Close'} style={styles.txtBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
...@@ -55,7 +55,7 @@ const SnackBar = (props) => { ...@@ -55,7 +55,7 @@ const SnackBar = (props) => {
navigate.navigate(screen, {id: id_record}); navigate.navigate(screen, {id: id_record});
}} }}
style={[styles.btn, {marginLeft: 20}]}> style={[styles.btn, {marginLeft: 20}]}>
<Text style={styles.txtBtn}>Chi tiết</Text> <AppText i18nKey={'Detail'} style={styles.txtBtn} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
......
...@@ -72,6 +72,41 @@ export default { ...@@ -72,6 +72,41 @@ export default {
PartnershipAgreement: 'Partnership agreement', PartnershipAgreement: 'Partnership agreement',
Waiting: 'Waiting', Waiting: 'Waiting',
Success: 'Success', Success: 'Success',
OK: 'Ok', Ok: 'Ok',
Can_not_get_data: "Can't get data", Can_not_get_data: "Can't get data",
Cancel: 'Cancel',
Close: 'Close',
Detail: 'Detail',
No_Internet: 'No internet',
Check_Internet_Connect: 'Check internet connect',
Retry: 'Retry',
Select_source_image: 'Select the source of the image',
Photo_library: 'Photo library',
Take_photo: 'Take a photo',
EnableCQG: 'Enable CQG',
Request_Open_Account_CQG: 'Request open account CQG',
Waiting_for_Progress: 'Waiting for progress',
PopupVerifyAccount:
'Your account is not verified. Go to account verification?',
PopupOpenCQG: 'Would you like to open a CQG account to make investments?',
Free: 'Free',
Open_account: 'Open account',
Provisional: 'Provisional',
Here: 'Here',
Open_account_demo: 'You can open a demo account',
Features_develop: 'Features are under development, please come back later!',
Language: 'Language',
Email: 'Email',
Password: 'Password',
Login: 'Login',
Register: 'Register',
Confirm_pass: 'Confirm password',
Code_introduce: 'Code introduce',
Account_already: 'Do you already have an account?',
Have_account: 'Do not have an account?',
Verify_code: 'Verification codes:',
Continue: 'Continue',
Re_send: 'Re send',
Copied: 'Copied!',
Please_fill_in: 'Please fill in ',
}; };
...@@ -4,6 +4,7 @@ export default { ...@@ -4,6 +4,7 @@ export default {
contact: 'Liên hệ', contact: 'Liên hệ',
setting: 'Cài đặt', setting: 'Cài đặt',
SetLanguage: 'Chọn ngôn ngữ', SetLanguage: 'Chọn ngôn ngữ',
Language: 'Ngôn ngữ',
MyProfile: 'Thông tin cá nhân', MyProfile: 'Thông tin cá nhân',
VerifyAccount: 'Xác thực tài khoản', VerifyAccount: 'Xác thực tài khoản',
Payments: 'Các khoản thanh toán', Payments: 'Các khoản thanh toán',
...@@ -72,7 +73,41 @@ export default { ...@@ -72,7 +73,41 @@ export default {
PartnershipAgreement: 'Thoả thuận quan hệ đối tác', PartnershipAgreement: 'Thoả thuận quan hệ đối tác',
Waiting: 'Đang chờ', Waiting: 'Đang chờ',
Success: 'Thành công', Success: 'Thành công',
Can_not_get_data: 'Không lấy được dữ liệu!', Can_not_get_data: 'Không lấy được dữ liệu!',
Cancel: 'Huỷ', Cancel: 'Huỷ',
Close: 'Đóng',
Detail: 'Chit tiết',
No_Internet: 'Không có kết nốt Internet',
Check_Internet_Connect: 'Kiểm tra lại đường truyền',
Retry: 'Thử lại',
Select_source_image: 'Chọn nguồn lấy ảnh',
Ok: 'Đồng ý',
Photo_library: 'Thư viện ảnh',
Take_photo: 'Chụp ảnh',
EnableCQG: 'Có tài khoản CQG',
Request_Open_Account_CQG: 'Yêu cầu mở TK CQG',
Waiting_for_Progress: 'Chờ xử lý',
Free: 'Miễn phí',
PopupVerifyAccount:
'Tài khoản của bạn chưa được xác minh.Tiến hành xác minh tài khoản?',
PopupOpenCQG: 'Bạn có muốn đăng mở tài khoản CQG để tiến hành đầu tư?',
Open_account: 'Mở tài khoản',
Provisional: 'Tạm tính',
Here: 'Tại đây',
Open_account_demo: 'Bạn có thể mở tài khoản thử',
Features_develop: 'Tính năng đang được phát triển, vui lòng quay lại sau!',
Email: 'Email',
Password: 'Mật khẩu',
Login: 'Đăng nhập',
Register: 'Đăng ký',
Confirm_pass: 'Nhập lại mật khẩu',
Code_introduce: 'Mã giới thiệu',
Account_already: 'Bạn đã có tài khoản?',
Have_account: 'Bạn chưa có tài khoản?',
Verify_code: 'Mã xác thực:',
Continue: 'Tiếp tục',
Re_send: 'Gửi lại',
Copied: 'Đã sao chép!',
Please_fill_in: 'Vui lòng điền ',
}; };
...@@ -17,6 +17,10 @@ import Test from '../Screens/NewFeed/Test'; ...@@ -17,6 +17,10 @@ import Test from '../Screens/NewFeed/Test';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {AccountVerification, PACKETCQG} from '../routers/ScreenNames'; import {AccountVerification, PACKETCQG} from '../routers/ScreenNames';
import I18n from '../helper/i18/i18n'; import I18n from '../helper/i18/i18n';
import {changeLanguage} from '../actions/language';
import KEY from '../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage';
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const PayScreenComponent = () => { const PayScreenComponent = () => {
...@@ -26,6 +30,7 @@ const PayScreenComponent = () => { ...@@ -26,6 +30,7 @@ const PayScreenComponent = () => {
const TabNavigator = (props) => { const TabNavigator = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
useEffect(() => { useEffect(() => {
setInitLanguage();
setTimeout(() => { setTimeout(() => {
showPopUp(); showPopUp();
}, 3000); }, 3000);
...@@ -38,26 +43,24 @@ const TabNavigator = (props) => { ...@@ -38,26 +43,24 @@ const TabNavigator = (props) => {
const checkScreenInit = () => { const checkScreenInit = () => {
if (props.screenInit.screen) { if (props.screenInit.screen) {
const {screen, id} = props.screenInit; const {screen, id} = props.screenInit;
console.log(screen, id);
navigate.navigate(screen, {id: id}); navigate.navigate(screen, {id: id});
} }
}; };
const setInitLanguage = async () => {
const laguage = await AsyncStorage.getItem(KEY.LANGUAGE);
if (laguage) props.changeLanguage(laguage);
};
const showPopUp = () => { const showPopUp = () => {
if (props.user.status == 1) { if (props.user.status == 1) {
return confirmAlert( return confirmAlert(I18n.t('PopupVerifyAccount'), () => {
'Tài khoản của bạn chưa được xác minh.Tiến hành xác minh tài khoản?',
() => {
navigate.navigate(AccountVerification); navigate.navigate(AccountVerification);
}, });
);
} else if (props.user.status == 3 && !props.user.contract_code) { } else if (props.user.status == 3 && !props.user.contract_code) {
return confirmAlert( return confirmAlert(I18n.t('PopupOpenCQG'), () => {
'Bạn có muốn đăng mở tài khoản CQG để tiến hành đầu tư?',
() => {
navigate.navigate(PACKETCQG); navigate.navigate(PACKETCQG);
}, });
);
} }
}; };
return ( return (
...@@ -132,4 +135,4 @@ const mapStateToProps = (state) => { ...@@ -132,4 +135,4 @@ const mapStateToProps = (state) => {
}; };
}; };
export default connect(mapStateToProps, {})(TabNavigator); export default connect(mapStateToProps, {changeLanguage})(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