Commit 5f7757cd by Giang Tran

edit notification

parent 06b2c5be
...@@ -132,8 +132,8 @@ android { ...@@ -132,8 +132,8 @@ android {
applicationId "com.dcv.invest" applicationId "com.dcv.invest"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 16 versionCode 18
versionName "2.0" versionName "2.2"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
splits { splits {
......
...@@ -34,7 +34,7 @@ export const decryptRSAString = (val) => { ...@@ -34,7 +34,7 @@ export const decryptRSAString = (val) => {
}; };
export const logout = (navigation) => { export const logout = (navigation) => {
AsyncStorage.multiRemove([KEY.ACCOUNT, KEY.FIREBASE, KEY.TOKEN]) AsyncStorage.multiRemove([KEY.ACCOUNT, KEY.FIREBASE, KEY.TOKEN]);
navigation.reset({ navigation.reset({
index: 1, index: 1,
routes: [{name: AUTHEN}], routes: [{name: AUTHEN}],
...@@ -65,6 +65,7 @@ export const convertScreen = (name) => { ...@@ -65,6 +65,7 @@ export const convertScreen = (name) => {
case 'CUSTOMER_NEWS': case 'CUSTOMER_NEWS':
return DETAILNEW; return DETAILNEW;
case 'CUSTOMER_NOTIFICATION': case 'CUSTOMER_NOTIFICATION':
case 'CUSTOMER_VERIFIED':
return TABNAVIGATOR; return TABNAVIGATOR;
default: default:
return DETAILNEW; return DETAILNEW;
......
...@@ -50,6 +50,7 @@ const HeaderHome = (props) => { ...@@ -50,6 +50,7 @@ const HeaderHome = (props) => {
start={{x: 0, y: 0}} start={{x: 0, y: 0}}
end={{x: 0, y: 1}} end={{x: 0, y: 1}}
colors={['#0062E1', '#22AEFB']}> colors={['#0062E1', '#22AEFB']}>
<SnackBar />
<StatusBar barStyle="light-content" translucent={true} /> <StatusBar barStyle="light-content" translucent={true} />
<View style={styles.container}> <View style={styles.container}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
......
...@@ -29,6 +29,7 @@ const HeaderHome = (props) => { ...@@ -29,6 +29,7 @@ const HeaderHome = (props) => {
imageStyle={{resizeMode: 'stretch'}} imageStyle={{resizeMode: 'stretch'}}
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]} style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}> source={R.images.bgHeader}>
<SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} /> <StatusBar backgroundColor="transparent" translucent={true} />
<View style={styles.headerContainer}> <View style={styles.headerContainer}>
<TouchableOpacity <TouchableOpacity
......
...@@ -22,7 +22,6 @@ import SnackBar from '../SnackBar'; ...@@ -22,7 +22,6 @@ import SnackBar from '../SnackBar';
import AppText from '../AppText'; import AppText from '../AppText';
import Icon from 'react-native-vector-icons/Ionicons'; import Icon from 'react-native-vector-icons/Ionicons';
const HeaderDrawer = (props) => { const HeaderDrawer = (props) => {
const {title, isWhite} = props; const {title, isWhite} = props;
const [isModalVisible, setModalVisible] = useState(false); const [isModalVisible, setModalVisible] = useState(false);
...@@ -36,23 +35,24 @@ const HeaderDrawer = (props) => { ...@@ -36,23 +35,24 @@ const HeaderDrawer = (props) => {
imageStyle={{resizeMode: 'stretch'}} imageStyle={{resizeMode: 'stretch'}}
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]} style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}> source={R.images.bgHeader}>
<StatusBar backgroundColor="transparent" translucent={true}/> <SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} />
<View style={styles.headerContainer}> <View style={styles.headerContainer}>
<TouchableOpacity style={{width: 35, height: 30}} onPress={toggleModal}> <TouchableOpacity style={{width: 35, height: 30}} onPress={toggleModal}>
<Image source={R.images.iconMenu} style={styles.imgIcon}/> <Image source={R.images.iconMenu} style={styles.imgIcon} />
</TouchableOpacity> </TouchableOpacity>
<AppText i18nKey={title} style={styles.txtTitle}></AppText> <AppText i18nKey={title} style={styles.txtTitle}></AppText>
{props.isShowSearch ? {props.isShowSearch ? (
<TouchableOpacity style={{width: 35, height: 35}} onPress={props.onSearchPress}> <TouchableOpacity
<Icon style={{width: 35, height: 35}}
name={'search-sharp'} onPress={props.onSearchPress}>
size={25} <Icon name={'search-sharp'} size={25} color={R.colors.white} />
color={R.colors.white}
/>
</TouchableOpacity> </TouchableOpacity>
: <View style={{width: 35, height: 30}}/>} ) : (
<View style={{width: 35, height: 30}} />
)}
</View> </View>
<Modal <Modal
animationIn={'fadeInLeft'} animationIn={'fadeInLeft'}
...@@ -66,7 +66,7 @@ const HeaderDrawer = (props) => { ...@@ -66,7 +66,7 @@ const HeaderDrawer = (props) => {
Platform.OS == 'ios' ? {paddingVertical: 15} : {}, Platform.OS == 'ios' ? {paddingVertical: 15} : {},
]}> ]}>
<View style={styles.container}> <View style={styles.container}>
<Drawer toggleModal={toggleModal}/> <Drawer toggleModal={toggleModal} />
</View> </View>
<TouchableWithoutFeedback onPress={toggleModal}> <TouchableWithoutFeedback onPress={toggleModal}>
<View <View
......
...@@ -240,6 +240,7 @@ const HeaderHome = (props) => { ...@@ -240,6 +240,7 @@ const HeaderHome = (props) => {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<StatusBar backgroundColor="transparent" translucent={true} /> <StatusBar backgroundColor="transparent" translucent={true} />
<SnackBar />
<View <View
style={{ style={{
justifyContent: 'center', justifyContent: 'center',
......
...@@ -40,6 +40,7 @@ const HeaderSearch = (props) => { ...@@ -40,6 +40,7 @@ const HeaderSearch = (props) => {
imageStyle={{resizeMode: 'stretch'}} imageStyle={{resizeMode: 'stretch'}}
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]} style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}> source={R.images.bgHeader}>
<SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} /> <StatusBar backgroundColor="transparent" translucent={true} />
<View style={styles.headerContainer}> <View style={styles.headerContainer}>
<TouchableOpacity <TouchableOpacity
......
...@@ -43,6 +43,7 @@ const HeaderSearch = (props) => { ...@@ -43,6 +43,7 @@ const HeaderSearch = (props) => {
imageStyle={{resizeMode: 'stretch'}} imageStyle={{resizeMode: 'stretch'}}
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]} style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}> source={R.images.bgHeader}>
<SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} /> <StatusBar backgroundColor="transparent" translucent={true} />
<View style={styles.headerContainer}> <View style={styles.headerContainer}>
<TouchableOpacity onPress={toggleModal}> <TouchableOpacity onPress={toggleModal}>
......
...@@ -38,15 +38,14 @@ const FirebaseNotification = (props) => { ...@@ -38,15 +38,14 @@ const FirebaseNotification = (props) => {
const unsubscribe = messaging().onMessage(async (remoteMessage) => { const unsubscribe = messaging().onMessage(async (remoteMessage) => {
console.log('A new FCM message arrived!', remoteMessage.data); console.log('A new FCM message arrived!', remoteMessage.data);
const {action_type, body, title, record_id} = remoteMessage.data; const {action_type, body, title, record_id} = remoteMessage.data;
if (action_type != 'CUSTOMER_NEWS') refetchDataUser();
props.showNotificaton({ props.showNotificaton({
title, title,
content: body, content: body,
screen: convertScreen(action_type), screen: convertScreen(action_type),
id_record: record_id, id_record: record_id,
}); });
if (action_type != 'CUSTOMER_NEWS') refetchDataUser();
}); });
// (async () => await messaging().registerDeviceForRemoteMessages())(); // (async () => await messaging().registerDeviceForRemoteMessages())();
......
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