mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Clean up in hotbar entity icon
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
8a70b5c7d9
commit
7e6e6976eb
@ -95,17 +95,6 @@ class NonInjectedHotbarEntityIcon extends React.Component<HotbarEntityIconProps
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get entityBackground() {
|
|
||||||
const { entity, getClusterById } = this.props;
|
|
||||||
const cluster = getClusterById(entity.metadata.uid);
|
|
||||||
|
|
||||||
if (cluster) {
|
|
||||||
return cluster.preferences?.iconBackgroundColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
return entity.spec.icon?.background;
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { entity, className, onClick } = this.props;
|
const { entity, className, onClick } = this.props;
|
||||||
|
|
||||||
@ -116,7 +105,7 @@ class NonInjectedHotbarEntityIcon extends React.Component<HotbarEntityIconProps
|
|||||||
source={entity.metadata.source}
|
source={entity.metadata.source}
|
||||||
src={entity.spec.icon?.src}
|
src={entity.spec.icon?.src}
|
||||||
material={entity.spec.icon?.material}
|
material={entity.spec.icon?.material}
|
||||||
background={this.entityBackground}
|
background={entity.spec.icon?.background}
|
||||||
className={className}
|
className={className}
|
||||||
active={this.isActive(entity)}
|
active={this.isActive(entity)}
|
||||||
onMenuOpen={() => this.onMenuOpen()}
|
onMenuOpen={() => this.onMenuOpen()}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user