X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9f1850a385ee8e0a011474de19ee6507b0b168f3..0a274c87a1412df329469504b3581cc8c7084255:/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx diff --git a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx index f92c0dcf4e..6500593166 100644 --- a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx +++ b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx @@ -34,10 +34,11 @@ import { getProcess } from "store/processes/process"; import { Process } from "store/processes/process"; import { PublicFavoritesState } from "store/public-favorites/public-favorites-reducer"; import { isExactlyOneSelected } from "store/multiselect/multiselect-actions"; +import { IntersectionObserverWrapper } from "./ms-toolbar-overflow-wrapper"; const WIDTH_TRANSITION = 150 -type CssRules = "root" | "transition" | "button" | "iconContainer"; +type CssRules = "root" | "transition" | "button" | "iconContainer" | "icon"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -46,39 +47,30 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ width: 0, height: '2.7rem', padding: 0, - margin: "1rem auto auto 0.5rem", + margin: "1rem auto auto 0.3rem", transition: `width ${WIDTH_TRANSITION}ms`, - overflowY: 'auto', - scrollBehavior: 'smooth', - '&::-webkit-scrollbar': { - width: 0, - height: 2 - }, - '&::-webkit-scrollbar-track': { - width: 0, - height: 2 - }, - '&::-webkit-scrollbar-thumb': { - backgroundColor: '#757575', - borderRadius: 2 - } + overflow: 'hidden', }, transition: { display: "flex", flexDirection: "row", - width: 0, height: '2.7rem', padding: 0, - margin: "1rem auto auto 0.5rem", + margin: "1rem auto auto 0.3rem", overflow: 'hidden', transition: `width ${WIDTH_TRANSITION}ms`, }, button: { width: "2.5rem", height: "2.5rem ", + paddingLeft: 0, + border: "1px solid transparent", }, iconContainer: { - height: '100%' + height: '100%', + }, + icon: { + marginLeft: '-0.5rem', } }); @@ -130,47 +122,53 @@ export const MultiselectToolbar = connect( {actions.length ? ( - actions.map((action, i) =>{ - const { hasAlts, useAlts, name, altName, icon, altIcon } = action; - return hasAlts ? ( - - - props.executeMulti(action, checkedList, iconProps.resources)} + + {actions.map((action, i) =>{ + const { hasAlts, useAlts, name, altName, icon, altIcon } = action; + return hasAlts ? ( + - {currentPathIsTrash || (useAlts && useAlts(singleSelectedUuid, iconProps)) ? altIcon && altIcon({}) : icon({})} - - - - ) : ( - - - props.executeMulti(action, checkedList, iconProps.resources)} + + props.executeMulti(action, checkedList, iconProps.resources)} + className={classes.icon} + > + {currentPathIsTrash || (useAlts && useAlts(singleSelectedUuid, iconProps)) ? altIcon && altIcon({}) : icon({})} + + + + ) : ( + - {action.icon({})} - - - - ); - }) + + props.executeMulti(action, checkedList, iconProps.resources)} + className={classes.icon} + > + {action.icon({})} + + + + ); + })} + ) : ( <> )}