diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 337ac6ab75..a43e1a4cd3 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'; + 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,7 @@ const CategoryRoomList = React.createClass({ render: function() { const TintableSvg = sdk.getComponent("elements.TintableSvg"); const addButton = this.props.editing ? - ( + (
{ _t('Add a Room') } @@ -450,6 +452,7 @@ export default React.createClass({ }); }); this._groupStore.on('error', (err) => { + console.error(err); this.setState({ summary: null, error: err, @@ -601,6 +604,10 @@ export default React.createClass({ this._setPublicity(true); }, + _onAddRoomsClick: function() { + showGroupAddRoomDialog(this.props.groupId); + }, + _setPublicity: function(publicity) { this.setState({ publicityBusy: true, @@ -612,6 +619,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; @@ -790,6 +819,7 @@ export default React.createClass({ const GroupAvatar = sdk.getComponent("avatars.GroupAvatar"); const Loader = sdk.getComponent("elements.Spinner"); const TintableSvg = sdk.getComponent("elements.TintableSvg"); + const ScrollPanel = sdk.getComponent("structures.ScrollPanel"); if (this.state.summary === null && this.state.error === null || this.state.saving) { return ; @@ -799,7 +829,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 +886,15 @@ export default React.createClass({ width="18" height="18" alt={_t("Cancel")} /> , ); - roomBody =
-