Added Complete Registration stepper component, all stepper logic

This commit is contained in:
Alexander Wong
2017-09-03 21:47:18 -06:00
parent e69773ac8e
commit 561664a701
9 changed files with 251 additions and 18 deletions
+13 -1
View File
@@ -3,9 +3,18 @@ import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { Dropdown, Menu } from "semantic-ui-react";
import { sendGetSelfUserRequest } from "../actions/user/saga.actions";
import { sendLogoutRequest } from "../actions/auth/saga.actions";
class Navbar extends Component {
componentWillMount() {
const { dispatch, userToken, selfUser } = this.props;
// If the user token exists and the self user object isn't loaded, dispatch
if (userToken && Object.keys(selfUser).length === 0) {
dispatch(sendGetSelfUserRequest());
}
}
dispatchLogoutRequest = () => {
this.props.dispatch(sendLogoutRequest());
};
@@ -22,7 +31,10 @@ class Navbar extends Component {
}
function mapStateToProps(state) {
return { ...state.auth };
return {
userToken: state.auth.userToken,
selfUser: state.user.selfUser
};
}
const NavbarView = ({ isAuthenticated, dispatchLogoutRequest }) => (