Skip to content

Commit

Permalink
Merge pull request #118 from chromaui/ghengeveld/ap-3681-always-displ…
Browse files Browse the repository at this point in the history
…ay-mode-even-when-there-is-only-one

Show label even when there is only one mode
  • Loading branch information
tmeasday authored Sep 21, 2023
2 parents f07ea40 + b1dae5b commit d0f95ab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/ModeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { StatusDot, StatusDotWrapper } from "./StatusDot";
import { TooltipMenu } from "./TooltipMenu";

const IconWrapper = styled.div(({ theme }) => ({
display: "inline-flex",
alignItems: "center",
gap: 6,
height: 14,
margin: "7px 7px",
color: `${theme.color.defaultText}99`,
Expand Down Expand Up @@ -57,7 +60,9 @@ export const ModeSelector = ({
hasChrome={false}
placement="top"
trigger="hover"
tooltip={<TooltipNote note={links ? "Switch mode" : `View mode: ${modeResults[0].mode}`} />}
tooltip={
<TooltipNote note={links ? "Switch mode" : `View mode: ${modeResults[0].mode.name}`} />
}
>
{links ? (
<TooltipMenu placement="bottom" links={links}>
Expand All @@ -66,7 +71,10 @@ export const ModeSelector = ({
<ArrowIcon icon="arrowdown" />
</TooltipMenu>
) : (
<IconWrapper>{icon}</IconWrapper>
<IconWrapper>
{icon}
{selectedMode.name}
</IconWrapper>
)}
</WithTooltip>
);
Expand Down

0 comments on commit d0f95ab

Please sign in to comment.