Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Added invite option to room's context menu #5648

Merged
merged 6 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions res/css/views/rooms/_RoomTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ limitations under the License.
.mx_RoomTile_iconSettings::before {
mask-image: url('$(res)/img/element-icons/settings.svg');
}

.mx_RoomTile_iconInvite::before {
mask-image: url('$(res)/img/element-icons/room/invite.svg');
}

.mx_RoomTile_iconSignOut::before {
mask-image: url('$(res)/img/element-icons/leave.svg');
Expand Down
17 changes: 16 additions & 1 deletion src/components/views/rooms/RoomTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,17 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
this.setState({generalMenuPosition: null}); // hide the menu
};

private onInviteClick = (ev: ButtonEvent) => {
ev.preventDefault();
ev.stopPropagation();

dis.dispatch({
action: 'view_invite',
roomId: this.props.room.roomId,
});
this.setState({generalMenuPosition: null}); // hide the menu
};

private async saveNotifState(ev: ButtonEvent, newState: Volume) {
ev.preventDefault();
ev.stopPropagation();
Expand Down Expand Up @@ -470,7 +481,11 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
label={lowPriorityLabel}
iconClassName="mx_RoomTile_iconArrowDown"
/>

<IconizedContextMenuOption
onClick={this.onInviteClick}
label={_t("Invite to this room")}
iconClassName="mx_RoomTile_iconInvite"
/>
jaiwanth-v marked this conversation as resolved.
Show resolved Hide resolved
<IconizedContextMenuOption
onClick={this.onOpenRoomSettings}
label={_t("Settings")}
Expand Down