Skip to content
Snippets Groups Projects
Commit 600010d7 authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Removed title and added logout

Change-Id: I0114c15a358c2bcb6ed6ce2d4089e3f3942a6ada
parent c3164fe8
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ const headerStyle = () => ({
borderBottom: "0",
marginBottom: "0",
position: "absolute",
width: "100%",
width: "50%",
paddingTop: "10px",
zIndex: "1029",
color: grayColor[7],
......
......@@ -23,7 +23,7 @@ const appStyle = theme => ({
overflowScrolling: "touch"
},
content: {
marginTop: "70px",
marginTop: "0px",
padding: "30px 15px",
minHeight: "calc(100vh - 123px)"
},
......
......@@ -46,10 +46,6 @@ export default function AdminNavbarLinks(props) {
setOpenProfile(event.currentTarget);
}
};
const handleCloseProfile = () => {
setOpenProfile(null);
auth.logout(() => { history.push("/") })
};
const handleOtherAction = () => {
// Do nothing
......@@ -214,12 +210,6 @@ export default function AdminNavbarLinks(props) {
Settings
</MenuItem>
<Divider light />
<MenuItem
onClick={handleCloseProfile}
className={classes.dropdownItem}
>
Logout
</MenuItem>
</MenuList>
</ClickAwayListener>
</Paper>
......
......@@ -40,12 +40,12 @@ export default function Header(props) {
<div className={classes.flex}>
{/* Here we create navbar brand, based on route name */}
<Button color="transparent" href="#" className={classes.title}>
{makeBrand()}
</Button>
{/* {makeBrand()} */}
</Button>
</div>
<Hidden smDown implementation="css">
{/* <Hidden smDown implementation="css">
{props.rtlActive ? <RTLNavbarLinks /> : <AdminNavbarLinks />}
</Hidden>
</Hidden> */}
<Hidden mdUp implementation="css">
<IconButton
color="inherit"
......
/*eslint-disable*/
import React from "react";
import { useHistory } from 'react-router-dom'
import classNames from "classnames";
import PropTypes from "prop-types";
import { NavLink } from "react-router-dom";
......@@ -11,16 +12,26 @@ import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import ListItemText from "@material-ui/core/ListItemText";
import Icon from "@material-ui/core/Icon";
import Button from '@material-ui/core/Button';
// core components
import AdminNavbarLinks from "components/Navbars/AdminNavbarLinks.js";
import RTLNavbarLinks from "components/Navbars/RTLNavbarLinks.js";
import ExitToAppIcon from '@material-ui/icons/ExitToApp';
import styles from "assets/jss/material-dashboard-react/components/sidebarStyle.js";
import auth from "auth";
const useStyles = makeStyles(styles);
export default function Sidebar(props) {
const classes = useStyles();
const history = useHistory();
const handleCloseProfile = () => {
auth.logout(() => { history.push("/") })
};
// verifies if routeName is the one active (in browser input)
function activeRoute(routeName) {
return window.location.href.indexOf(routeName) > -1 ? true : false;
......@@ -78,6 +89,22 @@ export default function Sidebar(props) {
</NavLink>
);
})}
<ListItem button className={classes.itemLink} onClick={handleCloseProfile}>
<Icon
className={classNames(classes.itemIcon, {
[classes.itemIconRTL]: false
})}
>
<ExitToAppIcon />
</Icon>
<ListItemText
primary="Logout"
className={classNames(classes.itemText, {
[classes.itemTextRTL]: false
})}
disableTypography={true}
/>
</ListItem>
</List>
);
var brand = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment