add tooltip to the run buton

pull/5370/head
Joseph Izang 2 years ago
parent f1d1b10ec5
commit 4e850582c6
  1. 18
      libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx
  2. 4
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -1,4 +1,5 @@
import React from 'react' //eslint-disable-line
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
interface StaticAnalyserButtonProps {
onClick: (event) => void
@ -14,10 +15,21 @@ const StaticAnalyserButton = ({
title
}: StaticAnalyserButtonProps) => {
let classList = "btn btn-sm w-25 btn-primary"
classList += disabled ? " disabled" : ""
classList += disabled ? " disabled" : ""
return (
<button className={classList} disabled={disabled} title={title} onClick={onClick}>
{buttonText}
<button className={classList} disabled={disabled} onClick={onClick}>
<OverlayTrigger
placement="bottom-start"
overlay={
<Tooltip id="ssaRunButtonTooltip" className="text-nowrap">
<span>{title}</span>
</Tooltip>
}
>
<span>
{buttonText}
</span>
</OverlayTrigger>
</button>
)
}

@ -255,7 +255,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
if(fileName !== currentFile) {
const {file, provider} = await props.analysisModule.call('fileManager', 'getPathFromUrl', fileName)
if (file.startsWith('.deps') || (provider.type === 'localhost' && file.startsWith('localhost/node_modules'))) isLibrary = true
}
}
const msg = message(result.name, item.warning, item.more, fileName, locationString)
const options = {
type: 'warning',
@ -321,7 +321,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
if(fileName !== currentFile) {
const {file, provider} = await props.analysisModule.call('fileManager', 'getPathFromUrl', fileName)
if (file.startsWith('.deps') || (provider.type === 'localhost' && file.startsWith('localhost/node_modules'))) isLibrary = true
}
}
const msg = message(item.title, item.description, item.more, fileName, locationString)
const options = {
type: 'warning',

Loading…
Cancel
Save