forked from pi-apps/pi-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chatch#35 add inflation pools list view
- Loading branch information
Chris Hatch
committed
Mar 12, 2018
1 parent
9f6eb00
commit 8e8aa63
Showing
7 changed files
with
117 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from 'react' | ||
import Grid from 'react-bootstrap/lib/Grid' | ||
import Panel from 'react-bootstrap/lib/Panel' | ||
import Row from 'react-bootstrap/lib/Row' | ||
import Table from 'react-bootstrap/lib/Table' | ||
import {FormattedMessage, injectIntl} from 'react-intl' | ||
import PropTypes from 'prop-types' | ||
|
||
import AccountLink from './shared/AccountLink' | ||
import Logo from './shared/Logo' | ||
import {titleWithJSONButton} from './shared/TitleWithJSONButton' | ||
|
||
import pools from '../data/inflation_pools.json' | ||
|
||
const METADATA_PATH = | ||
'https://raw.githubusercontent.com/chatch/stellarexplorer/master/src/data/inflation_pools.json' | ||
|
||
const Pool = ({account, name, website}) => { | ||
return ( | ||
<tr className="directoryRow"> | ||
<td>{name}</td> | ||
<td> | ||
<a href={website} target="_blank"> | ||
{website} | ||
</a> | ||
</td> | ||
<td> | ||
<AccountLink account={account} hideKnown /> | ||
</td> | ||
</tr> | ||
) | ||
} | ||
|
||
Pool.propTypes = { | ||
account: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired, | ||
website: PropTypes.string.isRequired, | ||
} | ||
|
||
class Pools extends React.Component { | ||
render() { | ||
const {formatMessage} = this.props.intl | ||
const header = titleWithJSONButton( | ||
formatMessage({id: 'inflation.pools'}), | ||
METADATA_PATH | ||
) | ||
return ( | ||
<Grid> | ||
<Row> | ||
<Panel header={header}> | ||
<Table> | ||
<thead> | ||
<tr> | ||
<th> | ||
<FormattedMessage id="name" /> | ||
</th> | ||
<th> | ||
<FormattedMessage id="home" /> | ||
</th> | ||
<th> | ||
<FormattedMessage id="account" /> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{Object.keys(pools).map(key => { | ||
const pool = pools[key] | ||
return <Pool key={key} account={key} {...pool} /> | ||
})} | ||
</tbody> | ||
</Table> | ||
</Panel> | ||
</Row> | ||
</Grid> | ||
) | ||
} | ||
} | ||
|
||
export default injectIntl(Pools) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"GBL7AE2HGRNQSPWV56ZFLILXNT52QWSMOQGDBBXYOP7XKMQTCKVMX2ZL": { | ||
"name": "futuretense.io", | ||
"website": "https://pool.futuretense.io" | ||
}, | ||
"GCCD6AJOYZCUAQLX32ZJF2MKFFAUJ53PVCFQI3RHWKL3V47QYE2BNAUT": { | ||
"name": "Lumenaut", | ||
"website": "https://lumenaut.net" | ||
}, | ||
"GB56YLTH5SDOYTUGPWY5MXJ7VQTY7BEM2YVJZTN5O555VA6DJYCTY2MP": { | ||
"name": "MoonPool", | ||
"website": "https://moonpool.space" | ||
}, | ||
"GAJOC4WSOL3VUHYTEQPSOY54LP3XDWBS3AEZZ4DH24NEOHBBMEQKK7I7": { | ||
"name": "Stellar Pool", | ||
"website": "https://stellarpool.net" | ||
}, | ||
"GDCHDRSDOBRMSUDKRE2C4U4KDLNEATJPIHHR2ORFL5BSD56G4DQXL4VW": { | ||
"name": "StellarTerm", | ||
"website": "https://stellarterm.com" | ||
}, | ||
"GA3FUYFOPWZ25YXTCA73RK2UGONHCO27OHQRSGV3VCE67UEPEFEDCOPA": { | ||
"name": "XLMPOOL", | ||
"website": "https://xlmpool.com" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters