added login button to notf

This commit is contained in:
ue 2018-12-12 00:07:02 +03:00
parent bbdd6297ce
commit a5edfa472e
2 changed files with 26 additions and 6 deletions

View File

@ -72,6 +72,12 @@ class NotificationContainer extends Component {
});
};
_handleOnPressLogin = () => {
const { navigation } = this.props;
navigation.navigate(ROUTES.SCREENS.LOGIN);
};
render() {
const { notifications } = this.state;
@ -81,6 +87,7 @@ class NotificationContainer extends Component {
notifications={notifications}
navigateToNotificationRoute={this._navigateToNotificationRoute}
readAllNotification={this._readAllNotification}
handleLoginPress={this._handleOnPressLogin}
{...this.props}
/>
);
@ -89,6 +96,7 @@ class NotificationContainer extends Component {
const mapStateToProps = state => ({
username: state.account.currentAccount.name,
isLoggedIn: state.application.isLoggedIn,
activeBottomTab: state.ui.activeBottomTab,
});

View File

@ -28,6 +28,8 @@ class NotificationScreen extends PureComponent {
intl,
navigateToNotificationRoute,
readAllNotification,
handleLoginPress,
isLoggedIn,
} = this.props;
return (
<View style={styles.container}>
@ -44,12 +46,22 @@ class NotificationScreen extends PureComponent {
})}
style={styles.notificationTab}
>
<Notification
getActivities={getActivities}
notifications={notifications}
navigateToNotificationRoute={navigateToNotificationRoute}
readAllNotification={readAllNotification}
/>
{isLoggedIn ? (
<Notification
getActivities={getActivities}
notifications={notifications}
navigateToNotificationRoute={navigateToNotificationRoute}
readAllNotification={readAllNotification}
/>
) : (
<NoPost
isButtonText
defaultText={intl.formatMessage({
id: 'profile.login_to_see',
})}
handleOnButtonPress={handleLoginPress}
/>
)}
</View>
<View
tabLabel={intl.formatMessage({