diff --git a/frontend/components/buttons/RevealButton/RevealButton.tsx b/frontend/components/buttons/RevealButton/RevealButton.tsx index c1db68f9d9..c54d5a0010 100644 --- a/frontend/components/buttons/RevealButton/RevealButton.tsx +++ b/frontend/components/buttons/RevealButton/RevealButton.tsx @@ -13,6 +13,7 @@ export interface IRevealButtonProps { autofocus?: boolean; disabled?: boolean; tooltipContent?: React.ReactNode; + disabledTooltipContent?: React.ReactNode; onClick?: | ((value?: any) => void) | ((evt: React.MouseEvent) => void); @@ -29,6 +30,7 @@ const RevealButton = ({ autofocus, disabled, tooltipContent, + disabledTooltipContent, onClick, }: IRevealButtonProps): JSX.Element => { const classNames = classnames(baseClass, className); @@ -36,11 +38,12 @@ const RevealButton = ({ const buttonContent = () => { const text = isShowing ? hideText : showText; - const buttonText = tooltipContent ? ( - {text} - ) : ( - text - ); + const buttonText = + tooltipContent && !disabled ? ( + {text} + ) : ( + text + ); return ( <> @@ -61,7 +64,7 @@ const RevealButton = ({ ); }; - return ( + const button = (