1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

add tooltip to hotbar index

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-04-23 10:21:18 +03:00
parent b20bedfbae
commit e6310cb4a4

View File

@ -12,6 +12,7 @@ import { Icon } from "../icon";
import { Badge } from "../badge";
import { CommandOverlay } from "../command-palette";
import { HotbarSwitchCommand } from "./hotbar-switch-command";
import { Tooltip, TooltipPosition } from "../tooltip";
interface Props {
className?: IClassName;
@ -43,6 +44,7 @@ export class HotbarMenu extends React.Component<Props> {
render() {
const { className } = this.props;
const hotbar = HotbarStore.getInstance();
const hotbarIndex = HotbarStore.getInstance().activeHotbarIndex + 1;
return (
@ -63,7 +65,13 @@ export class HotbarMenu extends React.Component<Props> {
<div className="HotbarSelector flex gaps auto">
<Icon material="chevron_left" className="previous box" onClick={() => this.previous()} />
<div className="box">
<Badge small label={hotbarIndex} onClick={() => this.openSelector()} />
<Badge id="hotbarIndex" small label={hotbarIndex} onClick={() => this.openSelector()} />
<Tooltip
targetId="hotbarIndex"
preferredPositions={TooltipPosition.TOP}
>
{hotbar.name}
</Tooltip>
</div>
<Icon material="chevron_right" className="next box" onClick={() => this.next()} />
</div>