add copyButton to abi and bytecode thing
This commit is contained in:
parent
bd4f4726b3
commit
29fb9fbe80
|
@ -2,7 +2,9 @@ import PropTypes from "prop-types";
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Row, Col, Table} from "reactstrap";
|
import {Row, Col, Table} from "reactstrap";
|
||||||
import JSONTree from 'react-json-tree';
|
import JSONTree from 'react-json-tree';
|
||||||
|
import GasStationContainer from "../containers/GasStationContainer";
|
||||||
import {formatContractForDisplay} from '../utils/presentation';
|
import {formatContractForDisplay} from '../utils/presentation';
|
||||||
|
import CopyButton from './CopyButton';
|
||||||
|
|
||||||
const Contract = ({contract}) => {
|
const Contract = ({contract}) => {
|
||||||
const contractDisplay = formatContractForDisplay(contract);
|
const contractDisplay = formatContractForDisplay(contract);
|
||||||
|
@ -29,13 +31,18 @@ const Contract = ({contract}) => {
|
||||||
</tbody>
|
</tbody>
|
||||||
</Table>
|
</Table>
|
||||||
<h2>ABI</h2>
|
<h2>ABI</h2>
|
||||||
<div>
|
<div className="relative">
|
||||||
{contract.abiDefinition && <JSONTree data={contract.abiDefinition} />}
|
<CopyButton text={contract.runtimeBytecode}
|
||||||
|
title="Copy bytecode to clipboard"/>
|
||||||
|
{contract.abiDefinition && <JSONTree data={contract.abiDefinition}/>}
|
||||||
</div>
|
</div>
|
||||||
<h2>Bytecode</h2>
|
<h2>Bytecode</h2>
|
||||||
<div className="text-wrap">
|
<div className="text-wrap logs relative">
|
||||||
|
<CopyButton text={contract.runtimeBytecode}
|
||||||
|
title="Copy bytecode to clipboard"/>
|
||||||
{contract.runtimeBytecode}
|
{contract.runtimeBytecode}
|
||||||
</div>
|
</div>
|
||||||
|
<GasStationContainer/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue