custom tooltips for static analyser

pull/5370/head
Joseph Izang 2 years ago
parent 04b17201fa
commit b8935e70f7
  1. 21
      libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx

@ -16,30 +16,19 @@ const StaticAnalyserButton = ({
}: StaticAnalyserButtonProps) => {
let classList = "btn btn-sm w-25 btn-primary"
classList += disabled ? " disabled" : ""
const colorDisabled = "#007aa6"
const alternateColor = "#005e80"
const run = (e) => {
e.preventDefault()
e.stopPropagation()
}
return (
<button className={classList} disabled={disabled} onClick={onClick}>
<CustomTooltip
placement="bottom-start"
tooltipId="ssaRunButtonTooltip"
tooltipClasses="text-nowrap"
tooltipText={title}
>
<div data-id="staticAnalyserButton" className={classList} onClick={(e) => {
disabled ? run(e) : onClick(e)
}} style={{ backgroundColor: disabled ? alternateColor : colorDisabled, borderColor: disabled ? alternateColor : colorDisabled,
}}>
<button className="btn btn-link text-decoration-none" disabled={disabled} onClick={onClick} style={{ pointerEvents: "none"}} id="staticAnalyserButton" data-id="staticAnalyserButton">
<span>
{buttonText}
</span>
</button>
</div>
<span>
{buttonText}
</span>
</CustomTooltip>
</button>
)
}

Loading…
Cancel
Save