Iterate EntityTile

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Š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

View file

@ -31,8 +31,8 @@ enum PowerStatus {
}
const PowerLabel: Record<PowerStatus, string> = {
"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<IProps, IState> {
export default class EntityTile extends React.PureComponent<IProps, IState> {
static defaultProps = {
onClick: () => {},
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() {
const mainClassNames = {
"mx_EntityTile": true,