-
Notifications
You must be signed in to change notification settings - Fork 0
Allow actions to be passed to ItemTableAppBar #49
Comments
This should also apply to ItemViewAppbar. |
The ItemTableAppBar and ItemViewAppBar could likely be consolidated into a single component for simplicity as the two seems to serve very similar purposes and it would be cleaner to consolidate logic into one place. Also, this needs to be done before the ItemTable can be made responsive. |
Working on this. |
Disregard the need to consolidate the *AppBar components. |
The actions for toolbars have been consolidated into a separate component to make the process of implementing more actions easier in the future. Here is how that component looks: <Toolbar variant="dense">
<Tooltip title={tooltipTitle}
arrow
onClick={onClick}
TransitionComponent={Zoom}
>
<IconButton color="inherit">
{icon}
</IconButton>
</Tooltip>
</Toolbar> Here is a list of the props for the component:
|
This issue is waiting for #215 to be reviewed. Can be closed once this PR is merged. |
Working on this. Tried to complete this with Tyler yesterday but react-storybook has broken. Currently attempting to fix an esoteric build issue. The issue seems to stem from |
This has been resolved. Passing actions to ItemTableAppBar Example: <ItemTableAppBarAction
title="Logout"
icon={<LogoutIcon />}
onClick={logout()}
/> An Example: <ItemTableAppBar
title="webqueue2"
actions={[
<ItemTableAppBarAction
title="Action 1"
icon={<Action1Icon />}
onClick={action1callback()}
/>,
<ItemTableAppBarAction
title="Action 2"
icon={<Action2Icon />}
onClick={action2callback()}
/>
]}
/> Fixing Storybook build isues To address this issue, the following packages were version locked to before this breaking change occured (v6.1.20):
|
Currently, the ItemTableAppBar accepts four props: title, setDarkMode, darkMode and theme. The title and theme props work as expected. The setDarkMode and darkMode props are passed for toggling dark mode. While this works for a single action, it is not a scalable solution for more actions to be added later.
Within ItemTableAppBar, it would be relatively simple to add more actions. This is what the current dark mode toggle looks like:
This could could be made into a component with the following props:
tooltipTitle
: a string to show in the tooltip on hoveronClick
: a function to execute when the button is clickedicon
: the image/vector to display when clickedThe component could be used with those components like this:
The ItemTableAppBar could then be used without the darkMode and setDarkMode props but with the actions prop like this:
The text was updated successfully, but these errors were encountered: