// 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 isElectron from 'is-electron'; import { defaultAccount$, nodeHealth$ } from '@parity/light.js'; import EthBalance from './EthBalance'; import light from '../hoc'; import TokenBalance from './TokenBalance'; let electron; if (isElectron()) { electron = window.require('electron'); } @inject('tokensStore') @observer @light({ me: defaultAccount$, nodeHealth: nodeHealth$ }) class Tokens extends Component { state = { progress: 0, status: null }; componentDidMount () { if (!isElectron()) { return; } const { ipcRenderer } = electron; // Listen to messages from main process ipcRenderer.on('parity-download-progress', (_, progress) => { this.setState({ progress, status: 'Downloading...' }); }); ipcRenderer.on('parity-running', (_, running) => { this.setState({ status: 'Parity running...' }); }); } render () { const { me, nodeHealth, tokensStore: { tokens } } = this.props; const { progress, status } = this.state; return (
); } } export default Tokens;