From 627fec5b49f37d0201ee9ed8f6aeb2004a901158 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Thu, 18 Oct 2018 15:22:44 +0100 Subject: [PATCH] Use cards in contract deployment --- .../src/components/ContractsDeployment.js | 144 ++++++++---------- 1 file changed, 67 insertions(+), 77 deletions(-) diff --git a/embark-ui/src/components/ContractsDeployment.js b/embark-ui/src/components/ContractsDeployment.js index c1adfe58..1e8c35af 100644 --- a/embark-ui/src/components/ContractsDeployment.js +++ b/embark-ui/src/components/ContractsDeployment.js @@ -11,13 +11,15 @@ import { Button, Card, CardHeader, + CardTitle, CardBody } from 'reactstrap'; import classNames from 'classnames'; import {DEPLOYMENT_PIPELINES} from '../constants'; +import Description from './Description'; const orderClassName = (address) => { - return classNames({ + return classNames('mr-4', { badge: true, 'badge-success': address, 'badge-secondary': !address @@ -35,15 +37,20 @@ const NoWeb3 = () => ( ) -const LayoutContract = ({contract, children}) => ( - - -

{contract.index + 1}

- - +const LayoutContract = ({contract, children, cardTitle}) => ( + + + +

+ {contract.index + 1} + {cardTitle} +

+
+
+ {children} - -
+ + ) const DeploymentResult = ({deployment}) => { @@ -59,14 +66,9 @@ const DeploymentResult = ({deployment}) => {

Deployment succeed:

-
Transaction
-
{deployment.transactionHash}
- -
Gas used
-
{deployment.gasUsed}
- -
Address
-
{deployment.contractAddress}
+ + +
) @@ -111,25 +113,24 @@ class Web3Contract extends React.Component { const isInterface = !abiConstructor; const argumentsRequired = abiConstructor && abiConstructor.inputs.length > 0; return ( - + + {isInterface && `${this.props.contract.className} is an interface`} + {!isInterface && this.props.contract.className} + + }> - {isInterface &&
{this.props.contract.className} is an interface
} - {!isInterface &&
{this.props.contract.className}
} {argumentsRequired && - - - Arguments: - - - {abiConstructor.inputs.map(input => ( + +
Arguments:
+ {abiConstructor.inputs.map(input => ( this.handleOnChange(e, input.name)} /> ))} -
-
+ } {!this.props.web3 && } @@ -158,16 +159,13 @@ class Web3Contract extends React.Component { } const EmbarkContract = ({contract}) => ( - - {contract.address && - -
{contract.className} deployed at {contract.address}
-

Arguments: {JSON.stringify(contract.args)}

-
- } - {!contract.address && -
{contract.className} not deployed
- } + + {contract.address && `${contract.className} deployed at ${contract.address}`} + {!contract.address && `${contract.className} not deployed`} + + }> + {contract.address &&

Arguments: {JSON.stringify(contract.args)}

} {contract.transactionHash &&

Transaction Hash: {contract.transactionHash}

@@ -182,45 +180,37 @@ const EmbarkContract = ({contract}) => ( const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => ( - - Order - - - - Contract -
- - Deploy using - - - - - - - -
-
- +
+ + Deploy using + + + + + + + +
)