Added worktype menu option, usertype check, deletion confirmation, redirect

This commit is contained in:
Alexander Wong
2017-09-21 20:39:58 -06:00
parent 0ae0a92187
commit 0486a7fe64
8 changed files with 184 additions and 109 deletions
+7 -2
View File
@@ -20,11 +20,12 @@ class Navbar extends Component {
};
render() {
const { userToken } = this.props;
const { userToken, selfUser } = this.props;
return (
<NavbarView
isAuthenticated={!!userToken}
dispatchLogoutRequest={this.dispatchLogoutRequest}
selfUser={selfUser}
/>
);
}
@@ -37,7 +38,7 @@ function mapStateToProps(state) {
};
}
const NavbarView = ({ isAuthenticated, dispatchLogoutRequest }) => (
const NavbarView = ({ isAuthenticated, dispatchLogoutRequest, selfUser }) => (
<Menu>
<Menu.Item as={Link} to="/">
Caremyway
@@ -61,6 +62,10 @@ const NavbarView = ({ isAuthenticated, dispatchLogoutRequest }) => (
<Dropdown.Item as={Link} to="/user/profile">
My Profile
</Dropdown.Item>
{selfUser.client &&
<Dropdown.Item as={Link} to="/user/profile/client/worktypes">
Work Types
</Dropdown.Item>}
<Dropdown.Item as={Link} to="/auth/settings">
Settings
</Dropdown.Item>