Connected current user with notification. Log codes removed

This commit is contained in:
mistikk 2018-11-16 14:42:46 +01:00
parent 5e0de16efb
commit 65350b4788
2 changed files with 9 additions and 4 deletions

View File

@ -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);

View File

@ -20,7 +20,6 @@ class NotificationScreen extends PureComponent {
render() {
const { notifications, getActivities } = this.props;
console.log('notifications :', notifications);
return (
<Fragment>
<Header />