From bfa2055c4184c1fe7d56936cf5af4d57cc6fcb22 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Thu, 11 Jan 2024 11:02:04 -0500 Subject: [PATCH] 21317: cleanup Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../ms-toolbar-overflow-wrapper.tsx | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx b/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx index 94a34c72e5..de1acf1eea 100644 --- a/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx +++ b/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-overflow-wrapper.tsx @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: AGPL-3.0 -import React, { useState, useRef, useEffect , ReactElement, JSXElementConstructor} from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core'; -import classnames from 'classnames' +import classnames from 'classnames'; import { ArvadosTheme } from 'common/custom-theme'; -import { OverflowMenu, OverflowChild} from './ms-toolbar-overflow-menu'; +import { OverflowMenu, OverflowChild } from './ms-toolbar-overflow-menu'; type CssRules = 'visible' | 'inVisible' | 'toolbarWrapper' | 'overflowStyle'; @@ -36,11 +36,11 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }); type WrapperProps = { - children: OverflowChild[] -} + children: OverflowChild[]; +}; export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperProps & WithStyles) => { - const { classes, children} = props + const { classes, children } = props; const navRef = useRef(null); const [visibilityMap, setVisibilityMap] = useState({}); @@ -82,21 +82,24 @@ export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperPro }, []); return ( -
- {React.Children.map(children, (child) => { - return React.cloneElement(child, { - className: classnames(child.props.className, { - [classes.visible]: !!visibilityMap[child.props["data-targetid"]], - [classes.inVisible]: !visibilityMap[child.props["data-targetid"]] - }) - }); - })} - - {children} - -
+
+ {React.Children.map(children, (child) => { + return React.cloneElement(child, { + className: classnames(child.props.className, { + [classes.visible]: !!visibilityMap[child.props['data-targetid']], + [classes.inVisible]: !visibilityMap[child.props['data-targetid']], + }), + }); + })} + + {children} + +
); }); -- 2.39.5