X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/dca911684e2f09e518e976f9e1e3d3c2aec2c86a..b0bc9cddda159681f28384374be59335efda5f20:/src/components/dropdown-menu/dropdown-menu.tsx

diff --git a/src/components/dropdown-menu/dropdown-menu.tsx b/src/components/dropdown-menu/dropdown-menu.tsx
index fe285fad61..cd68d5ba27 100644
--- a/src/components/dropdown-menu/dropdown-menu.tsx
+++ b/src/components/dropdown-menu/dropdown-menu.tsx
@@ -6,48 +6,49 @@ import * as React from 'react';
 import Menu from '@material-ui/core/Menu';
 import IconButton from '@material-ui/core/IconButton';
 import { PopoverOrigin } from '@material-ui/core/Popover';
-import IconBase, { IconTypes } from '../icon/icon';
+import { Tooltip } from '@material-ui/core';
 
 interface DropdownMenuProps {
     id: string;
-    icon: IconTypes;
-    // icon: React.ComponentType;
+    icon: React.ReactElement<any>;
+    title: string;
 }
 
-class DropdownMenu extends React.Component<DropdownMenuProps> {
+interface DropdownMenuState {
+    anchorEl: any;
+}
 
+export class DropdownMenu extends React.Component<DropdownMenuProps, DropdownMenuState> {
     state = {
         anchorEl: undefined
     };
 
     transformOrigin: PopoverOrigin = {
-        vertical: "top",
-        horizontal: "center"
+        vertical: -50,
+        horizontal: 0
     };
 
     render() {
-        const { icon, id, children } = this.props;
+        const { icon, id, children, title } = this.props;
         const { anchorEl } = this.state;
         return (
             <div>
-                <IconButton
-                    aria-owns={anchorEl ? id : undefined}
-                    aria-haspopup="true"
-                    color="inherit"
-                    onClick={this.handleOpen}
-
-                >
-                    <IconBase icon={icon} />
-                </IconButton>
+                <Tooltip title={title}>
+                    <IconButton
+                        aria-owns={anchorEl ? id : undefined}
+                        aria-haspopup="true"
+                        color="inherit"
+                        onClick={this.handleOpen}>
+                        {icon}
+                    </IconButton>
+                </Tooltip>
                 <Menu
                     id={id}
                     anchorEl={anchorEl}
                     open={Boolean(anchorEl)}
                     onClose={this.handleClose}
                     onClick={this.handleClose}
-                    anchorOrigin={this.transformOrigin}
-                    transformOrigin={this.transformOrigin}
-                >
+                    transformOrigin={this.transformOrigin}>
                     {children}
                 </Menu>
             </div>
@@ -62,6 +63,3 @@ class DropdownMenu extends React.Component<DropdownMenuProps> {
         this.setState({ anchorEl: event.currentTarget });
     }
 }
-
-
-export default DropdownMenu;
