Hide deployment section in UI for fiddle contracts

This commit is contained in:
emizzle 2018-08-27 13:34:35 +10:00 committed by Pascal Precht
parent b8b98cd6c4
commit e027ae258a
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 14 additions and 10 deletions

View File

@ -14,7 +14,7 @@ import ContractDeploymentContainer from '../containers/ContractDeploymentContain
import ContractProfileContainer from '../containers/ContractProfileContainer'; import ContractProfileContainer from '../containers/ContractProfileContainer';
import ContractSourceContainer from '../containers/ContractSourceContainer'; import ContractSourceContainer from '../containers/ContractSourceContainer';
const ContractLayout = ({match}) => ( const ContractLayout = ({match, contract}) => (
<Grid.Row> <Grid.Row>
<Grid.Col md={3}> <Grid.Col md={3}>
<Page.Title className="my-5">&nbsp;</Page.Title> <Page.Title className="my-5">&nbsp;</Page.Title>
@ -28,14 +28,18 @@ const ContractLayout = ({match}) => (
> >
Overview Overview
</List.GroupItem> </List.GroupItem>
<List.GroupItem {!contract.isFiddle ?
className="d-flex align-items-center" <List.GroupItem
to={`/embark/contracts/${match.params.contractName}/deployment`} className="d-flex align-items-center"
icon="users" to={`/embark/contracts/${match.params.contractName}/deployment`}
RootComponent={NavLink} icon="users"
> RootComponent={NavLink}
Deployment / Utils >
</List.GroupItem> Deployment / Utils
</List.GroupItem>
:
''
}
<List.GroupItem <List.GroupItem
className="d-flex align-items-center" className="d-flex align-items-center"
to={`/embark/contracts/${match.params.contractName}/functions`} to={`/embark/contracts/${match.params.contractName}/functions`}

View File

@ -14,7 +14,7 @@ class ContractLayoutContainer extends Component {
render() { render() {
if (this.props.contract){ if (this.props.contract){
return <ContractLayout />; return <ContractLayout contract={this.props.contract} />;
} else { } else {
return <React.Fragment />; return <React.Fragment />;
} }