mirror of https://github.com/embarklabs/embark.git
feat(cockpit/contracts): don't display contracts marked as silent
This commit is contained in:
parent
d80641c4e1
commit
0e63d6bcf9
|
@ -204,6 +204,9 @@ const filterContractFunctions = (contractFunctions, contractName, method) => {
|
|||
const ContractOverview = (props) => {
|
||||
const {contractProfile, contract} = props;
|
||||
const contractDisplay = formatContractForDisplay(contract);
|
||||
if (!contractDisplay) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
|
@ -17,6 +17,9 @@ const Contracts = ({contracts, title = "Contracts"}) => (
|
|||
{
|
||||
contracts.map((contract, key) => {
|
||||
const contractDisplay = formatContractForDisplay(contract);
|
||||
if (!contractDisplay) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="explorer-row border-top" key={`contract-${key}`}>
|
||||
|
@ -31,7 +34,7 @@ const Contracts = ({contracts, title = "Contracts"}) => (
|
|||
<Col>
|
||||
<strong>State</strong>
|
||||
<div className={contractDisplay.stateColor}>
|
||||
{formatContractForDisplay(contract).state}
|
||||
{contractDisplay.state}
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
@ -17,6 +17,9 @@ const ContractsList = ({contracts}) => (
|
|||
{
|
||||
contracts.map((contract) => {
|
||||
const contractDisplay = formatContractForDisplay(contract);
|
||||
if (!contractDisplay) {
|
||||
return '';
|
||||
}
|
||||
return (
|
||||
<tr key={contract.className} className={contractDisplay.stateColor}>
|
||||
<td><Link to={`/explorer/contracts/${contract.className}`}>{contract.className}</Link></td>
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
export function formatContractForDisplay(contract) {
|
||||
if (contract.silent) {
|
||||
return;
|
||||
}
|
||||
let address = (contract.address || contract.deployedAddress);
|
||||
let state = 'Deployed';
|
||||
let stateColor = 'success';
|
||||
|
|
Loading…
Reference in New Issue