diff --git a/src/components/views/rooms/EntityTile.tsx b/src/components/views/rooms/EntityTile.tsx index de37d6caf0..fedb0b2964 100644 --- a/src/components/views/rooms/EntityTile.tsx +++ b/src/components/views/rooms/EntityTile.tsx @@ -31,8 +31,8 @@ enum PowerStatus { } const PowerLabel: Record = { - "admin": _td("Admin"), - "moderator": _td("Mod"), + [PowerStatus.Admin]: _td("Admin"), + [PowerStatus.Moderator]: _td("Mod"), } const PRESENCE_CLASS = { @@ -84,7 +84,7 @@ interface IState { } @replaceableComponent("views.rooms.EntityTile") -export default class EntityTile extends React.Component { +export default class EntityTile extends React.PureComponent { static defaultProps = { onClick: () => {}, presenceState: "offline", @@ -103,10 +103,6 @@ export default class EntityTile extends React.Component { }; } - shouldComponentUpdate(nextProps: IProps, nextState: IState) { - if (this.state.hover !== nextState.hover) return true; - } - render() { const mainClassNames = { "mx_EntityTile": true,