Skip to content

Commit a8a81a6

Browse files
fix(site): fix tooltip in start button group (coder#13497)
1 parent 44a70a5 commit a8a81a6

File tree

1 file changed

+16
-14
lines changed
  • site/src/pages/WorkspacePage/WorkspaceActions

1 file changed

+16
-14
lines changed

site/src/pages/WorkspacePage/WorkspaceActions/Buttons.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,21 @@ export const StartButton: FC<ActionButtonPropsWithWorkspace> = ({
6363
disabled,
6464
tooltipText,
6565
}) => {
66-
const buttonContent = (
66+
let mainButton = (
67+
<TopbarButton
68+
startIcon={<PlayCircleOutlineIcon />}
69+
onClick={() => handleAction()}
70+
disabled={disabled || loading}
71+
>
72+
{loading ? <>Starting&hellip;</> : "Start"}
73+
</TopbarButton>
74+
);
75+
76+
if (tooltipText) {
77+
mainButton = <Tooltip title={tooltipText}>{mainButton}</Tooltip>;
78+
}
79+
80+
return (
6781
<ButtonGroup
6882
variant="outlined"
6983
sx={{
@@ -74,13 +88,7 @@ export const StartButton: FC<ActionButtonPropsWithWorkspace> = ({
7488
}}
7589
disabled={disabled}
7690
>
77-
<TopbarButton
78-
startIcon={<PlayCircleOutlineIcon />}
79-
onClick={() => handleAction()}
80-
disabled={disabled || loading}
81-
>
82-
{loading ? <>Starting&hellip;</> : "Start"}
83-
</TopbarButton>
91+
{mainButton}
8492
<BuildParametersPopover
8593
label="Start with build parameters"
8694
workspace={workspace}
@@ -89,12 +97,6 @@ export const StartButton: FC<ActionButtonPropsWithWorkspace> = ({
8997
/>
9098
</ButtonGroup>
9199
);
92-
93-
return tooltipText ? (
94-
<Tooltip title={tooltipText}>{buttonContent}</Tooltip>
95-
) : (
96-
buttonContent
97-
);
98100
};
99101

100102
export const StopButton: FC<ActionButtonProps> = ({

0 commit comments

Comments
 (0)