Merge pull request #224 from esteemapp/apple/request

added login button to notf
This commit is contained in:
Feruz M 2018-12-11 23:08:15 +02:00 committed by GitHub
commit d76ea01ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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({