import React from 'react'; import PropTypes from 'prop-types'; import {Button, Icon} from 'coral-ui'; import {Menu} from 'react-mdl'; import cn from 'classnames'; import {findDOMNode} from 'react-dom'; import styles from './ActionsMenu.css'; import t from 'coral-framework/services/i18n'; let count = 0; class ActionsMenu extends React.Component { id = `actions-dropdown-${count++}`; menu = null; state = {open: false}; timeout = null; componentWillUnmount() { clearTimeout(this.timeout); } handleRef = (ref) => { this.menu = ref ? findDOMNode(ref).parentNode : null; } syncOpenState = () => { clearTimeout(this.timeout); this.timeout = setTimeout(() => { this.setState({open: this.menu.className.indexOf('is-visible') >= 0}); }, 150); }; render() { return (