fix: improve

pull/7/head
VPcodebase 3 years ago
parent 88ae2f8f36
commit 857722bfcb
  1. 17
      src/web3/parseByteCode.tsx

@ -130,10 +130,9 @@ export const DisplaySignature = (props: any = {}) => {
if (!parsed || !event || !abi) { if (!parsed || !event || !abi) {
return <></>; return <></>;
} }
return ( return (
<Text size={"small"}> <>
{event.name}( {event.name}(
<> <>
{abi.inputs.map((input: any, i: number) => { {abi.inputs.map((input: any, i: number) => {
@ -148,18 +147,20 @@ export const DisplaySignature = (props: any = {}) => {
parsed[input.name].map((a: any, i: number) => { parsed[input.name].map((a: any, i: number) => {
return ( return (
<> <>
<Address key={a} address={a.toLowerCase()} /> <Address key={a} address={a?.toLowerCase()} />
{i < parsed[input.name].length - 1 && ", "} {i < parsed[input.name].length - 1 && ", "}
</> </>
); );
}) })
) : ( ) : parsed[input?.name?.toString()] ? (
<Address address={parsed[input.name].toLowerCase()} /> <Address
) address={parsed[input?.name?.toString()]?.toLowerCase()}
/>
) : null
) : Array.isArray(parsed[input.name]) ? ( ) : Array.isArray(parsed[input.name]) ? (
parsed[input.name].join(", ") parsed[input.name].join(", ")
) : ( ) : (
parsed[input.name].toString() parsed[input.name]
)} )}
{i < abi.inputs.length - 1 ? ", " : null} {i < abi.inputs.length - 1 ? ", " : null}
</div> </div>
@ -167,7 +168,7 @@ export const DisplaySignature = (props: any = {}) => {
})} })}
</> </>
) )
</Text> </>
); );
}; };

Loading…
Cancel
Save