Move DragDropContext to wrap entire app

This commit is contained in:
Luke Barnard 2017-12-06 13:10:58 +00:00
parent a8a650c24a
commit 7aa5dcef69
2 changed files with 6 additions and 4 deletions

View file

@ -19,6 +19,8 @@ limitations under the License.
import Promise from 'bluebird'; import Promise from 'bluebird';
import React from 'react'; import React from 'react';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import Matrix from "matrix-js-sdk"; import Matrix from "matrix-js-sdk";
import Analytics from "../../Analytics"; import Analytics from "../../Analytics";
@ -84,7 +86,7 @@ const ONBOARDING_FLOW_STARTERS = [
'view_create_group', 'view_create_group',
]; ];
module.exports = React.createClass({ const MatrixChat = React.createClass({
// we export this so that the integration tests can use it :-S // we export this so that the integration tests can use it :-S
statics: { statics: {
VIEWS: VIEWS, VIEWS: VIEWS,
@ -1584,3 +1586,5 @@ module.exports = React.createClass({
console.error(`Unknown view ${this.state.view}`); console.error(`Unknown view ${this.state.view}`);
}, },
}); });
export default DragDropContext(HTML5Backend)(MatrixChat);

View file

@ -15,8 +15,6 @@ limitations under the License.
*/ */
import React from 'react'; import React from 'react';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { MatrixClient } from 'matrix-js-sdk'; import { MatrixClient } from 'matrix-js-sdk';
import FilterStore from '../../stores/FilterStore'; import FilterStore from '../../stores/FilterStore';
@ -126,4 +124,4 @@ const TagPanel = React.createClass({
</div>; </div>;
}, },
}); });
export default DragDropContext(HTML5Backend)(TagPanel); export default TagPanel;