|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
import React from "react" |
|
|
|
|
import { CustomTooltip } from '@remix-ui/helper' |
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
|
text: string |
|
|
|
@ -14,26 +15,33 @@ export const SubmitButton: React.FC<Props> = ({ |
|
|
|
|
disable = true |
|
|
|
|
}) => { |
|
|
|
|
return ( |
|
|
|
|
<button |
|
|
|
|
data-id={dataId} |
|
|
|
|
style={{ padding: "0.25rem 0.4rem", marginRight: "0.5em" }} |
|
|
|
|
type="submit" |
|
|
|
|
className="btn btn-primary" |
|
|
|
|
disabled={disable} |
|
|
|
|
<CustomTooltip |
|
|
|
|
tooltipText={disable ? "Fill the fields with valid values" : "Click to proceed"} |
|
|
|
|
tooltipId='etherscan-submit-button' |
|
|
|
|
placement='bottom' |
|
|
|
|
> |
|
|
|
|
{!isSubmitting && text} |
|
|
|
|
|
|
|
|
|
{isSubmitting && ( |
|
|
|
|
<div> |
|
|
|
|
<span |
|
|
|
|
className="spinner-border spinner-border-sm" |
|
|
|
|
role="status" |
|
|
|
|
aria-hidden="true" |
|
|
|
|
style={{ marginRight: "0.3em" }} |
|
|
|
|
/> |
|
|
|
|
Verifying... Please wait |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
</button> |
|
|
|
|
<div> |
|
|
|
|
<button |
|
|
|
|
data-id={dataId} |
|
|
|
|
style={{ padding: "0.25rem 0.4rem", marginRight: "0.5em", pointerEvents: 'none' }} |
|
|
|
|
type="submit" |
|
|
|
|
className="btn btn-primary btn-block text-decoration-none" |
|
|
|
|
disabled={disable} |
|
|
|
|
> |
|
|
|
|
{!isSubmitting && text} |
|
|
|
|
{isSubmitting && ( |
|
|
|
|
<div> |
|
|
|
|
<span |
|
|
|
|
className="spinner-border spinner-border-sm" |
|
|
|
|
role="status" |
|
|
|
|
aria-hidden="true" |
|
|
|
|
style={{ marginRight: "0.3em" }} |
|
|
|
|
/> |
|
|
|
|
Verifying... Please wait |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|