import React, { Children, Component } from 'react'; import { connect } from 'react-redux'; import ipfs_logo from '../assets/images/ipfs_logo.png'; //TODO: Add OrbitDB Loading thingy class LoadingContainer extends Component { render() { if (this.props.web3.status === 'failed' || !this.props.web3.networkId) { //TODO: wtf is this if (this.props.errorComp) return this.props.errorComp; return (

🦊

This browser has no connection to the Ethereum network.

Please make sure that:

  • You use MetaMask or a dedicated Ethereum browser (e.g. Mist or Parity)
  • They are pointed to the correct network
  • Your account is unlocked and the app has the rights to access it

); } if (this.props.web3.status === 'initialized' && Object.keys(this.props.accounts).length === 0) { return(

🦊

We can't find any Ethereum accounts!.

) } if (!this.props.contractInitialized) { return(

âš™

Initializing contracts...

If this takes too long please make sure they are deployed to the network.

) } if (!this.props.ipfsInitialized) { return(
ipfs_logo

Initializing IPFS...

) } //TODO: wtf is this if (this.props.drizzleStatus.initialized) return Children.only(this.props.children); //TODO: wtf is this if (this.props.loadingComp) return this.props.loadingComp; return(

âš™

Loading dapp...

) } } const mapStateToProps = state => { return { accounts: state.accounts, drizzleStatus: state.drizzleStatus, web3: state.web3, ipfsInitialized: state.orbit.ipfsInitialized, contractInitialized: state.contracts.Forum.initialized } }; export default connect(mapStateToProps)(LoadingContainer);