From 7aa5dcef69f820abd4a66b92d5469e08bba66163 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 6 Dec 2017 13:10:58 +0000 Subject: [PATCH] Move DragDropContext to wrap entire app --- src/components/structures/MatrixChat.js | 6 +++++- src/components/structures/TagPanel.js | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index cd75ad8798..d880c83952 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -19,6 +19,8 @@ limitations under the License. import Promise from 'bluebird'; import React from 'react'; +import { DragDropContext } from 'react-dnd'; +import HTML5Backend from 'react-dnd-html5-backend'; import Matrix from "matrix-js-sdk"; import Analytics from "../../Analytics"; @@ -84,7 +86,7 @@ const ONBOARDING_FLOW_STARTERS = [ 'view_create_group', ]; -module.exports = React.createClass({ +const MatrixChat = React.createClass({ // we export this so that the integration tests can use it :-S statics: { VIEWS: VIEWS, @@ -1584,3 +1586,5 @@ module.exports = React.createClass({ console.error(`Unknown view ${this.state.view}`); }, }); + +export default DragDropContext(HTML5Backend)(MatrixChat); diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 2c498e9eee..ff3fd65f0c 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -15,8 +15,6 @@ limitations under the License. */ import React from 'react'; -import { DragDropContext } from 'react-dnd'; -import HTML5Backend from 'react-dnd-html5-backend'; import PropTypes from 'prop-types'; import { MatrixClient } from 'matrix-js-sdk'; import FilterStore from '../../stores/FilterStore'; @@ -126,4 +124,4 @@ const TagPanel = React.createClass({ ; }, }); -export default DragDropContext(HTML5Backend)(TagPanel); +export default TagPanel;