Iterate EntityTile
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
8fb788ae56
commit
f08b92309f
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue