import React from "react"; import PropTypes from "prop-types"; import classnames from "classnames"; import "../../css/context-menu.css"; export const Hr = () => (

  • ); // TODO: Add down-arrow export const Parent = ({ children, label }) => (
  • {label}
  • ); export const LinkNode = props => (
  • {props.label}
  • ); LinkNode.propTypes = { label: PropTypes.string.isRequired, href: PropTypes.string.isRequired }; export const Node = props =>
  • {props.label}
  • ; Node.propTypes = { label: PropTypes.string.isRequired }; export class ContextMenu extends React.Component { componentWillMount() { // Clicking anywhere outside the context menu will close the window document.addEventListener("click", this.props.closeMenu); } componantWillUnmount() { document.removeEventListener("click", this.props.closeMenu); } render() { const { selected, top, bottom, children } = this.props; return (
    ); } } ContextMenu.propTypes = { closeMenu: PropTypes.func.isRequired, children: PropTypes.any.isRequired, top: PropTypes.bool, bottom: PropTypes.bool };