transform card view into a card; remove duplicated names per tab

This commit is contained in:
Iuri Matias 2018-10-17 19:10:11 -04:00 committed by Pascal Precht
parent b86761e83d
commit 315413a87e
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
3 changed files with 43 additions and 40 deletions

View File

@ -114,7 +114,6 @@ const ContractFunctions = (props) => {
return (
<Row>
<Col xs={12}><h1>{contractProfile.name} Functions</h1></Col>
{contractProfile.methods
.filter((method) => {
return props.onlyConstructor ? method.type === 'constructor' : method.type !== 'constructor';

View File

@ -1,6 +1,6 @@
import PropTypes from "prop-types";
import React from 'react';
import { TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap';
import { TabContent, TabPane, Nav, NavItem, NavLink, Card, CardBody, CardTitle } from 'reactstrap';
import classnames from 'classnames';
import ContractOverview from '../components/ContractOverview';
@ -27,43 +27,48 @@ class ContractLayout extends React.Component {
render() {
return (
<React.Fragment>
<Nav tabs>
<NavItem>
<NavLink
className={classnames({ active: this.state.activeTab === '1' })}
onClick={() => { this.toggle('1'); }}
>
Overview
</NavLink>
</NavItem>
<NavItem>
<NavLink
className={classnames({ active: this.state.activeTab === '2' })}
onClick={() => { this.toggle('2'); }}
>
Functions
</NavLink>
</NavItem>
<NavItem>
<NavLink
className={classnames({ active: this.state.activeTab === '3' })}
onClick={() => { this.toggle('3'); }}
>
Logger
</NavLink>
</NavItem>
</Nav>
<TabContent activeTab={this.state.activeTab}>
<TabPane tabId="1">
<ContractOverview contract={this.props.contract} />
</TabPane>
<TabPane tabId="2">
<ContractFunctionsContainer contract={this.props.contract} />
</TabPane>
<TabPane tabId="3">
<ContractLoggerContainer contract={this.props.contract} />
</TabPane>
</TabContent>
<Card>
<CardBody>
<CardTitle>{this.props.contract.className}</CardTitle>
<Nav tabs>
<NavItem>
<NavLink
className={classnames({ active: this.state.activeTab === '1' })}
onClick={() => { this.toggle('1'); }}
>
Overview
</NavLink>
</NavItem>
<NavItem>
<NavLink
className={classnames({ active: this.state.activeTab === '2' })}
onClick={() => { this.toggle('2'); }}
>
Functions
</NavLink>
</NavItem>
<NavItem>
<NavLink
className={classnames({ active: this.state.activeTab === '3' })}
onClick={() => { this.toggle('3'); }}
>
Logger
</NavLink>
</NavItem>
</Nav>
<TabContent activeTab={this.state.activeTab}>
<TabPane tabId="1">
<ContractOverview contract={this.props.contract} />
</TabPane>
<TabPane tabId="2">
<ContractFunctionsContainer contract={this.props.contract} />
</TabPane>
<TabPane tabId="3">
<ContractLoggerContainer contract={this.props.contract} />
</TabPane>
</TabContent>
</CardBody>
</Card>
</React.Fragment>
)
}

View File

@ -9,7 +9,6 @@ const Contract = ({contract}) => {
return (
<Row>
<Col>
<h1>{contract.className} Overview</h1>
<Table
responsive
className="text-nowrap"