Rip hover support out of the RoomTile component

It's all handled by CSS and this literally does nothing but spam renders.
This commit is contained in:
Travis Ralston 2020-07-24 13:10:39 -06:00
parent 37035f945b
commit c3623f439c

View file

@ -67,7 +67,6 @@ interface IProps {
type PartialDOMRect = Pick<DOMRect, "left" | "bottom">; type PartialDOMRect = Pick<DOMRect, "left" | "bottom">;
interface IState { interface IState {
hover: boolean;
notificationState: NotificationState; notificationState: NotificationState;
selected: boolean; selected: boolean;
notificationsMenuPosition: PartialDOMRect; notificationsMenuPosition: PartialDOMRect;
@ -119,7 +118,6 @@ export default class RoomTile extends React.Component<IProps, IState> {
super(props); super(props);
this.state = { this.state = {
hover: false,
notificationState: RoomNotificationStateStore.instance.getRoomState(this.props.room), notificationState: RoomNotificationStateStore.instance.getRoomState(this.props.room),
selected: ActiveRoomObserver.activeRoomId === this.props.room.roomId, selected: ActiveRoomObserver.activeRoomId === this.props.room.roomId,
notificationsMenuPosition: null, notificationsMenuPosition: null,
@ -206,14 +204,6 @@ export default class RoomTile extends React.Component<IProps, IState> {
}); });
}; };
private onTileMouseEnter = () => {
this.setState({hover: true});
};
private onTileMouseLeave = () => {
this.setState({hover: false});
};
private onTileClick = (ev: React.KeyboardEvent) => { private onTileClick = (ev: React.KeyboardEvent) => {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
@ -592,8 +582,6 @@ export default class RoomTile extends React.Component<IProps, IState> {
tabIndex={isActive ? 0 : -1} tabIndex={isActive ? 0 : -1}
inputRef={ref} inputRef={ref}
className={classes} className={classes}
onMouseEnter={this.onTileMouseEnter}
onMouseLeave={this.onTileMouseLeave}
onClick={this.onTileClick} onClick={this.onTileClick}
onContextMenu={this.onContextMenu} onContextMenu={this.onContextMenu}
role="treeitem" role="treeitem"