From 4c11d21f3a5ee7fafa7076c46d4ac147ca6c092c Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 6 Jun 2024 17:24:56 +0000 Subject: [PATCH] fix(site): fix tooltip in start button group --- .../WorkspaceActions/Buttons.tsx | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/site/src/pages/WorkspacePage/WorkspaceActions/Buttons.tsx b/site/src/pages/WorkspacePage/WorkspaceActions/Buttons.tsx index caa034d77c29f..ecfde9e97aa9b 100644 --- a/site/src/pages/WorkspacePage/WorkspaceActions/Buttons.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceActions/Buttons.tsx @@ -63,7 +63,21 @@ export const StartButton: FC = ({ disabled, tooltipText, }) => { - const buttonContent = ( + let mainButton = ( + } + onClick={() => handleAction()} + disabled={disabled || loading} + > + {loading ? <>Starting… : "Start"} + + ); + + if (tooltipText) { + mainButton = {mainButton}; + } + + return ( = ({ }} disabled={disabled} > - } - onClick={() => handleAction()} - disabled={disabled || loading} - > - {loading ? <>Starting… : "Start"} - + {mainButton} = ({ /> ); - - return tooltipText ? ( - {buttonContent} - ) : ( - buttonContent - ); }; export const StopButton: FC = ({