error in red, info in green

pull/3606/head
Aniket-Engg 2 years ago committed by Aniket
parent 268f467c3f
commit d9ea58a73e
  1. 2
      apps/etherscan/src/app/views/CaptureKeyView.tsx
  2. 12
      apps/etherscan/src/app/views/VerifyView.tsx

@ -43,7 +43,7 @@ export const CaptureKeyView: React.FC = () => {
} }
type="password" type="password"
name="apiKey" name="apiKey"
placeholder="Example: GM1T20XY6JGSAPWKDCYZ7B2FJXKTJRFVGZ" placeholder="e.g. GM1T20XY6JGSAPWKDCYZ7B2FJXKTJRFVGZ"
/> />
<ErrorMessage <ErrorMessage
className="invalid-feedback" className="invalid-feedback"

@ -1,4 +1,4 @@
import React, { useState } from "react" import React, { useRef, useState } from "react"
import { import {
PluginClient, PluginClient,
@ -30,6 +30,7 @@ export const VerifyView: React.FC<Props> = ({
onVerifiedContract, onVerifiedContract,
}) => { }) => {
const [results, setResults] = useState("") const [results, setResults] = useState("")
const verificationResult = useRef({})
const onVerifyContract = async (values: FormValues) => { const onVerifyContract = async (values: FormValues) => {
const compilationResult = (await client.call( const compilationResult = (await client.call(
@ -43,7 +44,7 @@ export const VerifyView: React.FC<Props> = ({
const contractArguments = values.contractArguments.replace("0x", "") const contractArguments = values.contractArguments.replace("0x", "")
const verificationResult = await verify( verificationResult.current = await verify(
apiKey, apiKey,
values.contractAddress, values.contractAddress,
contractArguments, contractArguments,
@ -53,8 +54,7 @@ export const VerifyView: React.FC<Props> = ({
onVerifiedContract, onVerifiedContract,
setResults, setResults,
) )
setResults(verificationResult.current['message'])
setResults(verificationResult.message)
} }
return ( return (
@ -139,7 +139,7 @@ export const VerifyView: React.FC<Props> = ({
} }
type="text" type="text"
name="contractAddress" name="contractAddress"
placeholder="e.g; 0x11b79afc03baf25c631dd70169bb6a3160b2706e" placeholder="e.g. 0x11b79afc03baf25c631dd70169bb6a3160b2706e"
/> />
<ErrorMessage <ErrorMessage
className="invalid-feedback" className="invalid-feedback"
@ -178,7 +178,7 @@ export const VerifyView: React.FC<Props> = ({
</Formik> </Formik>
<div data-id="verify-result" <div data-id="verify-result"
style={{ marginTop: "2em", fontSize: "0.8em", textAlign: "center" }} style={{ marginTop: "2em", fontSize: "0.8em", textAlign: "center", color: verificationResult.current['succeed'] ? "green" : "red" }}
dangerouslySetInnerHTML={{ __html: results }} dangerouslySetInnerHTML={{ __html: results }}
/> />

Loading…
Cancel
Save