From d02edf869b6bfc323e587b6db9e032ff951174f2 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 24 Oct 2018 16:03:46 -0400 Subject: [PATCH] Move contracts to explorer --- embark-ui/src/components/Contracts.js | 46 ++++++++++++++++------ embark-ui/src/components/ContractsList.js | 2 +- embark-ui/src/components/ExplorerLayout.js | 4 ++ embark-ui/src/components/Layout.js | 2 +- embark-ui/src/routes.js | 4 -- 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/embark-ui/src/components/Contracts.js b/embark-ui/src/components/Contracts.js index 1660b038..dc6fb8d5 100644 --- a/embark-ui/src/components/Contracts.js +++ b/embark-ui/src/components/Contracts.js @@ -1,21 +1,44 @@ import PropTypes from "prop-types"; import React from 'react'; -import {Row, Col, Card, CardBody, CardTitle} from "reactstrap"; -import ContractsList from './ContractsList'; +import {Row, Col, Card, CardHeader, CardBody, CardTitle} from "reactstrap"; +import {Link} from 'react-router-dom'; +import {formatContractForDisplay} from '../utils/presentation'; + +import CardTitleIdenticon from './CardTitleIdenticon'; const Contracts = ({contracts, title = "Contracts"}) => ( - + + +

{title}

+
- - - Contracts - - -
- -
+ { + contracts.map(contract => { + const contractDisplay = formatContractForDisplay(contract); + + return ( +
+ + {contract.className} + + + + Address +
{contract.address}
+ + + State +
+ {formatContractForDisplay(contract).state} +
+ +
+
+ ) + }) + }
@@ -28,4 +51,3 @@ Contracts.propTypes = { }; export default Contracts; - diff --git a/embark-ui/src/components/ContractsList.js b/embark-ui/src/components/ContractsList.js index 078cf7bd..2b9c7880 100644 --- a/embark-ui/src/components/ContractsList.js +++ b/embark-ui/src/components/ContractsList.js @@ -19,7 +19,7 @@ const ContractsList = ({contracts}) => ( const contractDisplay = formatContractForDisplay(contract); return ( - {contract.className} + {contract.className} {contractDisplay.address} {contractDisplay.state} diff --git a/embark-ui/src/components/ExplorerLayout.js b/embark-ui/src/components/ExplorerLayout.js index ba3975b5..59814cb8 100644 --- a/embark-ui/src/components/ExplorerLayout.js +++ b/embark-ui/src/components/ExplorerLayout.js @@ -5,6 +5,8 @@ import AccountsContainer from '../containers/AccountsContainer'; import AccountContainer from '../containers/AccountContainer'; import BlocksContainer from '../containers/BlocksContainer'; import BlockContainer from '../containers/BlockContainer'; +import ContractsContainer from '../containers/ContractsContainer'; +import ContractLayoutContainer from '../containers/ContractLayoutContainer'; import TransactionsContainer from '../containers/TransactionsContainer'; import TransactionContainer from '../containers/TransactionContainer'; @@ -15,6 +17,8 @@ const ExplorerLayout = () => ( + + diff --git a/embark-ui/src/components/Layout.js b/embark-ui/src/components/Layout.js index 37d5e6b7..2dbfebf4 100644 --- a/embark-ui/src/components/Layout.js +++ b/embark-ui/src/components/Layout.js @@ -30,7 +30,6 @@ import logo from '../images/logo-new.svg'; const HEADER_NAV_ITEMS = [ {name: "Dashboard", to: "/embark", icon: 'tachometer'}, {name: "Deployment", to: "/embark/deployment", icon: "arrow-up"}, - {name: "Contracts", to: "/embark/contracts", icon: "file-text"}, {name: "Explorer", to: "/embark/explorer/overview", icon: "compass"}, {name: "Editor", to: "/embark/editor", icon: "codepen"}, {name: "Utils", to: "/embark/utilities/converter", icon: "cog"} @@ -41,6 +40,7 @@ const SIDEBAR_NAV_ITEMS = { {url: "/embark/explorer/overview", icon: "fa fa-signal", name: "Overview"}, {url: "/embark/explorer/accounts", icon: "fa fa-users", name: "Accounts"}, {url: "/embark/explorer/blocks", icon: "fa fa-stop", name: "Blocks"}, + {url: "/embark/explorer/contracts", icon: "fa fa-file-code-o", name: "Contracts"}, {url: "/embark/explorer/transactions", icon: "fa fa-tree", name: "Transactions"} ]}, "/embark/utilities/": {items: [ diff --git a/embark-ui/src/routes.js b/embark-ui/src/routes.js index 9ce0f0a4..79163566 100644 --- a/embark-ui/src/routes.js +++ b/embark-ui/src/routes.js @@ -2,8 +2,6 @@ import React from 'react'; import {Route, Switch} from 'react-router-dom'; import HomeContainer from './containers/HomeContainer'; -import ContractsContainer from './containers/ContractsContainer'; -import ContractLayoutContainer from './containers/ContractLayoutContainer'; import EditorContainer from './containers/EditorContainer'; import DeploymentContainer from './containers/DeploymentContainer'; import NoMatch from './components/NoMatch'; @@ -18,8 +16,6 @@ const routes = ( - -