diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 337ac6ab758..c9cc3755633 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -29,6 +29,8 @@ import classnames from 'classnames'; import GroupStoreCache from '../../stores/GroupStoreCache'; import GroupStore from '../../stores/GroupStore'; +import { showGroupAddRoomDialog } from '../../GroupAddressPicker'; +import GeminiScrollbar from 'react-gemini-scrollbar'; const RoomSummaryType = PropTypes.shape({ room_id: PropTypes.string.isRequired, @@ -64,7 +66,7 @@ const CategoryRoomList = React.createClass({ editing: PropTypes.bool.isRequired, }, - onAddRoomsClicked: function(ev) { + onAddRoomsToSummaryClicked: function(ev) { ev.preventDefault(); const AddressPickerDialog = sdk.getComponent("dialogs.AddressPickerDialog"); Modal.createTrackedDialog('Add Rooms to Group Summary', '', AddressPickerDialog, { @@ -106,7 +108,9 @@ const CategoryRoomList = React.createClass({ render: function() { const TintableSvg = sdk.getComponent("elements.TintableSvg"); const addButton = this.props.editing ? - ( + (
{ _t('Add a Room') } @@ -450,6 +454,7 @@ export default React.createClass({ }); }); this._groupStore.on('error', (err) => { + console.error(err); this.setState({ summary: null, error: err, @@ -601,6 +606,10 @@ export default React.createClass({ this._setPublicity(true); }, + _onAddRoomsClick: function() { + showGroupAddRoomDialog(this.props.groupId); + }, + _setPublicity: function(publicity) { this.setState({ publicityBusy: true, @@ -612,6 +621,28 @@ export default React.createClass({ }); }, + _getRoomsNode: function() { + const RoomDetailList = sdk.getComponent('rooms.RoomDetailList'); + const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); + const TintableSvg = sdk.getComponent('elements.TintableSvg'); + const addButton = this.state.editing ? + ( +
+ +
+
+ { _t('Add rooms to this group') } +
+
) :
; + return
+
+

Rooms

+ { addButton } +
+ +
; + }, + _getFeaturedRoomsNode: function() { const summary = this.state.summary; @@ -799,7 +830,7 @@ export default React.createClass({ let avatarNode; let nameNode; let shortDescNode; - let roomBody; + let bodyNodes = []; const rightButtons = []; const headerClasses = { mx_GroupView_header: true, @@ -856,14 +887,15 @@ export default React.createClass({ width="18" height="18" alt={_t("Cancel")} /> , ); - roomBody =
-