Commit 5f7757cd by Giang Tran

edit notification

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