X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/993c6c511af30163a2826d6992720b6be397943b..8360ba81b48f6883b453f13756432a3d599c3042:/src/components/multi-panel-view/multi-panel-view.tsx diff --git a/src/components/multi-panel-view/multi-panel-view.tsx b/src/components/multi-panel-view/multi-panel-view.tsx index 6779bc35ae..203748d5e0 100644 --- a/src/components/multi-panel-view/multi-panel-view.tsx +++ b/src/components/multi-panel-view/multi-panel-view.tsx @@ -19,9 +19,12 @@ import { InfoIcon } from 'components/icon/icon'; import { ReactNodeArray } from 'prop-types'; import classNames from 'classnames'; -type CssRules = 'button' | 'buttonIcon' | 'content'; +type CssRules = 'root' | 'button' | 'buttonIcon' | 'content'; const styles: StyleRulesCallback = theme => ({ + root: { + marginTop: '10px', + }, button: { padding: '2px 5px', marginRight: '5px', @@ -67,6 +70,7 @@ interface MPVPanelDataProps { panelRef?: MutableRefObject; forwardProps?: boolean; maxHeight?: string; + minHeight?: string; } interface MPVPanelActionProps { @@ -82,19 +86,19 @@ type MPVPanelContentProps = {children: ReactElement} & MPVPanelProps & GridProps // Grid item compatible component for layout and MPV props passing export const MPVPanelContent = ({doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName, - panelMaximized, panelIlluminated, panelRef, forwardProps, maxHeight, + panelMaximized, panelIlluminated, panelRef, forwardProps, maxHeight, minHeight, ...props}: MPVPanelContentProps) => { useEffect(() => { if (panelRef && panelRef.current) { - panelRef.current.scrollIntoView({behavior: 'smooth'}); + panelRef.current.scrollIntoView({alignToTop: true}); } }, [panelRef]); - const mh = panelMaximized + const maxH = panelMaximized ? '100%' : maxHeight; - return + return {/* Element to scroll to when the panel is selected */} { forwardProps @@ -205,7 +209,7 @@ const MPVContainerComponent = ({children, panelStates, classes, ...props}: MPVCo }; }; - return + return { buttons.map((tgl, idx) => {tgl}) } @@ -220,4 +224,4 @@ const MPVContainerComponent = ({children, panelStates, classes, ...props}: MPVCo ; }; -export const MPVContainer = withStyles(styles)(MPVContainerComponent); \ No newline at end of file +export const MPVContainer = withStyles(styles)(MPVContainerComponent);