Skip to content

Commit

Permalink
patch new warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hatch committed Oct 16, 2017
1 parent 1b3a04a commit 55923ef
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 35 deletions.
47 changes: 22 additions & 25 deletions src/components/Anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,52 @@ const METADATA_PATH =
'https://github.com/chatch/stellarexplorer/blob/master/src/data/anchors.js'

// render list of currency codes, each code on a new line
const CodesColumn = ({currencies}) =>
const CodesColumn = ({currencies}) => (
<span>
{Object.keys(currencies).map(code =>
<div>
{code}
</div>
)}
{Object.keys(currencies).map(code => <div key={code}>{code}</div>)}
</span>
)

// render single issuer with link to account
const Issuer = ({issuer}) =>
const Issuer = ({issuer}) => (
<span>
<FormattedMessage id="issuer" />:&nbsp;
<AccountLink account={issuer} hideKnown />
</span>
)

// render 1 to n distributers with links to accounts
const Distributers = ({distributers}) =>
const Distributers = ({distributers}) => (
<span>
<FormattedMessage id="distributers" />:&nbsp;
{distributers.map(distAcc =>
<span>
{distributers.map(distAcc => (
<span key={distAcc}>
<AccountLink account={distAcc} hideKnown />&nbsp;
</span>
)}
))}
</span>
)

// render column of account details (known issuer and distributers), one row for each currency
const AccountsColumn = ({currencies}) =>
const AccountsColumn = ({currencies}) => (
<span>
{Object.keys(currencies).map(code => {
const currency = currencies[code]
const issuer = <Issuer issuer={currency.issuer} />
const distributers = has(currency, 'distributers')
? <span>
,&nbsp;<Distributers distributers={currency.distributers} />
</span>
: null
const distributers = has(currency, 'distributers') ? (
<span>
,&nbsp;<Distributers distributers={currency.distributers} />
</span>
) : null
return (
<div>
<div key={code}>
{issuer}
{distributers}
</div>
)
})}
</span>
)

const Anchor = ({currencies, home, img, name, toml}) => {
const homePage = `https://${home}`
Expand All @@ -74,13 +74,9 @@ const Anchor = ({currencies, home, img, name, toml}) => {
</a>
</Col>
<Col md={3}>
<div>{name}</div>
<div>
{name}
</div>
<div>
<a href={homePage}>
{homePage}
</a>
<a href={homePage}>{homePage}</a>
</div>
<div>
<BadgeButton
Expand All @@ -100,13 +96,14 @@ const Anchor = ({currencies, home, img, name, toml}) => {
)
}

const AnchorsList = () =>
const AnchorsList = () => (
<div>
{Object.keys(anchors).map(name => {
const anchor = anchors[name]
return <Anchor key={name} name={name} {...anchor} />
})}
</div>
)

class Anchors extends React.Component {
render() {
Expand Down
16 changes: 6 additions & 10 deletions src/components/LedgerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ import {FormattedRelative, FormattedMessage} from 'react-intl'
import PropTypes from 'prop-types'
import {withSpinner} from './shared/Spinner'

const LedgerRow = props =>
const LedgerRow = props => (
<tr>
<td>
<Link to={`/ledger/${props.sequence}`}>
{props.sequence}
</Link>
<Link to={`/ledger/${props.sequence}`}>{props.sequence}</Link>
</td>
<td>
<FormattedRelative value={props.time} />
</td>
<td>
{props.txCount}
</td>
<td>{props.txCount}</td>
</tr>
)

LedgerRow.propTypes = {
sequence: PropTypes.number,
Expand All @@ -32,7 +29,6 @@ class LedgerTable extends React.Component {
<Table
id="ledger-table"
className="table-striped table-hover table-condensed"
fill
>
<thead>
<tr>
Expand All @@ -46,14 +42,14 @@ class LedgerTable extends React.Component {
</tr>
</thead>
<tbody>
{this.props.records.map(ledger =>
{this.props.records.map(ledger => (
<LedgerRow
key={ledger.sequence}
sequence={ledger.sequence}
time={ledger.time}
txCount={ledger.txCount}
/>
)}
))}
</tbody>
</Table>
)
Expand Down

0 comments on commit 55923ef

Please sign in to comment.