Commit f66f2670 by Giang Tran

edit logout

parent 350fc230
......@@ -10,6 +10,7 @@ import moment from 'moment';
import _ from 'lodash';
import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames';
import R from '../assets/R';
export const convertScreen = (name) => {
switch (name) {
......@@ -68,6 +69,28 @@ export const renderStatus = (status) => {
Đã xác minh
</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:
return (
<Text
......
......@@ -25,6 +25,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import {showLoading, hideLoading} from '../../actions/loadingAction';
import {saveUserToRedux} from '../../actions/users';
import {connect} from 'react-redux';
import messaging from '@react-native-firebase/messaging';
const Login = (props) => {
const {navigation} = props;
......@@ -34,8 +35,20 @@ const Login = (props) => {
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(() => {
getAccount();
getTokenDevice();
}, []);
const getAccount = async () => {
......@@ -51,8 +64,8 @@ const Login = (props) => {
const index = checkFormatArray([email, pass]);
if (index === true) {
props.showLoading();
firebase = await AsyncStorage.getItem(KEY.FIREBASE);
props.showLoading();
const res = await loginApi({
email,
password: pass,
......
......@@ -62,11 +62,7 @@ const Rose = (props) => {
return (
<View style={{flex: 1}}>
<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}}>
<Text
style={{
......
......@@ -77,7 +77,7 @@ const renderWallet = (status, current_money, current_cqg_money, contract) => {
</View>
</View>
);
if (status == 3 && !contract)
if (status == 3)
return (
<View style={{flex: 1, flexDirection: 'row'}}>
<View style={styles.containerWallet}>
......
......@@ -17,6 +17,9 @@ const FirebaseNotification = (props) => {
messaging().onNotificationOpenedApp(async (remoteMessage) => {
console.log('On notifi open app-----', remoteMessage);
});
useEffect(() => {
getFcmToken();
}, []);
useEffect(() => {
requestUserPermission();
......@@ -74,10 +77,10 @@ const FirebaseNotification = (props) => {
}
};
const getFcmToken = async () => {
console.log('Chay vao day');
let fcmToken = await AsyncStorage.getItem(KEY.FIREBASE);
console.log(fcmToken);
console.log('fcmToken save', fcmToken);
if (!fcmToken) {
console.log(fcmToken);
fcmToken = await messaging().getToken();
if (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