1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

Wire up the invite button

This commit is contained in:
Travis Ralston
2020-08-28 20:08:12 -06:00
parent 35e4d89545
commit 275ff6b41e
2 changed files with 5 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import { _t } from './languageHandler';
import {KIND_DM, KIND_INVITE} from "./components/views/dialogs/InviteDialog"; import {KIND_DM, KIND_INVITE} from "./components/views/dialogs/InviteDialog";
import CommunityPrototypeInviteDialog from "./components/views/dialogs/CommunityPrototypeInviteDialog"; import CommunityPrototypeInviteDialog from "./components/views/dialogs/CommunityPrototypeInviteDialog";
import GroupStore from "./stores/GroupStore"; import GroupStore from "./stores/GroupStore";
import {CommunityPrototypeStore} from "./stores/CommunityPrototypeStore";
/** /**
* Invites multiple addresses to a room * Invites multiple addresses to a room
@ -76,7 +77,7 @@ export function showCommunityInviteDialog(communityId) {
}); });
if (!chat) chat = rooms[0]; if (!chat) chat = rooms[0];
if (chat) { if (chat) {
const name = CommunityPrototypeInviteDialog.instance.getCommunityName(communityId); const name = CommunityPrototypeStore.instance.getCommunityName(communityId);
showCommunityRoomInviteDialog(chat.roomId, name); showCommunityRoomInviteDialog(chat.roomId, name);
} else { } else {
throw new Error("Failed to locate appropriate room to start an invite in"); throw new Error("Failed to locate appropriate room to start an invite in");

View File

@ -45,6 +45,7 @@ import IconizedContextMenu, {
import { CommunityPrototypeStore } from "../../stores/CommunityPrototypeStore"; import { CommunityPrototypeStore } from "../../stores/CommunityPrototypeStore";
import * as fbEmitter from "fbemitter"; import * as fbEmitter from "fbemitter";
import TagOrderStore from "../../stores/TagOrderStore"; import TagOrderStore from "../../stores/TagOrderStore";
import { showCommunityInviteDialog } from "../../RoomInvite";
interface IProps { interface IProps {
isMinimized: boolean; isMinimized: boolean;
@ -217,7 +218,8 @@ export default class UserMenu extends React.Component<IProps, IState> {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
console.log("TODO@onCommunityInviteClick"); showCommunityInviteDialog(TagOrderStore.getSelectedPrototypeTag());
this.setState({contextMenuPosition: null}); // also close the menu
}; };
private renderContextMenu = (): React.ReactNode => { private renderContextMenu = (): React.ReactNode => {