bring invite buttons back in group member / room list
also put filter field on bottom
This commit is contained in:
parent
f4e61b2bf1
commit
dbe5449d0c
3 changed files with 48 additions and 22 deletions
|
@ -192,26 +192,6 @@ export default class RightPanel extends React.Component {
|
||||||
panel = <FilePanel roomId={this.props.roomId} />;
|
panel = <FilePanel roomId={this.props.roomId} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: either include this in the DOM again, or move it to other component
|
|
||||||
if (this.props.groupId && this.state.isUserPrivilegedInGroup) {
|
|
||||||
// inviteGroup =
|
|
||||||
isPhaseGroup ? (
|
|
||||||
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteToGroupButtonClick}>
|
|
||||||
<div className="mx_RightPanel_icon" >
|
|
||||||
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />
|
|
||||||
</div>
|
|
||||||
<div className="mx_RightPanel_message">{ _t('Invite to this community') }</div>
|
|
||||||
</AccessibleButton>
|
|
||||||
) : (
|
|
||||||
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onAddRoomToGroupButtonClick}>
|
|
||||||
<div className="mx_RightPanel_icon" >
|
|
||||||
<TintableSvg src="img/icons-room-add.svg" width="35" height="35" />
|
|
||||||
</div>
|
|
||||||
<div className="mx_RightPanel_message">{ _t('Add rooms to this community') }</div>
|
|
||||||
</AccessibleButton>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const classes = classNames("mx_RightPanel", "mx_fadable", {
|
const classes = classNames("mx_RightPanel", "mx_fadable", {
|
||||||
"collapsed": this.props.collapsed,
|
"collapsed": this.props.collapsed,
|
||||||
"mx_fadable_faded": this.props.disabled,
|
"mx_fadable_faded": this.props.disabled,
|
||||||
|
|
|
@ -19,6 +19,9 @@ import { _t } from '../../../languageHandler';
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
import GroupStore from '../../../stores/GroupStore';
|
import GroupStore from '../../../stores/GroupStore';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { showGroupInviteDialog } from '../../../GroupAddressPicker';
|
||||||
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
import TintableSvg from '../elements/TintableSvg';
|
||||||
|
|
||||||
const INITIAL_LOAD_NUM_MEMBERS = 30;
|
const INITIAL_LOAD_NUM_MEMBERS = 30;
|
||||||
|
|
||||||
|
@ -135,6 +138,16 @@ export default React.createClass({
|
||||||
</TruncatedList>;
|
</TruncatedList>;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onInviteToGroupButtonClick() {
|
||||||
|
showGroupInviteDialog(this.props.groupId).then(() => {
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'view_right_panel_phase',
|
||||||
|
phase: RightPanel.Phase.GroupMemberList,
|
||||||
|
groupId: this.props.groupId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
|
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
|
||||||
if (this.state.fetching || this.state.fetchingInvitedMembers) {
|
if (this.state.fetching || this.state.fetchingInvitedMembers) {
|
||||||
|
@ -162,13 +175,27 @@ export default React.createClass({
|
||||||
{ this.makeGroupMemberTiles(this.state.searchQuery, this.state.invitedMembers) }
|
{ this.makeGroupMemberTiles(this.state.searchQuery, this.state.invitedMembers) }
|
||||||
</div> : <div />;
|
</div> : <div />;
|
||||||
|
|
||||||
|
let inviteButton;
|
||||||
|
if (GroupStore.isUserPrivileged(this.props.groupId)) {
|
||||||
|
inviteButton = (<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteToGroupButtonClick}>
|
||||||
|
<div className="mx_RightPanel_icon" >
|
||||||
|
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />
|
||||||
|
</div>
|
||||||
|
<div className="mx_RightPanel_message">{ _t('Invite to this community') }</div>
|
||||||
|
</AccessibleButton>);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="mx_MemberList">
|
<div className="mx_MemberList">
|
||||||
{ inputBox }
|
{ inviteButton }
|
||||||
<GeminiScrollbarWrapper autoshow={true}>
|
<GeminiScrollbarWrapper autoshow={true}>
|
||||||
{ joined }
|
{ joined }
|
||||||
{ invited }
|
{ invited }
|
||||||
</GeminiScrollbarWrapper>
|
</GeminiScrollbarWrapper>
|
||||||
|
{ inputBox }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,6 +18,9 @@ import { _t } from '../../../languageHandler';
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
import GroupStore from '../../../stores/GroupStore';
|
import GroupStore from '../../../stores/GroupStore';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { showGroupAddRoomDialog } from '../../../GroupAddressPicker';
|
||||||
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
import TintableSvg from '../elements/TintableSvg';
|
||||||
|
|
||||||
const INITIAL_LOAD_NUM_ROOMS = 30;
|
const INITIAL_LOAD_NUM_ROOMS = 30;
|
||||||
|
|
||||||
|
@ -90,6 +93,12 @@ export default React.createClass({
|
||||||
this.setState({ searchQuery: ev.target.value });
|
this.setState({ searchQuery: ev.target.value });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onAddRoomToGroupButtonClick() {
|
||||||
|
showGroupAddRoomDialog(this.props.groupId).then(() => {
|
||||||
|
this.forceUpdate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
makeGroupRoomTiles: function(query) {
|
makeGroupRoomTiles: function(query) {
|
||||||
const GroupRoomTile = sdk.getComponent("groups.GroupRoomTile");
|
const GroupRoomTile = sdk.getComponent("groups.GroupRoomTile");
|
||||||
query = (query || "").toLowerCase();
|
query = (query || "").toLowerCase();
|
||||||
|
@ -120,6 +129,15 @@ export default React.createClass({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let inviteButton;
|
||||||
|
if (GroupStore.isUserPrivileged(this.props.groupId)) {
|
||||||
|
inviteButton = (<AccessibleButton className="mx_RightPanel_invite" onClick={this.onAddRoomToGroupButtonClick}>
|
||||||
|
<div className="mx_RightPanel_icon" >
|
||||||
|
<TintableSvg src="img/icons-room-add.svg" width="35" height="35" />
|
||||||
|
</div>
|
||||||
|
<div className="mx_RightPanel_message">{ _t('Add rooms to this community') }</div>
|
||||||
|
</AccessibleButton>);
|
||||||
|
}
|
||||||
const inputBox = (
|
const inputBox = (
|
||||||
<form autoComplete="off">
|
<form autoComplete="off">
|
||||||
<input className="mx_GroupRoomList_query" id="mx_GroupRoomList_query" type="text"
|
<input className="mx_GroupRoomList_query" id="mx_GroupRoomList_query" type="text"
|
||||||
|
@ -132,13 +150,14 @@ export default React.createClass({
|
||||||
const TruncatedList = sdk.getComponent("elements.TruncatedList");
|
const TruncatedList = sdk.getComponent("elements.TruncatedList");
|
||||||
return (
|
return (
|
||||||
<div className="mx_GroupRoomList">
|
<div className="mx_GroupRoomList">
|
||||||
{ inputBox }
|
{ inviteButton }
|
||||||
<GeminiScrollbarWrapper autoshow={true} className="mx_GroupRoomList_joined mx_GroupRoomList_outerWrapper">
|
<GeminiScrollbarWrapper autoshow={true} className="mx_GroupRoomList_joined mx_GroupRoomList_outerWrapper">
|
||||||
<TruncatedList className="mx_GroupRoomList_wrapper" truncateAt={this.state.truncateAt}
|
<TruncatedList className="mx_GroupRoomList_wrapper" truncateAt={this.state.truncateAt}
|
||||||
createOverflowElement={this._createOverflowTile}>
|
createOverflowElement={this._createOverflowTile}>
|
||||||
{ this.makeGroupRoomTiles(this.state.searchQuery) }
|
{ this.makeGroupRoomTiles(this.state.searchQuery) }
|
||||||
</TruncatedList>
|
</TruncatedList>
|
||||||
</GeminiScrollbarWrapper>
|
</GeminiScrollbarWrapper>
|
||||||
|
{ inputBox }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue