Commit f66f2670 by Giang Tran

edit logout

parent 350fc230
...@@ -10,6 +10,7 @@ import moment from 'moment'; ...@@ -10,6 +10,7 @@ import moment from 'moment';
import _ from 'lodash'; import _ from 'lodash';
import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames'; import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames';
import R from '../assets/R';
export const convertScreen = (name) => { export const convertScreen = (name) => {
switch (name) { switch (name) {
...@@ -68,6 +69,28 @@ export const renderStatus = (status) => { ...@@ -68,6 +69,28 @@ export const renderStatus = (status) => {
Đã xác minh Đã xác minh
</Text> </Text>
); );
case 5:
return (
<Text
style={{
color: '#F99D1D',
fontWeight: 'bold',
fontSize: getFontXD(42),
}}>
Yêu cu m TK CQG
</Text>
);
case 6:
return (
<Text
style={{
color: R.colors.main,
fontWeight: 'bold',
fontSize: getFontXD(42),
}}>
Có tài khon CQG
</Text>
);
default: default:
return ( return (
<Text <Text
......
...@@ -25,6 +25,7 @@ import AsyncStorage from '@react-native-community/async-storage'; ...@@ -25,6 +25,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import {showLoading, hideLoading} from '../../actions/loadingAction'; 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';
const Login = (props) => { const Login = (props) => {
const {navigation} = props; const {navigation} = props;
...@@ -34,8 +35,20 @@ const Login = (props) => { ...@@ -34,8 +35,20 @@ const Login = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const getTokenDevice = async () => {
let fcmToken = await AsyncStorage.getItem(KEY.FIREBASE);
if (!fcmToken) {
fcmToken = await messaging().getToken();
if (fcmToken) {
AsyncStorage.setItem(KEY.FIREBASE, fcmToken);
}
}
};
useEffect(() => { useEffect(() => {
getAccount(); getAccount();
getTokenDevice();
}, []); }, []);
const getAccount = async () => { const getAccount = async () => {
...@@ -51,8 +64,8 @@ const Login = (props) => { ...@@ -51,8 +64,8 @@ const Login = (props) => {
const index = checkFormatArray([email, pass]); const index = checkFormatArray([email, pass]);
if (index === true) { if (index === true) {
props.showLoading();
firebase = await AsyncStorage.getItem(KEY.FIREBASE); firebase = await AsyncStorage.getItem(KEY.FIREBASE);
props.showLoading();
const res = await loginApi({ const res = await loginApi({
email, email,
password: pass, password: pass,
......
...@@ -62,11 +62,7 @@ const Rose = (props) => { ...@@ -62,11 +62,7 @@ const Rose = (props) => {
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderSB title={'Hoa hồng'} /> <HeaderSB title={'Hoa hồng'} />
<TextMoney
value={toPriceVnd(text)}
style={{width: 100}}
onChangeText={(val) => setText(val.split(',').join(''))}
/>
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}> <View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Text <Text
style={{ style={{
......
...@@ -77,7 +77,7 @@ const renderWallet = (status, current_money, current_cqg_money, contract) => { ...@@ -77,7 +77,7 @@ const renderWallet = (status, current_money, current_cqg_money, contract) => {
</View> </View>
</View> </View>
); );
if (status == 3 && !contract) if (status == 3)
return ( return (
<View style={{flex: 1, flexDirection: 'row'}}> <View style={{flex: 1, flexDirection: 'row'}}>
<View style={styles.containerWallet}> <View style={styles.containerWallet}>
......
...@@ -17,6 +17,9 @@ const FirebaseNotification = (props) => { ...@@ -17,6 +17,9 @@ const FirebaseNotification = (props) => {
messaging().onNotificationOpenedApp(async (remoteMessage) => { messaging().onNotificationOpenedApp(async (remoteMessage) => {
console.log('On notifi open app-----', remoteMessage); console.log('On notifi open app-----', remoteMessage);
}); });
useEffect(() => {
getFcmToken();
}, []);
useEffect(() => { useEffect(() => {
requestUserPermission(); requestUserPermission();
...@@ -74,10 +77,10 @@ const FirebaseNotification = (props) => { ...@@ -74,10 +77,10 @@ const FirebaseNotification = (props) => {
} }
}; };
const getFcmToken = async () => { const getFcmToken = async () => {
console.log('Chay vao day');
let fcmToken = await AsyncStorage.getItem(KEY.FIREBASE); let fcmToken = await AsyncStorage.getItem(KEY.FIREBASE);
console.log(fcmToken); console.log('fcmToken save', fcmToken);
if (!fcmToken) { if (!fcmToken) {
console.log(fcmToken);
fcmToken = await messaging().getToken(); fcmToken = await messaging().getToken();
if (fcmToken) { if (fcmToken) {
AsyncStorage.setItem(KEY.FIREBASE, fcmToken); AsyncStorage.setItem(KEY.FIREBASE, fcmToken);
......
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