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

Commit

Permalink
Added invite option to room's context menu
Browse files Browse the repository at this point in the history
Signed-off-by: Jaiwanth <[email protected]>
  • Loading branch information
jaiwanth-v committed Feb 15, 2021
1 parent a87e637 commit f420c85
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
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"
/>
<IconizedContextMenuOption
onClick={this.onOpenRoomSettings}
label={_t("Settings")}
Expand Down

0 comments on commit f420c85

Please sign in to comment.