mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-03 09:24:25 +00:00
transform card view into a card; remove duplicated names per tab
This commit is contained in:
parent
b86761e83d
commit
315413a87e
@ -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';
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ const Contract = ({contract}) => {
|
||||
return (
|
||||
<Row>
|
||||
<Col>
|
||||
<h1>{contract.className} Overview</h1>
|
||||
<Table
|
||||
responsive
|
||||
className="text-nowrap"
|
||||
|
Loading…
x
Reference in New Issue
Block a user