Commit 1d08f5bb by Giang Tran

update code

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