diff --git a/src/App.js b/src/App.js index 6ccb0b4..e1fabb3 100644 --- a/src/App.js +++ b/src/App.js @@ -4,7 +4,7 @@ import webqueueTheme from "./theme"; import { Box, makeStyles } from "@material-ui/core"; import ItemTableAppBar from "./components/ItemTableAppBar/"; import ItemTable from "./components/ItemTable/"; -import ItemViewAppBar from "./ItemViewAppBar"; +import ItemViewAppBar from "./components/ItemViewAppBar/"; import ItemView from "./ItemView"; import clsx from "clsx"; diff --git a/src/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js similarity index 73% rename from src/ItemViewAppBar.js rename to src/components/ItemViewAppBar/ItemViewAppBar.js index 45dec54..a150cd6 100644 --- a/src/ItemViewAppBar.js +++ b/src/components/ItemViewAppBar/ItemViewAppBar.js @@ -1,4 +1,5 @@ import React from "react"; +import PropTypes from "prop-types"; import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core" import CloseItemViewIcon from '@material-ui/icons/ChevronRight'; @@ -36,4 +37,17 @@ export default function ItemViewAppBar(props){ ); -} \ No newline at end of file +} + +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. */ + "title": PropTypes.string +}; + +ItemViewAppBar.defaultProps = { + "title": "" +}; \ No newline at end of file diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.md b/src/components/ItemViewAppBar/ItemViewAppBar.md new file mode 100644 index 0000000..acf98df --- /dev/null +++ b/src/components/ItemViewAppBar/ItemViewAppBar.md @@ -0,0 +1,17 @@ +The ItemViewAppBar is the primary toolbar for the [ItemView](/#/Components/ItemView). It displays the item title and action for closing the sidebar. + +```jsx +import React, { useState } from "react"; +import ItemViewAppBar from "./ItemViewAppBar"; +import webqueue2Theme from "../../theme.js"; + +const theme = webqueue2Theme(false); + +const [sidebarOpen, setSidebarOpen] = useState(false); + + +``` + +```jsx static + +``` \ No newline at end of file diff --git a/src/components/ItemViewAppBar/index.js b/src/components/ItemViewAppBar/index.js new file mode 100644 index 0000000..4c009ea --- /dev/null +++ b/src/components/ItemViewAppBar/index.js @@ -0,0 +1,3 @@ +import ItemViewAppBar from "./ItemViewAppBar"; + +export default ItemViewAppBar; \ No newline at end of file