X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9e4b7889a99ff2f76d8029aef3a85c4620178ba3..8360ba81b48f6883b453f13756432a3d599c3042:/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 4f2b83af..bb661bc2 100644 --- a/src/components/dropdown-menu/dropdown-menu.tsx +++ b/src/components/dropdown-menu/dropdown-menu.tsx @@ -2,50 +2,53 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; -import { Menu, IconButton } from '@material-ui/core'; +import 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 { Tooltip } from '@material-ui/core'; interface DropdownMenuProps { id: string; - icon: React.ComponentType; + icon: React.ReactElement; + title: string; } -class DropdownMenu extends React.Component { +interface DropdownMenuState { + anchorEl: any; +} +export class DropdownMenu extends React.Component { state = { anchorEl: undefined }; transformOrigin: PopoverOrigin = { - vertical: "top", - horizontal: "center" + vertical: -50, + horizontal: 0 }; render() { - const { icon: Icon, id, children } = this.props; + const { icon, id, children, title } = this.props; const { anchorEl } = this.state; return (
- - - + + + {icon} + + + transformOrigin={this.transformOrigin}> {children}
@@ -60,6 +63,3 @@ class DropdownMenu extends React.Component { this.setState({ anchorEl: event.currentTarget }); } } - - -export default DropdownMenu;