Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show total peers count #735

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 11 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/peers/PeersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ import { Helmet } from 'react-helmet'
import WorldMap from './WorldMap/WorldMap'
import PeersTable from './PeersTable/PeersTable'

const PeersPage = ({ peerCoordinates, tableData }) => (
const PeersPage = ({ peers, peerCoordinates, tableData }) => (
<div data-id='PeersPage'>
<Helmet>
<title>Peers - IPFS</title>
</Helmet>

<div className='bg-snow-muted pa3'>
<WorldMap coordinates={peerCoordinates} />
<WorldMap peers={peers} coordinates={peerCoordinates} />
<PeersTable peers={tableData} />
</div>
</div>
)

export default connect(
'selectPeers',
'selectPeerCoordinates',
'selectTableData',
PeersPage
Expand Down
5 changes: 3 additions & 2 deletions src/peers/WorldMap/WorldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import worldData from './world.json'

export class WorldMap extends React.Component {
static propTypes = {
peers: PropTypes.array,
coordinates: PropTypes.array
}

Expand Down Expand Up @@ -85,7 +86,7 @@ export class WorldMap extends React.Component {
}

render () {
const { coordinates } = this.props
const { peers, coordinates } = this.props

return (
<div className='flex w-100 mb4' style={{ 'height': '500px' }}>
Expand All @@ -94,7 +95,7 @@ export class WorldMap extends React.Component {
</AutoSizer>

<div className='flex flex-auto flex-column items-center self-end pb4'>
<div className='f1 gray'>{ coordinates ? coordinates.length : 0 }</div>
<div className='f1 gray'>{ peers ? peers.length : 0 }</div>
<div className='f4 b'>PEERS</div>
</div>
</div>
Expand Down