diff --git a/src/components/views/rooms/EntityTile.tsx b/src/components/views/rooms/EntityTile.tsx index fedb0b2964..2032856500 100644 --- a/src/components/views/rooms/EntityTile.tsx +++ b/src/components/views/rooms/EntityTile.tsx @@ -25,7 +25,7 @@ import { replaceableComponent } from "../../../utils/replaceableComponent"; import BaseAvatar from '../avatars/BaseAvatar'; import PresenceLabel from "./PresenceLabel"; -enum PowerStatus { +export enum PowerStatus { Admin = "admin", Moderator = "moderator", } diff --git a/src/components/views/rooms/MemberTile.tsx b/src/components/views/rooms/MemberTile.tsx index 390cbdbf9f..c6077fb47f 100644 --- a/src/components/views/rooms/MemberTile.tsx +++ b/src/components/views/rooms/MemberTile.tsx @@ -27,6 +27,8 @@ import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { DeviceInfo } from "matrix-js-sdk/src/crypto"; +import EntityTile, { PowerStatus } from "./EntityTile"; +import MemberAvatar from "./../avatars/MemberAvatar"; interface IProps { member: RoomMember; @@ -212,9 +214,6 @@ export default class MemberTile extends React.Component { } render() { - const MemberAvatar = sdk.getComponent('avatars.MemberAvatar'); - const EntityTile = sdk.getComponent('rooms.EntityTile'); - const member = this.props.member; const name = this.getDisplayName(); const presenceState = member.user ? member.user.presence : null; @@ -234,8 +233,8 @@ export default class MemberTile extends React.Component { this.memberLastModifiedTime = member.getLastModifiedTime(); const powerStatusMap = new Map([ - [100, EntityTile.POWER_STATUS_ADMIN], - [50, EntityTile.POWER_STATUS_MODERATOR], + [100, PowerStatus.Admin], + [50, PowerStatus.Moderator], ]); // Find the nearest power level with a badge