diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 71a5da224c..8ec417a59b 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import FocusTrap from 'focus-trap-react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; import { MatrixClient } from 'matrix-js-sdk'; @@ -64,7 +65,10 @@ export default React.createClass({ // Id of content element // If provided, this is used to add a aria-describedby attribute - contentId: React.PropTypes.string, + contentId: PropTypes.string, + + // optional additional class for the title element + titleClass: PropTypes.string, }, getDefaultProps: function() { @@ -105,25 +109,28 @@ export default React.createClass({ render: function() { const TintableSvg = sdk.getComponent("elements.TintableSvg"); + let cancelButton; + if (this.props.hasCancel) { + cancelButton = + + ; + } + return ( - { this.props.hasCancel ? - - : null } -
+ { cancelButton } +
{ this.props.title }
{ this.props.children } diff --git a/src/components/views/dialogs/ChatCreateOrReuseDialog.js b/src/components/views/dialogs/ChatCreateOrReuseDialog.js index e2387064cf..95fd8848ba 100644 --- a/src/components/views/dialogs/ChatCreateOrReuseDialog.js +++ b/src/components/views/dialogs/ChatCreateOrReuseDialog.js @@ -187,7 +187,7 @@ export default class ChatCreateOrReuseDialog extends React.Component { } } -ChatCreateOrReuseDialog.propTyps = { +ChatCreateOrReuseDialog.propTypes = { userId: PropTypes.string.isRequired, // Called when clicking outside of the dialog onFinished: PropTypes.func.isRequired,