From 6906d5a5f9d49b52ec9ba69c8648324d467c1790 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Oct 2018 16:02:35 +0200 Subject: [PATCH] remove DND for room tiles --- src/components/structures/RoomSubList.js | 25 ++------- src/components/views/rooms/DNDRoomTile.js | 65 ----------------------- src/components/views/rooms/RoomList.js | 9 ---- 3 files changed, 3 insertions(+), 96 deletions(-) delete mode 100644 src/components/views/rooms/DNDRoomTile.js diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index b00130f13d..e90934c58f 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -42,7 +42,6 @@ const RoomSubList = React.createClass({ list: PropTypes.arrayOf(PropTypes.object).isRequired, label: PropTypes.string.isRequired, tagName: PropTypes.string, - editable: PropTypes.bool, order: PropTypes.string.isRequired, @@ -205,15 +204,9 @@ const RoomSubList = React.createClass({ }, makeRoomTiles: function() { - const DNDRoomTile = sdk.getComponent("rooms.DNDRoomTile"); const RoomTile = sdk.getComponent("rooms.RoomTile"); return this.state.sortedList.map((room, index) => { - // XXX: is it evil to pass in this as a prop to RoomTile? Yes. - - // We should only use when editable - const RoomTileComponent = this.props.editable ? DNDRoomTile : RoomTile; - return 0 || this.props.extraTiles.length > 0 || this.props.editable) { + if (this.state.sortedList.length > 0 || this.props.extraTiles.length > 0) { const subList = this.state.hidden ? undefined : content; - const subListContent =
+ return
{this._getHeaderJsx()} {subList}
; - - return this.props.editable ? - - {(provided, snapshot) => ( -
- {subListContent} -
- )} -
: subListContent; } else { const Loader = sdk.getComponent("elements.Spinner"); if (this.props.showSpinner) { diff --git a/src/components/views/rooms/DNDRoomTile.js b/src/components/views/rooms/DNDRoomTile.js deleted file mode 100644 index 69c2f979ed..0000000000 --- a/src/components/views/rooms/DNDRoomTile.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2015, 2016 OpenMarket Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import React from 'react'; -import { Draggable } from 'react-beautiful-dnd'; -import RoomTile from '../../../components/views/rooms/RoomTile'; - -import classNames from 'classnames'; - -export default class DNDRoomTile extends React.PureComponent { - constructor() { - super(); - this.getClassName = this.getClassName.bind(this); - } - - getClassName(isDragging) { - return classNames({ - "mx_DNDRoomTile": true, - "mx_DNDRoomTile_dragging": isDragging, - }); - } - - render() { - const props = this.props; - - return
- - { (provided, snapshot) => { - return ( -
-
-
- -
-
- { provided.placeholder } -
- ); - } } -
-
; - } -} diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 5ed2ef1fbe..1ab7c4dd3b 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -631,7 +631,6 @@ module.exports = React.createClass({ } label={_t('Historical')} - editable={false} order="recent" collapsed={self.props.collapsed} alwaysShowHeader={true} @@ -750,7 +742,6 @@ module.exports = React.createClass({