From 65350b4788815fecf4b876bbd41e96e3c421f628 Mon Sep 17 00:00:00 2001 From: mistikk Date: Fri, 16 Nov 2018 14:42:46 +0100 Subject: [PATCH] Connected current user with notification. Log codes removed --- .../notification/container/notificationContainer.js | 12 +++++++++--- .../notification/screen/notificationScreen.js | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/screens/notification/container/notificationContainer.js b/src/screens/notification/container/notificationContainer.js index 2acd5c508..d85b7be59 100644 --- a/src/screens/notification/container/notificationContainer.js +++ b/src/screens/notification/container/notificationContainer.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import { connect } from 'react-redux'; // Actions and Services import { getActivities } from '../../../providers/esteem/esteem'; @@ -19,8 +20,9 @@ class NotificationContainer extends Component { } _getAvtivities = (type = null) => { - getActivities({ user: 'mistikk', type }).then((res) => { - console.log('res :', res); + const { username } = this.props; + + getActivities({ user: username, type }).then((res) => { this.setState({ notifications: res }); }); }; @@ -38,4 +40,8 @@ class NotificationContainer extends Component { } } -export default NotificationContainer; +const mapStateToProps = state => ({ + username: state.account.currentAccount.name, +}); + +export default connect(mapStateToProps)(NotificationContainer); diff --git a/src/screens/notification/screen/notificationScreen.js b/src/screens/notification/screen/notificationScreen.js index b9d65c6f0..6cae37fe2 100644 --- a/src/screens/notification/screen/notificationScreen.js +++ b/src/screens/notification/screen/notificationScreen.js @@ -20,7 +20,6 @@ class NotificationScreen extends PureComponent { render() { const { notifications, getActivities } = this.props; - console.log('notifications :', notifications); return (