From dcf94a09247566c00cf35243761175669d82d6f5 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 3 Aug 2018 12:29:33 -0400 Subject: [PATCH] Fix route; style other components --- embark-ui/src/components/Contract.js | 49 ++++++++----- embark-ui/src/components/ContractLayout.js | 8 +-- embark-ui/src/components/ContractProfile.js | 69 +++++++++++-------- embark-ui/src/components/Contracts.js | 55 ++++++++------- .../containers/ContractProfileContainer.js | 2 +- embark-ui/src/routes.js | 1 - 6 files changed, 105 insertions(+), 79 deletions(-) diff --git a/embark-ui/src/components/Contract.js b/embark-ui/src/components/Contract.js index ed5767bc..f34dcf51 100644 --- a/embark-ui/src/components/Contract.js +++ b/embark-ui/src/components/Contract.js @@ -1,26 +1,37 @@ import React from 'react'; +import { + Page, + Grid, + Card, + Table +} from "tabler-react"; import {Link} from 'react-router-dom'; const Contract = ({contract}) => ( - -

Contract

- - - - - - - - - - - - - - - -
NameAddressState
{contract.name || contract.className}{contract.address || contract.deployedAddress}}{contract.deploy.toString()}
-
+ + + + + + + + + ); export default Contract; diff --git a/embark-ui/src/components/ContractLayout.js b/embark-ui/src/components/ContractLayout.js index e992842e..d5cf82d2 100644 --- a/embark-ui/src/components/ContractLayout.js +++ b/embark-ui/src/components/ContractLayout.js @@ -17,7 +17,7 @@ const ContractLayout = (props) => ( @@ -25,7 +25,7 @@ const ContractLayout = (props) => ( @@ -33,7 +33,7 @@ const ContractLayout = (props) => ( @@ -58,7 +58,5 @@ const ContractLayout = (props) => ( ); - // - // export default withRouter(ContractLayout); diff --git a/embark-ui/src/components/ContractProfile.js b/embark-ui/src/components/ContractProfile.js index 22fb3245..ba2ed0fa 100644 --- a/embark-ui/src/components/ContractProfile.js +++ b/embark-ui/src/components/ContractProfile.js @@ -1,37 +1,46 @@ import React from 'react'; +import { + Page, + Grid, + Card, + Table +} from "tabler-react"; import {Link} from 'react-router-dom'; const ContractProfile = ({contract}) => ( - -

Profile for {contract.name}

-
- - - - - - - - - - - - {contract.methods.map((method) => { - return ( - - - - - - - - - ) - })} - -
FunctionPayableMutabilityInputsOuputsGas Estimates
{method.name}{(method.payable == true).toString()}{method.mutability}({method.inputs.map((x) => x.type).join(',')})({method.outputs.map((x) => x.type).join(',')}){method.gasEstimates}
- -); + + + + + { + return ([ + {content: method.name}, + {content: (method.payable == true).toString()}, + {content: method.mutability}, + {content: `(${method.inputs.map((x) => x.type).join(',')})`}, + {content: `(${method.outputs.map((x) => x.type).join(',')})`}, + {content: method.gasEstimates}, + ]); + }) + } + /> + + + + +) export default ContractProfile; diff --git a/embark-ui/src/components/Contracts.js b/embark-ui/src/components/Contracts.js index 79aacffc..b8817fee 100644 --- a/embark-ui/src/components/Contracts.js +++ b/embark-ui/src/components/Contracts.js @@ -1,30 +1,39 @@ import React from 'react'; +import { + Page, + Grid, + Card, + Table +} from "tabler-react"; import {Link} from 'react-router-dom'; const Contracts = ({contracts}) => ( - -

Contracts

-
- - - - - - - - - {contracts.map((contract) => { - return ( - - - - - - ) - })} - -
NameAddressState
{contract.name}{contract.address}{contract.deploy}
- + + + + + { + return ([ + {content: {contract.name}}, + {content: contract.address}, + {content: contract.deploy} + ]); + }) + } + /> + + + + ); export default Contracts; diff --git a/embark-ui/src/containers/ContractProfileContainer.js b/embark-ui/src/containers/ContractProfileContainer.js index ab37dfeb..13c9495d 100644 --- a/embark-ui/src/containers/ContractProfileContainer.js +++ b/embark-ui/src/containers/ContractProfileContainer.js @@ -24,7 +24,7 @@ class ContractProfileContainer extends Component { ) } - if (contract.error) { + if (contract.data.error) { return (

Error API... diff --git a/embark-ui/src/routes.js b/embark-ui/src/routes.js index dde54931..1480cfc0 100644 --- a/embark-ui/src/routes.js +++ b/embark-ui/src/routes.js @@ -19,7 +19,6 @@ const routes = ( -