import React, { Component } from 'react' import PropTypes from 'prop-types' import QRCode from 'qrcode.react' import copy from 'copy-to-clipboard' import Isvg from 'react-inlinesvg' import zapLogo from 'icons/zap_logo.svg' import { showNotification } from 'notifications' import styles from './Syncing.scss' class Syncing extends Component { componentWillMount() { const { fetchBlockHeight, newAddress } = this.props fetchBlockHeight() newAddress('np2wkh') } render() { const { syncPercentage, address } = this.props const copyClicked = () => { copy(address) showNotification('Noice', 'Successfully copied to clipboard') } return (

Fund your Zap wallet

Might as well fund your wallet while you're waiting to sync.

{address} copy

Syncing to the blockchain...

{Number.isNaN(parseInt(syncPercentage, 10)) || syncPercentage.toString().length === 0 ? '' : `${syncPercentage}%`}

) } } Syncing.propTypes = { fetchBlockHeight: PropTypes.func.isRequired, newAddress: PropTypes.func.isRequired, address: PropTypes.string.isRequired, syncPercentage: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired } export default Syncing