import Menu from "@material-ui/core/Menu/Menu";
import MenuItem from "@material-ui/core/MenuItem/MenuItem";
import { AccountCircle } from "@material-ui/icons";
-import { AnyAction } from "redux";
+import { User } from "../../models/user";
const drawerWidth = 240;
interface WorkbenchDataProps {
projects: Project[];
+ user: User;
}
interface WorkbenchActionProps {
}
login = () => {
- this.props.dispatch(authActions.LOGIN() as AnyAction);
+ this.props.dispatch(authActions.LOGIN());
};
logout = () => {
this.handleClose();
- this.props.dispatch(authActions.LOGOUT() as AnyAction);
+ this.props.dispatch(authActions.LOGOUT());
};
handleOpenMenu = (event: React.MouseEvent<any>) => {
</Typography>
{userLoggedIn ?
<div>
+ <Typography variant="title" color="inherit" noWrap>
+ {this.props.user.firstName} {this.props.user.lastName}
+ </Typography>
<IconButton
aria-owns={this.state.anchorEl ? 'menu-appbar' : undefined}
aria-haspopup="true"
export default connect<WorkbenchDataProps>(
(state: RootState) => ({
- projects: state.projects
+ projects: state.projects,
+ user: state.auth.user!
})
)(
withStyles(styles)(Workbench)