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 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>
); );