Skip to content

Commit

Permalink
Move ItemViewAppBar to react-styleguidist folder structure w/ docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Sep 20, 2020
1 parent c08073d commit ba98c45
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -36,4 +37,17 @@ export default function ItemViewAppBar(props){
</AppBar>
</>
);
}
}

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": ""
};
17 changes: 17 additions & 0 deletions src/components/ItemViewAppBar/ItemViewAppBar.md
Original file line number Diff line number Diff line change
@@ -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);

<ItemViewAppBar title="ce 100" setSidebarOpen={setSidebarOpen} theme={theme} />
```

```jsx static
<ItemViewAppBar title={"ce 100"} setSidebarOpen={someFunc} theme={theme} />
```
3 changes: 3 additions & 0 deletions src/components/ItemViewAppBar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ItemViewAppBar from "./ItemViewAppBar";

export default ItemViewAppBar;

0 comments on commit ba98c45

Please sign in to comment.