// Copyright 2015-2018 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: MIT import React, { Component } from 'react'; import { inject, observer } from 'mobx-react'; import { defaultAccount$, nodeHealth$ } from '@parity/light.js'; import { Redirect } from 'react-router-dom'; import EthBalance from './EthBalance'; import light from '../hoc'; import TokenBalance from './TokenBalance'; @inject('parityStore', 'tokensStore') @observer @light({ me: defaultAccount$, nodeHealth: nodeHealth$ }) class Tokens extends Component { render () { const { me, nodeHealth, parityStore: { isApiConnected }, tokensStore: { tokens } } = this.props; if (!isApiConnected) { return ; } return (
    {me && Array.from(tokens.keys()).map(key => (
  • {key === 'ETH' ? ( ) : ( )}
  • )) }
{nodeHealth && (

Overall node health status

                PEERS: {nodeHealth.peers.status} {nodeHealth.peers.details[0]}/{
                  nodeHealth.peers.details[1]
                }
                
SYNC: {nodeHealth.sync.status}
TIMESYNC: {nodeHealth.time.status}

Note: I can make a small algorithm which outputs the average health with 3 states: OK, ALRIGHT, and BAD

)} {nodeHealth && (

When SYNC above is false, we have the syncing progress to give an idea how much time it'll take

                "startingBlock": 900
"currentBlock": 902
"highestBlock": 1108
)}
); } } export default Tokens;