Commit 456d9095 by Giang Tran

update code

parent bf68a2f6
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
} from 'react-native'; } from 'react-native';
import moment from 'moment'; import moment from 'moment';
import _ from 'lodash'; import _ from 'lodash';
import I18n from '../helper/i18/i18n';
import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames'; import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames';
import R from '../assets/R'; import R from '../assets/R';
...@@ -106,12 +107,12 @@ export const renderStatus = (status) => { ...@@ -106,12 +107,12 @@ export const renderStatus = (status) => {
}; };
export const NotificationAlert = (string) => { export const NotificationAlert = (string) => {
Alert.alert('Thông báo', string); Alert.alert(I18n.t('Notification'), string);
}; };
export const confirmAlert = (title, callback) => { export const confirmAlert = (title, callback) => {
Alert.alert( Alert.alert(
'Thông báo', I18n.t('Notification'),
title, title,
[ [
{ {
......
...@@ -61,12 +61,12 @@ const PacketCQG = (props) => { ...@@ -61,12 +61,12 @@ const PacketCQG = (props) => {
console.log(res); console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
}; };
...@@ -130,7 +130,7 @@ const PacketCQG = (props) => { ...@@ -130,7 +130,7 @@ const PacketCQG = (props) => {
setFeeNonPro(res.data.data.fee_pro); setFeeNonPro(res.data.data.fee_pro);
setFeePro(res.data.data.fee_non_pro); setFeePro(res.data.data.fee_non_pro);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
}; };
......
...@@ -24,6 +24,7 @@ import {verifyAccountApi} from '../../../apis/Functions/users'; ...@@ -24,6 +24,7 @@ import {verifyAccountApi} from '../../../apis/Functions/users';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction'; import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import I18n from '../../../helper/i18/i18n';
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
const dataType = [ const dataType = [
...@@ -102,18 +103,18 @@ const BankInfor = (props) => { ...@@ -102,18 +103,18 @@ const BankInfor = (props) => {
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
setBackNo(''); setBackNo('');
setAccountNo(''); setAccountNo('');
setAccType(''); setAccType('');
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -19,6 +19,7 @@ import TextField from '../../../components/Input/TextField'; ...@@ -19,6 +19,7 @@ import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; 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 I18n from '../../../helper/i18/i18n';
import {checkFormatArray, convertTime} from '../../../Config/Functions'; import {checkFormatArray, convertTime} from '../../../Config/Functions';
...@@ -40,7 +41,7 @@ const GeneralInfor = (props) => { ...@@ -40,7 +41,7 @@ const GeneralInfor = (props) => {
address, address,
}); });
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -28,6 +28,7 @@ import {verifyAccountApi} from '../../../apis/Functions/users'; ...@@ -28,6 +28,7 @@ import {verifyAccountApi} from '../../../apis/Functions/users';
import PickerDate from '../../../components/Picker/PickerDate'; import PickerDate from '../../../components/Picker/PickerDate';
import PickerItem from '../../../components/Picker/PickerItem'; import PickerItem from '../../../components/Picker/PickerItem';
import {saveUserToRedux} from '../../../actions/users'; import {saveUserToRedux} from '../../../actions/users';
import I18n from '../../../helper/i18/i18n';
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
...@@ -109,16 +110,16 @@ const Profile = (props) => { ...@@ -109,16 +110,16 @@ const Profile = (props) => {
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
props.saveUserToRedux(res.data.data); props.saveUserToRedux(res.data.data);
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
props.navigation.popToTop(); props.navigation.popToTop();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -2,6 +2,7 @@ import React, {useState, useEffect} from 'react'; ...@@ -2,6 +2,7 @@ import React, {useState, useEffect} from 'react';
import {Alert} from 'react-native'; import {Alert} from 'react-native';
import HistoryView from './HistoryView'; import HistoryView from './HistoryView';
import {getListTransaction} from '../../../apis/Functions/Widthdraw'; import {getListTransaction} from '../../../apis/Functions/Widthdraw';
import I18n from '../../../helper/i18/i18n';
const History = (props) => { const History = (props) => {
const [selected, setSelected] = useState('ALL'); const [selected, setSelected] = useState('ALL');
...@@ -38,7 +39,7 @@ const History = (props) => { ...@@ -38,7 +39,7 @@ const History = (props) => {
setTotalPage(res.data.meta.pages); setTotalPage(res.data.meta.pages);
console.log(res.data.data); console.log(res.data.data);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
}; };
......
...@@ -4,6 +4,7 @@ import HeaderBack from '../../../../components/Header/HeaderBack'; ...@@ -4,6 +4,7 @@ import HeaderBack from '../../../../components/Header/HeaderBack';
import Item from './Item'; import Item from './Item';
import {getListTransaction} from '../../../../apis/Functions/Widthdraw'; import {getListTransaction} from '../../../../apis/Functions/Widthdraw';
import AppText from '../../../../components/AppText'; import AppText from '../../../../components/AppText';
import I18n from '../../../../helper/i18/i18n';
const Success = (props) => { const Success = (props) => {
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
...@@ -34,7 +35,7 @@ const Success = (props) => { ...@@ -34,7 +35,7 @@ const Success = (props) => {
setData(res.data.data); setData(res.data.data);
setTotalPage(res.data.meta.pages); setTotalPage(res.data.meta.pages);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
}; };
......
...@@ -5,6 +5,9 @@ import Item from './Item'; ...@@ -5,6 +5,9 @@ import Item from './Item';
import {getListTransaction} from '../../../../apis/Functions/Widthdraw'; import {getListTransaction} from '../../../../apis/Functions/Widthdraw';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import AppText from '../../../../components/AppText'; import AppText from '../../../../components/AppText';
import I18n from '../../../../helper/i18/i18n';
const Watting = (props) => { const Watting = (props) => {
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
const [data, setData] = useState([]); const [data, setData] = useState([]);
...@@ -39,7 +42,7 @@ const Watting = (props) => { ...@@ -39,7 +42,7 @@ const Watting = (props) => {
setData(res.data.data); setData(res.data.data);
setTotalPage(res.data.meta.pages); setTotalPage(res.data.meta.pages);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
}; };
......
...@@ -42,16 +42,12 @@ const Wallet = (props) => { ...@@ -42,16 +42,12 @@ const Wallet = (props) => {
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(WALLETDEPOSIT)} onPress={() => navigate.navigate(WALLETDEPOSIT)}
style={styles.btnLeft}> style={styles.btnLeft}>
<AppText i18nKey={'Deposit'} style={styles.txtTitle}> <AppText i18nKey={'Deposit'} style={styles.txtTitle}></AppText>
Np tin
</AppText>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(WALLETWITHDRAW)} onPress={() => navigate.navigate(WALLETWITHDRAW)}
style={styles.btnRight}> style={styles.btnRight}>
<AppText i18nKey={'Withdraw'} style={styles.txtTitle}> <AppText i18nKey={'Withdraw'} style={styles.txtTitle}></AppText>
Rút tin
</AppText>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
); );
......
...@@ -22,6 +22,8 @@ import {connect} from 'react-redux'; ...@@ -22,6 +22,8 @@ import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction'; import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {walletDeposit} from '../../../apis/Functions/Deposit'; import {walletDeposit} from '../../../apis/Functions/Deposit';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import I18n from '../../../helper/i18/i18n';
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
const WalletDeposit = (props) => { const WalletDeposit = (props) => {
...@@ -45,16 +47,16 @@ const WalletDeposit = (props) => { ...@@ -45,16 +47,16 @@ const WalletDeposit = (props) => {
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
return ( return (
......
...@@ -31,7 +31,7 @@ import {showLoading, hideLoading} from '../../../actions/loadingAction'; ...@@ -31,7 +31,7 @@ import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {confirmAlert} from '../../../components/Aleart'; import {confirmAlert} from '../../../components/Aleart';
import {ADDMETHODPAY} from '../../../routers/ScreenNames'; import {ADDMETHODPAY} from '../../../routers/ScreenNames';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import I18n from '../../../helper/i18/i18n';
var radio_props = [ var radio_props = [
{label: 'Từ ví', value: 'WALLET'}, {label: 'Từ ví', value: 'WALLET'},
{label: 'Từ tài khoản CQG', value: 'INVESTMENT'}, {label: 'Từ tài khoản CQG', value: 'INVESTMENT'},
...@@ -72,7 +72,10 @@ const WalletWithdraw = (props) => { ...@@ -72,7 +72,10 @@ const WalletWithdraw = (props) => {
setData(newList); setData(newList);
} }
} else { } else {
alert('Không lấy được danh sách phương thức!'); Alert.alert(
I18n.t('Notification'),
'Không lấy được danh sách phương thức!',
);
} }
}; };
...@@ -96,16 +99,16 @@ const WalletWithdraw = (props) => { ...@@ -96,16 +99,16 @@ const WalletWithdraw = (props) => {
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -16,6 +16,7 @@ import {useNavigation} from '@react-navigation/native'; ...@@ -16,6 +16,7 @@ import {useNavigation} from '@react-navigation/native';
import {CONFIRMOTP} from '../../routers/ScreenNames'; import {CONFIRMOTP} from '../../routers/ScreenNames';
import {getOTPApi} from '../../apis/Functions/users'; import {getOTPApi} from '../../apis/Functions/users';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import I18n from '../../helper/i18/i18n';
const ConfirmEmail = (props) => { const ConfirmEmail = (props) => {
const [value, setValue] = useState(''); const [value, setValue] = useState('');
...@@ -35,11 +36,11 @@ const ConfirmEmail = (props) => { ...@@ -35,11 +36,11 @@ const ConfirmEmail = (props) => {
navigate.navigate(CONFIRMOTP, {email: value}); navigate.navigate(CONFIRMOTP, {email: value});
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Thông báo', 'Vui lòng nhập email!'); Alert.alert(I18n.t('Notification'), 'Vui lòng nhập email!');
} }
}; };
......
...@@ -21,6 +21,7 @@ import R from '../../assets/R'; ...@@ -21,6 +21,7 @@ import R from '../../assets/R';
import {NEWPASSWORD} from '../../routers/ScreenNames'; 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 {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
...@@ -40,9 +41,9 @@ const ConfirmOTP = (propsa) => { ...@@ -40,9 +41,9 @@ const ConfirmOTP = (propsa) => {
const confirm = async () => { const confirm = async () => {
if (!value) { if (!value) {
Alert.alert('Thông báo', 'Vui long nhập mã OTP'); Alert.alert(I18n.t('Notification'), 'Vui long nhập mã OTP');
} else if (value.length != 4) { } else if (value.length != 4) {
Alert.alert('Thông báo', 'Mã OTP không đúng định dạng'); Alert.alert(I18n.t('Notification'), 'Mã OTP không đúng định dạng');
} else { } else {
propsa.showLoading(); propsa.showLoading();
const res = await verifyOTPApi({ const res = await verifyOTPApi({
...@@ -59,7 +60,7 @@ const ConfirmOTP = (propsa) => { ...@@ -59,7 +60,7 @@ const ConfirmOTP = (propsa) => {
email: propsa.route.params.email, email: propsa.route.params.email,
}); });
} else { } else {
Alert.alert('Thông báo', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
} }
}; };
......
...@@ -26,6 +26,7 @@ import {showLoading, hideLoading} from '../../actions/loadingAction'; ...@@ -26,6 +26,7 @@ import {showLoading, hideLoading} from '../../actions/loadingAction';
import {saveUserToRedux} from '../../actions/users'; 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';
const Login = (props) => { const Login = (props) => {
const {navigation} = props; const {navigation} = props;
...@@ -86,11 +87,11 @@ const Login = (props) => { ...@@ -86,11 +87,11 @@ const Login = (props) => {
}); });
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Thông báo', 'Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -14,6 +14,7 @@ import {checkFormatArray} from '../../Config/Functions'; ...@@ -14,6 +14,7 @@ import {checkFormatArray} from '../../Config/Functions';
import {showLoading, hideLoading} from '../../actions/loadingAction'; 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';
const Registor = (props) => { const Registor = (props) => {
const {navigation} = props; const {navigation} = props;
...@@ -51,16 +52,16 @@ const Registor = (props) => { ...@@ -51,16 +52,16 @@ const Registor = (props) => {
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo', 'Đăng ký tài khoản thành công!'); Alert.alert(I18n.t('Notification'), 'Đăng ký tài khoản thành công!');
navigation.navigate('LOGIN'); navigation.navigate('LOGIN');
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Thông báo!', 'Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -2,6 +2,7 @@ import React, {useEffect, useState} from 'react'; ...@@ -2,6 +2,7 @@ import React, {useEffect, useState} from 'react';
import {View, Alert} from 'react-native'; import {View, Alert} from 'react-native';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {getTransaction} from '../../apis/Functions/users'; import {getTransaction} from '../../apis/Functions/users';
import I18n from '../../helper/i18/i18n';
import HomeView from './HomeView'; import HomeView from './HomeView';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
...@@ -19,7 +20,7 @@ const Home = (props) => { ...@@ -19,7 +20,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('Thông báo!', 'Không lấy được thông tin!'); Alert.alert(I18n.t('Notification'), 'Không lấy được thông tin!');
} }
}; };
......
...@@ -17,6 +17,7 @@ import LinearGradient from 'react-native-linear-gradient'; ...@@ -17,6 +17,7 @@ import LinearGradient from 'react-native-linear-gradient';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {HEIGHTXD, toPriceVnd} from '../../Config/Functions'; import {HEIGHTXD, toPriceVnd} from '../../Config/Functions';
import Clipboard from '@react-native-clipboard/clipboard'; import Clipboard from '@react-native-clipboard/clipboard';
import I18n from '../../helper/i18/i18n';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import { import {
...@@ -33,7 +34,7 @@ const HeaderHome = (props) => { ...@@ -33,7 +34,7 @@ const HeaderHome = (props) => {
const [sponsorID, setSponsorID] = useState('sponsorIDlink'); const [sponsorID, setSponsorID] = useState('sponsorIDlink');
const copyToClipboard = () => { const copyToClipboard = () => {
Alert.alert('Đã sao chép!'); Alert.alert(I18n.t('Notification'), 'Đã sao chép!');
Clipboard.setString(sponsorID); Clipboard.setString(sponsorID);
}; };
......
...@@ -48,16 +48,16 @@ const GeneralInfor = (props) => { ...@@ -48,16 +48,16 @@ const GeneralInfor = (props) => {
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
props.saveUserToRedux(res.data.data); props.saveUserToRedux(res.data.data);
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
props.navigation.popToTop(); props.navigation.popToTop();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Thông báo!', 'Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -24,6 +24,7 @@ import PickerItem from '../../components/Picker/PickerItem'; ...@@ -24,6 +24,7 @@ import PickerItem from '../../components/Picker/PickerItem';
import {getListBank, addMethodBank} from '../../apis/Functions/Widthdraw'; import {getListBank, addMethodBank} from '../../apis/Functions/Widthdraw';
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 I18n from '../../helper/i18/i18n';
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
...@@ -47,7 +48,10 @@ const AddMethodPay = (props) => { ...@@ -47,7 +48,10 @@ 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('Không lấy được danh sách ngân hàng!'); Alert.alert(
I18n.t('Notification'),
'Không lấy được danh sách ngân hàng!',
);
} }
}; };
...@@ -76,16 +80,16 @@ const AddMethodPay = (props) => { ...@@ -76,16 +80,16 @@ const AddMethodPay = (props) => {
props.hideLoading(); props.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
} }
}; };
......
...@@ -15,6 +15,7 @@ import { ...@@ -15,6 +15,7 @@ import {
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import R from '../../assets/R'; import R from '../../assets/R';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import I18n from '../../helper/i18/i18n';
import Item from './Item'; import Item from './Item';
import {getFontXD, WIDTHXD, checkFormatArray} from '../../Config/Functions'; import {getFontXD, WIDTHXD, checkFormatArray} from '../../Config/Functions';
...@@ -60,18 +61,19 @@ const MethodPayDetail = (props) => { ...@@ -60,18 +61,19 @@ const MethodPayDetail = (props) => {
props.hideLoading(); props.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
} else { } else {
Alert.alert('Thông báo!', 'Không có gì thay đổi'); Alert.alert(I18n.t('Notification'), 'Không có gì thay đổi');
} }
} else Alert.alert('Thông báo!', 'Vui lòng điền ' + titles[index]); } else
Alert.alert(I18n.t('Notification'), 'Vui lòng điền ' + titles[index]);
}; };
const onRemove = async () => { const onRemove = async () => {
...@@ -83,12 +85,12 @@ const MethodPayDetail = (props) => { ...@@ -83,12 +85,12 @@ const MethodPayDetail = (props) => {
props.hideLoading(); props.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
navigate.goBack(); navigate.goBack();
}, 500); }, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
}, 500); }, 500);
} }
}; };
......
...@@ -2,6 +2,7 @@ import React, {Component, useState, useEffect, useRef} from 'react'; ...@@ -2,6 +2,7 @@ import React, {Component, useState, useEffect, useRef} from 'react';
import {View, Text, Platform, FlatList} from 'react-native'; import {View, Text, Platform, FlatList} from 'react-native';
import {getListCalendar} from '../../../apis/Functions/NewFeed'; import {getListCalendar} from '../../../apis/Functions/NewFeed';
import {convertTimeApi} from '../../../Config/Functions'; import {convertTimeApi} from '../../../Config/Functions';
import I18n from '../../../helper/i18/i18n';
import Item from './item'; import Item from './item';
const NewFeed = (props) => { const NewFeed = (props) => {
...@@ -30,7 +31,7 @@ const NewFeed = (props) => { ...@@ -30,7 +31,7 @@ const NewFeed = (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('Thông báo', 'Không lấy được dữ liệu!'); Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
} }
}; };
......
import React, {Component, useEffect, useState} from 'react'; import React, {Component, useEffect, useState} from 'react';
import {View, Text, Platform, Alert} from 'react-native'; import {View, Text, Platform, Alert} from 'react-native';
import I18n from '../../../helper/i18/i18n';
import MediaView from './MediaView'; import MediaView from './MediaView';
import {getListMedia} from '../../../apis/Functions/NewFeed'; import {getListMedia} from '../../../apis/Functions/NewFeed';
...@@ -23,7 +24,7 @@ const Media = (props) => { ...@@ -23,7 +24,7 @@ const Media = (props) => {
setMediaHot(res.data.data[0].data[0]); setMediaHot(res.data.data[0].data[0]);
setData(res.data.data); setData(res.data.data);
} else { } else {
Alert.alert('Thông báo', 'Không lấy được dữ liệu!'); Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
} }
}; };
......
...@@ -15,6 +15,7 @@ import Icon from 'react-native-vector-icons/AntDesign'; ...@@ -15,6 +15,7 @@ import Icon from 'react-native-vector-icons/AntDesign';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {MEDIADETAIL} from '../../../routers/ScreenNames'; import {MEDIADETAIL} from '../../../routers/ScreenNames';
import {getDetailMedia} from '../../../apis/Functions/NewFeed'; import {getDetailMedia} from '../../../apis/Functions/NewFeed';
import I18n from '../../../helper/i18/i18n';
const Item = (props) => { const Item = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -62,7 +63,7 @@ const MediaDetail = (props) => { ...@@ -62,7 +63,7 @@ const MediaDetail = (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('Thông báo', 'Không lấy được dữ liệu!'); Alert.alert(I18n.t('Notification'), I18n.t('Can_not_get_data'));
} }
}; };
return ( return (
......
...@@ -13,6 +13,7 @@ import R from '../../../assets/R'; ...@@ -13,6 +13,7 @@ import R from '../../../assets/R';
import {getFontXD} from '../../../Config/Functions'; import {getFontXD} from '../../../Config/Functions';
import Item from './item'; import Item from './item';
import {getListNew, getListCategoryNew} from '../../../apis/Functions/NewFeed'; import {getListNew, getListCategoryNew} from '../../../apis/Functions/NewFeed';
import I18n from '../../../helper/i18/i18n';
const NewFeed = (props) => { const NewFeed = (props) => {
const [selected, setSelected] = useState(''); const [selected, setSelected] = useState('');
...@@ -33,7 +34,7 @@ const NewFeed = (props) => { ...@@ -33,7 +34,7 @@ const NewFeed = (props) => {
setFillters(res.data.data); setFillters(res.data.data);
console.log(res.data.data); console.log(res.data.data);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
}; };
...@@ -60,7 +61,7 @@ const NewFeed = (props) => { ...@@ -60,7 +61,7 @@ const NewFeed = (props) => {
setData(res.data.data); setData(res.data.data);
setTotalPage(res.data.meta.pages); setTotalPage(res.data.meta.pages);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
setisRefresh(false); setisRefresh(false);
}; };
......
import React, {useState, useEffect} from 'react'; import React, {useState, useEffect} from 'react';
import {getListNotification} from '../../apis/Functions/users'; import {getListNotification} from '../../apis/Functions/users';
import NotificationView from './NotificaitonView'; import NotificationView from './NotificaitonView';
import I18n from '../../helper/i18/i18n';
const Notifcation = (props) => { const Notifcation = (props) => {
const [selected, setSelected] = useState(''); const [selected, setSelected] = useState('');
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
...@@ -29,7 +29,7 @@ const Notifcation = (props) => { ...@@ -29,7 +29,7 @@ const Notifcation = (props) => {
setData(res.data.data); setData(res.data.data);
setTotalPage(res.data.meta.pages); setTotalPage(res.data.meta.pages);
} else { } else {
Alert.alert('Thông báo!', res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
} }
}; };
......
import {Alert} from 'react-native'; import {Alert} from 'react-native';
import I18n from '../helper/i18/i18n';
export const NotificationAlert = (string) => { export const NotificationAlert = (string) => {
Alert.alert('Thông báo', string); Alert.alert(I18n.t('Notification'), string);
}; };
export const confirmAlert = (content, callback) => { export const confirmAlert = (content, callback) => {
Alert.alert( Alert.alert(
'Thông báo', I18n.t('Notification'),
content, content,
[ [
{ {
text: 'Hủy', text: I18n.t('Cancel'),
style: 'cancel', style: 'cancel',
}, },
{ {
text: 'Đồng ý', text: I18n.t('Ok'),
onPress: () => { onPress: () => {
callback(); callback();
}, },
......
...@@ -158,7 +158,7 @@ const HeaderHome = (props) => { ...@@ -158,7 +158,7 @@ const HeaderHome = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const copyToClipboard = () => { const copyToClipboard = () => {
Alert.alert('Đã sao chép link giới thiệu!'); Alert.alert(I18n.t('Notification'), 'Đã sao chép link giới thiệu!');
Clipboard.setString(props.user.sponsor_url); Clipboard.setString(props.user.sponsor_url);
}; };
......
...@@ -62,7 +62,6 @@ export default { ...@@ -62,7 +62,6 @@ export default {
Phone: 'Phone', Phone: 'Phone',
Address: 'Address', Address: 'Address',
Update: 'Update', Update: 'Update',
ContactCode: 'Contact code', ContactCode: 'Contact code',
TraddingAccountName: 'Tradding account name', TraddingAccountName: 'Tradding account name',
TraddingAccountNumber: 'Tradding account number', TraddingAccountNumber: 'Tradding account number',
...@@ -71,7 +70,8 @@ export default { ...@@ -71,7 +70,8 @@ export default {
CustomerAgreement: 'Customer agreement', CustomerAgreement: 'Customer agreement',
BusinessAgreement: 'Business agreement', BusinessAgreement: 'Business agreement',
PartnershipAgreement: 'Partnership agreement', PartnershipAgreement: 'Partnership agreement',
Waiting: 'Waiting', Waiting: 'Waiting',
Success: 'Success', Success: 'Success',
OK: 'Ok',
Can_not_get_data: "Can't get data",
}; };
...@@ -70,4 +70,9 @@ export default { ...@@ -70,4 +70,9 @@ export default {
CustomerAgreement: 'Thoả thuận khách hàng', CustomerAgreement: 'Thoả thuận khách hàng',
BusinessAgreement: 'Thoả thuận kinh doanh chung', BusinessAgreement: 'Thoả thuận kinh doanh chung',
PartnershipAgreement: 'Thoả thuận quan hệ đối tác', PartnershipAgreement: 'Thoả thuận quan hệ đối tác',
Waiting: 'Đang chờ',
Success: 'Thành công',
Can_not_get_data: 'Không lấy được dữ liệu!',
Cancel: 'Huỷ',
}; };
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