add copyButton to abi and bytecode thing

This commit is contained in:
Jonathan Rainville 2018-10-18 17:05:39 -04:00 committed by Pascal Precht
parent bd4f4726b3
commit 29fb9fbe80
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 10 additions and 3 deletions

View File

@ -2,7 +2,9 @@ import PropTypes from "prop-types";
import React from 'react';
import {Row, Col, Table} from "reactstrap";
import JSONTree from 'react-json-tree';
import GasStationContainer from "../containers/GasStationContainer";
import {formatContractForDisplay} from '../utils/presentation';
import CopyButton from './CopyButton';
const Contract = ({contract}) => {
const contractDisplay = formatContractForDisplay(contract);
@ -29,13 +31,18 @@ const Contract = ({contract}) => {
</tbody>
</Table>
<h2>ABI</h2>
<div>
{contract.abiDefinition && <JSONTree data={contract.abiDefinition} />}
<div className="relative">
<CopyButton text={contract.runtimeBytecode}
title="Copy bytecode to clipboard"/>
{contract.abiDefinition && <JSONTree data={contract.abiDefinition}/>}
</div>
<h2>Bytecode</h2>
<div className="text-wrap">
<div className="text-wrap logs relative">
<CopyButton text={contract.runtimeBytecode}
title="Copy bytecode to clipboard"/>
{contract.runtimeBytecode}
</div>
<GasStationContainer/>
</Col>
</Row>
);