X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c0afd448c39a41d229612afe47643aed7a2cf5dd..35c2b0aa20a24768ae34c7a3788b1e5b43cdfdac:/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..89bf43c6 100644 --- a/src/components/file-tree/file-tree-item.tsx +++ b/src/components/file-tree/file-tree-item.tsx @@ -5,12 +5,12 @@ 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"; -type CssRules = "root" | "spacer" | "sizeInfo" | "button"; +type CssRules = "root" | "spacer" | "sizeInfo" | "button" | "moreOptions"; const fileTreeItemStyle: StyleRulesCallback = theme => ({ root: { @@ -27,7 +27,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' } }); @@ -47,11 +50,13 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)( {formatFileSize(item.data.size)} - - - + + + + + ; } @@ -61,7 +66,7 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)( }); const getIcon = (item: TreeItem) => { - switch(item.data.type){ + switch (item.data.type) { case 'directory': return ProjectIcon; case 'file':