X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a0d117b3fae1311a6eb98612946be8966bdf2cf5..3c7e3cdc547ad5468421e1c049daa94b0d4b8bc0:/src/components/tree/virtual-tree.tsx diff --git a/src/components/tree/virtual-tree.tsx b/src/components/tree/virtual-tree.tsx index 54938969..f353fd05 100644 --- a/src/components/tree/virtual-tree.tsx +++ b/src/components/tree/virtual-tree.tsx @@ -2,14 +2,14 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import classnames from "classnames"; import { StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core/styles'; import { ReactElement } from "react"; import { FixedSizeList, ListChildComponentProps } from "react-window"; import AutoSizer from "react-virtualized-auto-sizer"; -import { ArvadosTheme } from '~/common/custom-theme'; +import { ArvadosTheme } from 'common/custom-theme'; import { TreeItem, TreeProps, TreeItemStatus } from './tree'; import { ListItem, Radio, Checkbox, CircularProgress, ListItemIcon } from '@material-ui/core'; import { SidePanelRightArrowIcon } from '../icon/icon'; @@ -24,12 +24,18 @@ type CssRules = 'list' | 'iconOpen' | 'toggableIcon' | 'checkbox' + | 'virtualFileTree' | 'virtualizedList'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ list: { padding: '3px 0px', }, + virtualFileTree: { + "&:last-child": { + paddingBottom: 20 + } + }, virtualizedList: { height: '200px', }, @@ -84,7 +90,7 @@ export const Row = (itemList: VirtualTreeItem[], render: any, treeProp const it = itemList[index]; const level = it.level || 0; const { toggleItemActive, disableRipple, currentItemUuid, useRadioButtons } = treeProps; - const { listItem, loader, toggableIconContainer, renderContainer } = classes; + const { listItem, loader, toggableIconContainer, renderContainer, virtualFileTree } = classes; const { levelIndentation = 20, itemRightPadding = 20 } = treeProps; const showSelection = typeof treeProps.showSelection === 'function' @@ -130,7 +136,7 @@ export const Row = (itemList: VirtualTreeItem[], render: any, treeProp : undefined; }; - return
+ return
extends React.Component & WithStyles, {}> { render(): ReactElement { const { items, render } = this.props; - return {({ height, width }) => { return VirtualList(height, width, items || [], render, this.props);