From 27542ce48fa48c5bbe16e96a3ffd1cea0be0cc47 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Wed, 10 May 2023 16:43:13 -0400 Subject: [PATCH] 15768: proper buttons installed Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../data-explorer/data-explorer.tsx | 4 +-- .../multiselectToolbar/MultiselectToolbar.tsx | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx index 82ce5603..8d16aed2 100644 --- a/src/components/data-explorer/data-explorer.tsx +++ b/src/components/data-explorer/data-explorer.tsx @@ -14,7 +14,7 @@ import { DataTableFilters } from 'components/data-table-filters/data-table-filte import { CloseIcon, IconType, MaximizeIcon, UnMaximizeIcon, MoreOptionsIcon } from 'components/icon/icon'; import { PaperProps } from '@material-ui/core/Paper'; import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; -import MultiselectToolbar from 'components/multiselectToolbar/MultiselectToolbar'; +import { MultiselectToolbar, defaultActions } from 'components/multiselectToolbar/MultiselectToolbar'; type CssRules = 'searchBox' | 'headerMenu' | 'toolbar' | 'footer' | 'root' | 'moreOptionsButton' | 'title' | 'dataTable' | 'container'; @@ -228,7 +228,7 @@ export const DataExplorer = withStyles(styles)( )} - {isMSToolbarVisible && } + {isMSToolbarVisible && } )} diff --git a/src/components/multiselectToolbar/MultiselectToolbar.tsx b/src/components/multiselectToolbar/MultiselectToolbar.tsx index 46c33ee3..ea00860d 100644 --- a/src/components/multiselectToolbar/MultiselectToolbar.tsx +++ b/src/components/multiselectToolbar/MultiselectToolbar.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { connect } from 'react-redux'; -import { StyleRulesCallback, withStyles, WithStyles, Toolbar } from '@material-ui/core'; +import { StyleRulesCallback, withStyles, WithStyles, Toolbar, Button } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; import { RootState } from 'store/store'; @@ -26,19 +26,29 @@ type MultiselectToolbarAction = { fn: () => void; }; -export type MultiselectToolbarActions = MultiselectToolbarAction[]; +export type MultiselectToolbarActions = { + actions: Array; +}; + +export const defaultActions: Array = [ + { + name: 'foo', + fn: () => console.log('yo'), + }, +]; -// type MultiselectToolbarProps = MultiselectToolbarActions & WithStyles; -type MultiselectToolbarProps = WithStyles; +type MultiselectToolbarProps = MultiselectToolbarActions & WithStyles; -export default connect(mapStateToProps)( +export const MultiselectToolbar = connect(mapStateToProps)( withStyles(styles)((props: MultiselectToolbarProps) => { - const { classes } = props; + const { classes, actions } = props; return ( -
test1
-
test2
-
test3
+ {actions.map((action, i) => ( + + ))}
); }) -- 2.30.2