add tooltip

pull/5270/head
yann300 1 month ago committed by Aniket
parent afe5594de5
commit a3496cfe8d
  1. 35
      apps/vyper/src/app/components/CompilerButton.tsx

@ -1,4 +1,5 @@
import React, { Fragment, useEffect, useState } from 'react'
import { CustomTooltip } from "@remix-ui/helper";
import { isVyper, compile, toStandardOutput, isCompilationError, remixClient, normalizeContractPath, compileContract, RemixClient } from '../utils'
import Button from 'react-bootstrap/Button'
@ -26,21 +27,27 @@ function CompilerButton({ contract, setOutput, compilerUrl, resetCompilerState,
return (
<Fragment>
<button data-id="compile"
onClick={async () => {
setLoadingSpinnerState(true)
await compileContract(contract, compilerUrl, setOutput, setLoadingSpinnerState)
}}
className="btn btn-primary w-100 d-block btn-block text-break remixui_disabled mb-1 mt-3"
>
<div className="d-flex align-items-center justify-content-center fa-1x">
<span className={ loadingSpinner ? 'fas fa-sync fa-pulse mr-1' : 'fas fa-sync mr-1'} />
<div className="text-truncate overflow-hidden text-nowrap">
<span>Compile</span>
<span className="ml-1 text-nowrap">{contract}</span>
<CustomTooltip
placement="auto"
tooltipId="overlay-tooltip-compile"
tooltipText={contract}
>
<button data-id="compile"
onClick={async () => {
setLoadingSpinnerState(true)
await compileContract(contract, compilerUrl, setOutput, setLoadingSpinnerState)
}}
className="btn btn-primary w-100 d-block btn-block text-break remixui_disabled mb-1 mt-3"
>
<div className="d-flex align-items-center justify-content-center fa-1x">
<span className={ loadingSpinner ? 'fas fa-sync fa-pulse mr-1' : 'fas fa-sync mr-1'} />
<div className="text-truncate overflow-hidden text-nowrap">
<span>Compile</span>
<span className="ml-1 text-nowrap">{contract}</span>
</div>
</div>
</div>
</button>
</button>
</CustomTooltip>
</Fragment>
)
}

Loading…
Cancel
Save