X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c0afd448c39a41d229612afe47643aed7a2cf5dd..a1e2b8ba77e4a7273940a3fc542bc42e282618a7:/src/components/file-tree/file-tree-item.tsx diff --git a/src/components/file-tree/file-tree-item.tsx b/src/components/file-tree/file-tree-item.tsx index 5255ded1..0e8c92e2 100644 --- a/src/components/file-tree/file-tree-item.tsx +++ b/src/components/file-tree/file-tree-item.tsx @@ -5,12 +5,13 @@ import * as React from "react"; import { TreeItem } from "../tree/tree"; import { ProjectIcon, MoreOptionsIcon, DefaultIcon, CollectionIcon } from "../icon/icon"; -import { Typography, IconButton, StyleRulesCallback, withStyles, WithStyles } from "@material-ui/core"; -import { formatFileSize } from "../../common/formatters"; +import { Typography, IconButton, StyleRulesCallback, withStyles, WithStyles, Tooltip } from '@material-ui/core'; +import { formatFileSize } from "~/common/formatters"; import { ListItemTextIcon } from "../list-item-text-icon/list-item-text-icon"; import { FileTreeData } from "./file-tree-data"; +import { FileThumbnail } from '~/components/file-tree/file-thumbnail'; -type CssRules = "root" | "spacer" | "sizeInfo" | "button"; +type CssRules = "root" | "spacer" | "sizeInfo" | "button" | "moreOptions"; const fileTreeItemStyle: StyleRulesCallback = theme => ({ root: { @@ -27,7 +28,10 @@ const fileTreeItemStyle: StyleRulesCallback = theme => ({ button: { width: theme.spacing.unit * 3, height: theme.spacing.unit * 3, - marginRight: theme.spacing.unit + marginRight: theme.spacing.unit, + }, + moreOptions: { + position: 'absolute' } }); @@ -39,20 +43,25 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)( class extends React.Component> { render() { const { classes, item } = this.props; - return
- -
- {formatFileSize(item.data.size)} - - - -
; + return <> +
+ +
+ {formatFileSize(item.data.size)} + + + + + +
+ + ; } handleClick = (event: React.MouseEvent) => { @@ -61,7 +70,7 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)( }); const getIcon = (item: TreeItem) => { - switch(item.data.type){ + switch (item.data.type) { case 'directory': return ProjectIcon; case 'file':