From f08b92309f95f018fcc7cd972a3ca16577df5196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 24 Jun 2021 16:35:33 +0200 Subject: [PATCH] Iterate EntityTile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/EntityTile.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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,