Skip to content

Commit

Permalink
Update ItemTableAppBar docs to include new actions prop
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Jul 16, 2021
1 parent ebb4e11 commit e314bbd
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions src/components/ItemTableAppBar/ItemTableAppBar.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
import ItemTableAppBar from "./ItemTableAppBar";
import ItemTableAppBarAction from "../ItemTableAppBarAction";
import Filter1Icon from '@material-ui/icons/Filter1';
import Filter2Icon from '@material-ui/icons/Filter2';

<Meta
<Meta
title="Components/ItemTableAppBar"
component={ItemTableAppBar}
argsTypes={{
setDarkMode: {
actions: {
control: {
type: "object"
}
Expand All @@ -20,7 +23,31 @@ The ItemTableAppBar is the primary toolbar for the [ItemTable](/?path=/docs/comp
name="Default"
args={{
title:"webqueue2",
setDarkMode: _ => alert("Use the darkmode toggle in the toolbar above.")
}}
>
{ args => <ItemTableAppBar {...args} /> }
</Story>
</Canvas>

Actions can be added to the ItemTableAppBar by passing an array of [ItemTableAppBarAction](/?path=/docs/components-itemtableappbaraction) components to the `action` prop. They'll be rendered from left to right in the order their passed.

<Canvas>
<Story
name="With Actions"
args={{
title:"webqueue2",
actions: [
<ItemTableAppBarAction
title="First Action"
onClick={_ => alert("You've triggered to the first aciton,")}
icon={<Filter1Icon />}
/>,
<ItemTableAppBarAction
title="Second Action"
onClick={_ => alert("You've triggered to the second aciton,")}
icon={<Filter2Icon />}
/>
]
}}
>
{ args => <ItemTableAppBar {...args} /> }
Expand Down

0 comments on commit e314bbd

Please sign in to comment.