Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
chore: yarn lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnygleason committed Jun 29, 2019
1 parent c4875f0 commit 121d4ff
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 47 deletions.
7 changes: 5 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ const BxDataTableThemed = withStyles(stylesV1)(BxDataTable);

const Bx2AppBarThemed = withStyles(stylesV2)(Bx2AppBar);
const Bx2NavDrawerThemed = withStyles(stylesV2)(Bx2NavDrawer);
const Bx2PanelValidatorsOverviewThemed = withStyles(stylesV2)(Bx2PanelValidatorsOverview);
const Bx2PanelValidatorsOverviewThemed = withStyles(stylesV2)(
Bx2PanelValidatorsOverview,
);
const Bx2PanelValidatorsThemed = withStyles(stylesV2)(Bx2PanelValidators);
const Bx2BlankComponentThemed = withStyles(stylesV2)(Bx2BlankComponent);

Expand Down Expand Up @@ -695,7 +697,8 @@ class App extends Component {
render={() => (
<Bx2PanelValidatorsOverviewThemed
nodes={this.state.nodes}
supply={this.state.supply || 0}/>
supply={this.state.supply || 0}
/>
)}
/>
<Route
Expand Down
95 changes: 50 additions & 45 deletions src/v2/Bx2PanelValidatorsOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function ArrowTooltip(props) {
title={
<React.Fragment>
{props.title}
<span className={arrow} ref={setArrowRef}/>
<span className={arrow} ref={setArrowRef} />
</React.Fragment>
}
/>
Expand All @@ -134,58 +134,61 @@ class Bx2PanelValidatorsOverview extends Component {
const {nodes} = this.props;

// eslint-disable-next-line no-restricted-properties
const totalSupplySOL = (this.props.supply / Math.pow(2, 34)).toFixed(
2,
);
const totalSupplySOL = (this.props.supply / Math.pow(2, 34)).toFixed(2);

return (
<div>
<div style={{backgroundColor: 'white', marginLeft: 240, marginTop: 60}}>
<ComposableMap>
<ZoomableGroup>
<Geographies geography={'/resources/world-50m-simplified.json'}>
{(geographies, projection) => geographies.map((geography, i) => (
<Geography
key={`geo${i}`}
geography={geography}
projection={projection}
/>
))}
</Geographies>
<Markers>
{
nodes.map((node, i) => (
<Marker key={`mk${i}`} marker={this.makeMarker(node)}>
<ArrowTooltip
title={`Name: ${node.pubkey}\nStake: ${(node.voteAccount && node.voteAccount.stake) || 0} Lamports`}>
<circle
cx={0}
cy={0}
r={10}
style={{
stroke: 'rgb(21, 127, 94)',
fill: 'rgb(43, 254, 188)',
strokeWidth: 3,
opacity: 0.9,
}}
/>
</ArrowTooltip>
</Marker>
{(geographies, projection) =>
geographies.map((geography, i) => (
<Geography
key={`geo${i}`}
geography={geography}
projection={projection}
/>
))
}
</Geographies>
<Markers>
{nodes.map((node, i) => (
<Marker key={`mk${i}`} marker={this.makeMarker(node)}>
<ArrowTooltip
title={`Name: ${
node.pubkey
}\nStake: ${(node.voteAccount &&
node.voteAccount.stake) ||
0} Lamports`}
>
<circle
cx={0}
cy={0}
r={10}
style={{
stroke: 'rgb(21, 127, 94)',
fill: 'rgb(43, 254, 188)',
strokeWidth: 3,
opacity: 0.9,
}}
/>
</ArrowTooltip>
</Marker>
))}
</Markers>
</ZoomableGroup>
</ComposableMap>
</div>
<p/>
<p />
<div>
<Grid container justify="center" spacing={1} className="sideBySide">
<Grid item>
<Card>
<CardContent>
<Typography variant="h5" component="h2" align="center">
Total Supply
<BxHelpLink text="Leader" term="leader"/>
<BxHelpLink text="Leader" term="leader" />
<ArrowTooltip title="Add">
<Button>Arrow</Button>
</ArrowTooltip>
Expand All @@ -201,7 +204,7 @@ class Bx2PanelValidatorsOverview extends Component {
<CardContent>
<Typography variant="h5" component="h2" align="center">
Total Bonded Tokens
<BxHelpLink text="Leader" term="leader"/>
<BxHelpLink text="Leader" term="leader" />
</Typography>
<Typography component="p" align="center">
(TODO) SOL
Expand All @@ -214,7 +217,7 @@ class Bx2PanelValidatorsOverview extends Component {
<CardContent>
<Typography variant="h5" component="h2" align="center">
# Active Validators
<BxHelpLink text="Leader" term="leader"/>
<BxHelpLink text="Leader" term="leader" />
</Typography>
<Typography component="p" align="center">
{this.props.nodes.length}
Expand All @@ -231,34 +234,36 @@ class Bx2PanelValidatorsOverview extends Component {
style={{textAlign: 'left', padding: '16px'}}
>
Validators
<BxHelpLink text="Transaction" term="transaction"/>
<br/>
<Link component={RouterLink} to={'/v2/validators'}>See All</Link>
<BxHelpLink text="Transaction" term="transaction" />
<br />
<Link component={RouterLink} to={'/v2/validators'}>
See All
</Link>
</Typography>
<Table>
<TableHead>
<TableRow>
<TableCell>
<div>
Node Pubkey
<BxHelpLink text="Transaction" term="transaction"/>
<BxHelpLink text="Transaction" term="transaction" />
</div>
<div>
Vote Pubkey
<BxHelpLink text="Account" term="account"/>
<BxHelpLink text="Account" term="account" />
</div>
</TableCell>
<TableCell>
Stake
<BxHelpLink text="Program" term="program-id"/>
<BxHelpLink text="Program" term="program-id" />
</TableCell>
<TableCell align="center">
Commission
<BxHelpLink text="Block Height" term="block-height"/>
<BxHelpLink text="Block Height" term="block-height" />
</TableCell>
<TableCell align="right">
Uptime
<BxHelpLink text="Block Height" term="block-height"/>
<BxHelpLink text="Block Height" term="block-height" />
</TableCell>
</TableRow>
</TableHead>
Expand All @@ -270,8 +275,8 @@ class Bx2PanelValidatorsOverview extends Component {
scope="row"
title={JSON.stringify(row, null, 2)}
>
<BxEntityLink prg_id={row.pubkey}/>
<br/>
<BxEntityLink prg_id={row.pubkey} />
<br />
<BxEntityLink
prg_id={row.voteAccount && row.voteAccount.votePubkey}
/>
Expand Down

0 comments on commit 121d4ff

Please sign in to comment.