Hide Orch info if selected address is not an O

This commit is contained in:
Marco van Dijk 2022-03-03 22:37:38 +01:00
parent 019f8ddb3b
commit a36125a842
2 changed files with 61 additions and 49 deletions

View File

@ -122,22 +122,22 @@ class Livepeer extends React.Component {
eventsList = this.props.livepeer.events;
}
let thisOrchObj = this.props.livepeer.thisOrchestrator;
if (this.props.livepeer.selectedOrchestrator){
let thisOrchObj;
if (this.props.livepeer.selectedOrchestrator) {
thisOrchObj = this.props.livepeer.selectedOrchestrator;
}
return (
<div style={{ width: '100%', height: '100%' }}>
<div className="row" style={{ margin: 0, padding: 0, backgroundColor: "rgba(180, 175, 252, 0.80)", boxSizing: "border-box", backdropDilter: "blur(6px)", boxSshadow: "9px 13px 18px 8px rgba(8, 7, 56, 0.692)", position: 'absolute', top: '0px', left: '0px', height: '300px', right: '0px', overflow: 'hidden' }}>
<div className="row" style={{ margin: 0, padding: 0 }}>
<button className="homeButton" onClick={() => {
this.setState({ redirectToHome: true });
}}>
<img alt="" src="livepeer.png" width="100em" height="100em" />
</button>
<button className="homeButton" onClick={() => {
this.setState({ redirectToHome: true });
}}>
<img alt="" src="livepeer.png" width="100em" height="100em" />
</button>
<div className="row" style={{alignItems: 'stretch', height:'100%'}}>
<Orchestrator thisOrchestrator={thisOrchObj} />
</div>
<Orchestrator thisOrchestrator={thisOrchObj} />
<div className="row metaSidebar" style={{ padding: 0 }}>
<div className="stroke" style={{ margin: 0, padding: 0 }}>
<h3>Smart contract prices</h3>
@ -156,7 +156,7 @@ class Livepeer extends React.Component {
</div>
</div>
</div >
<EventViewer events={eventsList} setOrchFunction={this.props.getOrchestratorInfo}/>
<EventViewer events={eventsList} setOrchFunction={this.props.getOrchestratorInfo} />
</div >
);
}

View File

@ -36,53 +36,65 @@ const Orchestrator = (obj) => {
thisID = obj.thisOrchestrator.delegator.id;
thisUrl = "https://explorer.livepeer.org/accounts/" + thisID;
}
}
return (
<div className="hostInfo">
<div className="strokeSmollLeft">
<div style={{ flexDirection: 'row', display: "flex" }}>
<a href={thisUrl}>
<img alt="" src="livepeer.png" width="30" height="30" />
<h3>Orchestrator Info</h3>
{thisID}
</a>
return (
<div className="hostInfo">
<div className="strokeSmollLeft">
<div style={{ flexDirection: 'row', display: "flex" }}>
<a href={thisUrl}>
<img alt="" src="livepeer.png" width="30" height="30" />
<h3>Orchestrator Info</h3>
{thisID}
</a>
</div>
<div className="rowAlignLeft">
<p>Earned fees {totalVolumeETH} Eth (${totalVolumeUSD})</p>
</div>
<div className="rowAlignLeft">
<p>Reward Cut {rewardCut}%</p>
<p>Fee Cut {feeCut}%</p>
</div>
<div className="rowAlignLeft">
<p>Total Stake {totalStake} LPT</p>
<p>Self stake {selfStake} LPT ({selfStakeRatio}%)</p>
</div>
</div>
<div className="rowAlignLeft">
<p>Earned fees {totalVolumeETH} Eth (${totalVolumeUSD})</p>
</div>
<div className="rowAlignLeft">
<p>Reward Cut {rewardCut}%</p>
<p>Fee Cut {feeCut}%</p>
</div>
<div className="rowAlignLeft">
<p>Total Stake {totalStake} LPT</p>
<p>Self stake {selfStake} LPT ({selfStakeRatio}%)</p>
<div className="content-wrapper">
<ScrollContainer className="overflow-container" hideScrollbars={false}>
<div className="overflow-content" style={{ cursor: 'grab', height: '300px' }}>
{
delegators.map((delObj, idx) => {
return (
<div className="rowAlignLeft">
<a href={"https://explorer.livepeer.org/accounts/" + delObj.id}>
<img alt="" src="livepeer.png" width="30" height="30" />{delObj.id.substr(0, 6) + ".."}</a>
<div className="strokeSmollLeft">
<p>{parseFloat(delObj.bondedAmount).toFixed(2)} LPT since round {delObj.startRound}</p>
</div>
</div>
)
})
}
</div>
</ScrollContainer>
</div>
</div>
</div>
<div className="rowAlignLeft">
<div className="content-wrapper">
<ScrollContainer className="overflow-container" hideScrollbars={false}>
<div className="overflow-content" style={{ cursor: 'grab', height: '300px' }}>
{
delegators.map((delObj, idx) => {
return (
<div className="rowAlignLeft">
<a href={"https://explorer.livepeer.org/accounts/" + delObj.id}>
<img alt="" src="livepeer.png" width="30" height="30" />{delObj.id.substr(0, 6) + ".."}</a>
<div className="strokeSmollLeft">
<p>{parseFloat(delObj.bondedAmount).toFixed(2)} LPT since round {delObj.startRound}</p>
</div>
</div>
)
})
}
</div>
</ScrollContainer>
)
}
return (
<div className="hostInfo" style={{ height: '100%', width: '100%', display: 'flex' }}>
<div style={{ flexDirection: 'strokeSmollLeft', display: "flex", height: '100%', width: '100%' }}>
<div className="rowAlignLeft">
<img alt="" src="livepeer.png" width="30" height="30" />
<h3>Orchestrator Info</h3>
</div>
<div className="rowAlignLeft">
<p>Click on an orchestrator in the list below!</p>
</div>
</div>
</div>
)
}