Iterate EntityTile

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-06-24 16:35:33 +02:00
parent 8fb788ae56
commit f08b92309f
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 3 additions and 7 deletions

View File

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