Commit 1d08f5bb by Giang Tran

update code

parent 38e610cd
......@@ -905,7 +905,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/InvestDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -914,7 +914,7 @@
);
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.3.1;
MARKETING_VERSION = 2.3.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -939,11 +939,11 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.3.1;
MARKETING_VERSION = 2.3.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......
......@@ -12,7 +12,12 @@ import _ from 'lodash';
import I18n from '../helper/i18/i18n';
import AppText from '../components/AppText';
import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW, TABNAVIGATOR, AUTHEN} from '../routers/ScreenNames';
import {
DETAILNEW,
TABNAVIGATOR,
AUTHEN,
REJECTWEB,
} from '../routers/ScreenNames';
import R from '../assets/R';
import {isTablet} from 'react-native-device-info';
import {RSA_KEY, MY_RSA_KEY} from './constants';
......@@ -68,6 +73,13 @@ export const convertScreen = (name) => {
case 'CUSTOMER_VERIFIED':
case 'SYNC_WHEN_CUSTOMER_VERIFIED':
return TABNAVIGATOR;
case 'SYNC_WHEN_CUSTOMER_VERIFIED':
return TABNAVIGATOR;
case 'SYNC_WHEN_CUSTOMER_VERIFIED':
return TABNAVIGATOR;
case 'REDIRECT':
return REJECTWEB;
default:
return DETAILNEW;
}
......
......@@ -6,6 +6,7 @@ const initialState = {
title: '',
content: '',
id_record: '',
link: null,
};
// @ts-ignore
......
......@@ -21,7 +21,9 @@ const Media = (props) => {
platform: Platform.OS,
});
if (res.data.code == 200 && res.data.data) {
if (res.data.data[0] && res.data.data[0].data[0]) setMediaHot([]);
if (res.data.data[0] && res.data.data[0].data[0]) {
setMediaHot(res.data.data[0].data[0]);
}
setData(res.data.data);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), I18n.t('Can_not_get_data'));
......
......@@ -47,12 +47,18 @@ const MediaView = (props) => {
</Text>
</TouchableOpacity>
<Block row space={'between'} padding={[10, 10]}>
<View style={{flexDirection: 'row'}}>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingHorizontal: 10,
}}>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<Icon
name={'calendar'}
color={R.colors.white}
size={getFontXD(46)}
size={getFontXD(42)}
/>
<Text style={styles.txtDate}>{published_at}</Text>
</View>
......@@ -68,7 +74,7 @@ const MediaView = (props) => {
/>
<Text style={styles.txtPlay}>Xem video</Text>
</TouchableOpacity>
</Block>
</View>
</View>
</LinearGradient>
</ImageBackground>
......@@ -85,10 +91,11 @@ const styles = StyleSheet.create({
},
contentTop: {
padding: 10,
flex: 1,
height: HEIGHTXD(260),
width: '100%',
},
txtBig: {
fontSize: getFontXD(52),
fontSize: getFontXD(42),
color: R.colors.white,
fontWeight: 'bold',
textDecorationLine: 'underline',
......
......@@ -6,6 +6,7 @@ import {
TouchableOpacity,
StatusBar,
TouchableWithoutFeedback,
Linking,
} from 'react-native';
import R from '../assets/R';
import Block from './Block';
......@@ -18,7 +19,7 @@ import {useNavigation} from '@react-navigation/native';
import AppText from '../components/AppText';
const SnackBar = (props) => {
const navigate = useNavigation();
const {isOpen, title, content, screen, id_record} = props.snackReducer;
const {isOpen, title, content, screen, id_record, link} = props.snackReducer;
useEffect(() => {
if (isOpen)
......@@ -53,8 +54,12 @@ const SnackBar = (props) => {
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
if (link != null) {
Linking.openURL(link);
} else {
props.hideNotification();
navigate.navigate(screen, {id: id_record});
}
}}
style={[styles.btn, {marginLeft: 20}]}>
<AppText i18nKey={'Detail'} style={styles.txtBtn} />
......
/* eslint-disable no-console */
import React, {useEffect} from 'react';
import {Platform, View, Alert} from 'react-native';
import {Platform, View, Alert, Linking} from 'react-native';
import messaging from '@react-native-firebase/messaging';
import AsyncStorage from '@react-native-community/async-storage';
import KEY from '../assets/AsynStorage';
......@@ -43,6 +43,7 @@ const FirebaseNotification = (props) => {
content: body,
screen: convertScreen(action_type),
id_record: record_id,
link: remoteMessage.data?.redirect_to,
});
if (action_type != 'CUSTOMER_NEWS') refetchDataUser();
......@@ -55,10 +56,14 @@ const FirebaseNotification = (props) => {
remoteMessage,
);
const {action_type, body, title, record_id} = remoteMessage.data;
if (action_type == 'REDIRECT') {
Linking.openURL(remoteMessage.data.redirect_to);
} else {
props.newScreenInit({
screen: convertScreen(action_type),
id_record: record_id,
});
}
});
messaging()
.getInitialNotification()
......@@ -70,11 +75,15 @@ const FirebaseNotification = (props) => {
remoteMessage.data,
);
const {action_type, body, title, record_id} = remoteMessage.data;
if (action_type == 'REDIRECT') {
Linking.openURL(remoteMessage.data.redirect_to);
} else {
props.newScreenInit({
screen: convertScreen(action_type),
id_record: record_id,
});
}
}
});
return unsubscribe;
......
......@@ -95,3 +95,5 @@ export const RULESSMARTOTP = 'RULESSMARTOTP';
export const FAQSSMARTOTP = 'FAQSSMARTOTP';
export const CONFIRMCREATEOTP = 'CONFIRMCREATEOTP';
export const REJECTWEB = 'REJECTWEB';
......@@ -132,7 +132,8 @@ const TabNavigator = (props) => {
name="Screen1"
component={Home}
options={{
tabBarLabel: 'Overview',
tabBarLabel:
props.language.language == 'vi' ? 'Trang chủ' : 'Overview',
tabBarIcon: ({color, size}) => (
<Icon name="landmark" size={size} color={color} />
),
......
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