Skip to content

Commit

Permalink
Update ItemViewAppBar PropTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Apr 19, 2021
1 parent 9796228 commit c49e9d6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/ItemViewAppBar/ItemViewAppBar.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useEffect } from "react";
import { useHistory } from "react-router-dom";
import PropTypes from "prop-types";
import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom, useTheme} 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, setSidebarOpen }){
export default function ItemViewAppBar({ title, setSidebarOpen }) {

useEffect(() => {
setSidebarOpen(true)
Expand All @@ -28,15 +28,14 @@ export default function ItemViewAppBar({ title, setSidebarOpen }){

const history = useHistory();

return(
return (
<>
<AppBar position="sticky" color="secondary" elevation={2} classes={{root: classes.appBarRoot}}>
<AppBar position="sticky" color="secondary" elevation={2} classes={{ root: classes.appBarRoot }}>

<Toolbar variant="dense">
<Tooltip title={"Close Item"}
arrow
onClick={() =>
{
<Tooltip title={"Close Item"}
arrow
onClick={() => {
history.push("/");
}}
TransitionComponent={Zoom}
Expand All @@ -51,14 +50,15 @@ export default function ItemViewAppBar({ title, setSidebarOpen }){
</Typography>
</Toolbar>
</AppBar>
<Toolbar variant="dense"/>
<Toolbar variant="dense" />
</>
);
}

ItemViewAppBar.propTypes = {

/** Function to toggle sidebar open. */
/** Function reference to stateful variable toggle sidebar open. <br />
* <b>Signature:</b> <code>function(sidebarOpen: boolean) => void</code> <br />
*/
"setSidebarOpen": PropTypes.func.isRequired,
/** The title of the app bar. */
"title": PropTypes.string
Expand Down

0 comments on commit c49e9d6

Please sign in to comment.