diff --git a/src/components/structures/ContextualMenu.js b/src/components/structures/ContextualMenu.js index daac294d12..d6a11ca974 100644 --- a/src/components/structures/ContextualMenu.js +++ b/src/components/structures/ContextualMenu.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2018 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,12 +16,10 @@ limitations under the License. */ -'use strict'; - -const classNames = require('classnames'); -const React = require('react'); -const ReactDOM = require('react-dom'); +import React from 'react'; +import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; // Shamelessly ripped off Modal.js. There's probably a better way // of doing reusable widgets like dialog boxes & menus where we go and @@ -61,7 +60,12 @@ export default class ContextualMenu extends React.Component { // If true, insert an invisible screen-sized element behind the // menu that when clicked will close it. hasBackground: PropTypes.bool, - } + + // The component to render as the context menu + elementClass: PropTypes.element.isRequired, + // on resize callback + windowResize: PropTypes.func + }; render() { const position = {}; @@ -112,7 +116,7 @@ export default class ContextualMenu extends React.Component { `; } - const chevron =
; + const chevron = ; const className = 'mx_ContextualMenu_wrapper'; const menuClasses = classNames({ @@ -158,13 +162,13 @@ export default class ContextualMenu extends React.Component { { chevron }