feat: Style the dashboard topbar actions and user dropdown.

This commit is contained in:
Ahmed Bouhuolia
2020-06-02 19:47:38 +02:00
parent b8eb84d896
commit 79e1752331
12 changed files with 137 additions and 65 deletions

View File

@@ -1,11 +1,13 @@
import { isAuthenticated } from 'store/authentication/authentication.reducer'
import { connect } from 'react-redux';
const mapStateToProps = (state) => {
return {
isAuthorized: isAuthenticated(state),
export default (mapState) => {
const mapStateToProps = (state, props) => {
const mapped = {
isAuthorized: isAuthenticated(state),
user: state.authentication.user,
};
return mapState ? mapState(mapped, state, props) : mapped;
};
};
export default connect(mapStateToProps);
return connect(mapStateToProps);
};

View File

@@ -7,10 +7,11 @@ import {
inviteMetaByToken,
} from 'store/authentication/authentication.actions';
import { connect } from 'react-redux';
import t from 'store/types';
const mapDispatchToProps = (dispatch) => ({
requestLogin: (form) => dispatch(login({ form })),
requestLogout: () => dispatch({ type: t.LOGOUT }),
requestRegister: (form) => dispatch(register({ form })),
requestSendResetPassword: (email) => dispatch(sendResetPassword({ email })),
requestResetPassword: (form, token) => dispatch(resetPassword({ form, token })),