add tooltip to the run buton

pull/3005/head
Joseph Izang 2 years ago
parent 62a6f4d001
commit 155edaa3dd
  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 React from 'react' //eslint-disable-line
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
interface StaticAnalyserButtonProps { interface StaticAnalyserButtonProps {
onClick: (event) => void onClick: (event) => void
@ -14,10 +15,21 @@ const StaticAnalyserButton = ({
title title
}: StaticAnalyserButtonProps) => { }: StaticAnalyserButtonProps) => {
let classList = "btn btn-sm w-25 btn-primary" let classList = "btn btn-sm w-25 btn-primary"
classList += disabled ? " disabled" : "" classList += disabled ? " disabled" : ""
return ( return (
<button className={classList} disabled={disabled} title={title} onClick={onClick}> <button className={classList} disabled={disabled} onClick={onClick}>
{buttonText} <OverlayTrigger
placement="bottom-start"
overlay={
<Tooltip id="ssaRunButtonTooltip" className="text-nowrap">
<span>{title}</span>
</Tooltip>
}
>
<span>
{buttonText}
</span>
</OverlayTrigger>
</button> </button>
) )
} }

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

Loading…
Cancel
Save