Use more selectors

This commit is contained in:
Chi Vinh Le
2018-02-13 16:00:03 +01:00
parent c140a62822
commit 0f69df26f6
6 changed files with 16 additions and 11 deletions
@@ -2,9 +2,10 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { logout } from 'plugin-api/beta/client/actions/auth';
import UserBox from '../components/UserBox';
import { usernameSelector } from 'plugin-api/beta/client/selectors/auth';
const mapStateToProps = ({ auth }) => ({
user: auth.user,
const mapStateToProps = state => ({
username: usernameSelector(state),
});
const mapDispatchToProps = dispatch => bindActionCreators({ logout }, dispatch);