From 7e1f1cdbd9da799559f931ae0918396a4bb97a90 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 6 Dec 2017 15:01:16 +0000 Subject: [PATCH] Move DragDropContext to wrap LoggedInView Becuase the tests rely on being able to inspect the state of MatrixChat --- src/components/structures/LoggedInView.js | 6 +++++- src/components/structures/MatrixChat.js | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index 01abf966f9..38b7634edb 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -18,6 +18,8 @@ limitations under the License. import * as Matrix from 'matrix-js-sdk'; import React from 'react'; +import { DragDropContext } from 'react-dnd'; +import HTML5Backend from 'react-dnd-html5-backend'; import { KeyCode, isOnlyCtrlOrCmdKeyEvent } from '../../Keyboard'; import Notifier from '../../Notifier'; @@ -38,7 +40,7 @@ import SettingsStore from "../../settings/SettingsStore"; * * Components mounted below us can access the matrix client via the react context. */ -export default React.createClass({ +const LoggedInView = React.createClass({ displayName: 'LoggedInView', propTypes: { @@ -344,3 +346,5 @@ export default React.createClass({ ); }, }); + +export default DragDropContext(HTML5Backend)(LoggedInView); diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index d880c83952..7c41a67fca 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -19,8 +19,6 @@ 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"; @@ -1587,4 +1585,4 @@ const MatrixChat = React.createClass({ }, }); -export default DragDropContext(HTML5Backend)(MatrixChat); +export default MatrixChat;