diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js
index 9e7240d..a517cb3 100644
--- a/src/components/ItemViewAppBar/ItemViewAppBar.js
+++ b/src/components/ItemViewAppBar/ItemViewAppBar.js
@@ -1,16 +1,18 @@
import React, { useEffect } from "react";
+import { useHistory } from "react-router-dom";
import PropTypes from "prop-types";
-import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core"
+import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom, useTheme} from "@material-ui/core"
import CloseItemViewIcon from '@material-ui/icons/ChevronRight';
-export default function ItemViewAppBar({ title, theme, setSidebarOpen }){
+export default function ItemViewAppBar({ title, setSidebarOpen }){
useEffect(() => {
setSidebarOpen(true)
return () => setSidebarOpen(false)
});
+ const theme = useTheme();
const useStyles = makeStyles((theme) => ({
closeButton: {
marginRight: theme.spacing(3),
@@ -21,11 +23,15 @@ export default function ItemViewAppBar({ title, theme, setSidebarOpen }){
appBarRoot: {
width: "inherit",
position: "inherit"
+ },
+ paddingToolbar: {
+ position: "absolute"
}
}));
-
const classes = useStyles(theme);
+ const history = useHistory();
+
return(
<>
@@ -33,7 +39,10 @@ export default function ItemViewAppBar({ title, theme, setSidebarOpen }){
setSidebarOpen(false)}
+ onClick={() =>
+ {
+ history.push("/");
+ }}
TransitionComponent={Zoom}
>
@@ -46,14 +55,13 @@ export default function ItemViewAppBar({ title, theme, setSidebarOpen }){
-
+
>
);
}
ItemViewAppBar.propTypes = {
- /** The webqueue2 MUI theme. */
- "theme": PropTypes.object.isRequired,
+
/** Function to toggle sidebar open. */
"setSidebarOpen": PropTypes.func.isRequired,
/** The title of the app bar. */
diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.md b/src/components/ItemViewAppBar/ItemViewAppBar.md
index 26fdb9e..3eba2e4 100644
--- a/src/components/ItemViewAppBar/ItemViewAppBar.md
+++ b/src/components/ItemViewAppBar/ItemViewAppBar.md
@@ -9,9 +9,9 @@ const theme = webqueue2Theme(false);
const [sidebarOpen, setSidebarOpen] = useState(false);
-
+
```
```jsx static
-
+
```
\ No newline at end of file