diff --git a/src/components/Header/index.jsx b/src/components/Header/index.jsx index e73377ac..13ad649f 100644 --- a/src/components/Header/index.jsx +++ b/src/components/Header/index.jsx @@ -2,7 +2,10 @@ import * as React from 'react' import { connect } from 'react-redux' import { logComponentStack, type Info } from '~/utils/logBoundaries' -import Provider from './component/Provider' +import ProviderInfo from './component/ProviderInfo' +import ProviderDetails from './component/ProviderInfo/UserDetails' +import ProviderDisconnected from './component/ProviderDisconnected' +import ConnectDetails from './component/ProviderDisconnected/ConnectDetails' import Layout from './component/Layout' import actions from './actions' import selector from './selector' @@ -34,36 +37,48 @@ class Header extends React.PureComponent { logComponentStack(error, info) } - reloadWallet = () => { - this.props.fetchProvider() + getProviderInfoBased = (hasError, disconnected) => { + if (hasError) { + // return + } + + if (disconnected) { + return + } + + const { + provider, network, userAddress, connected, + } = this.props + + return + } + + getProviderDetailsBased = (hasError, disconnected) => { + if (hasError) { + // return + } + + if (disconnected) { + return + } + + const { + provider, network, userAddress, connected, + } = this.props + + return } render() { - const { - provider, userAddress, network, connected, - } = this.props + const { connected } = this.props const { hasError } = this.state + const providerDisconnected = !hasError && !connected - // const providerDisconnected = !hasError && !connected - const providerConnected = !hasError && connected + const info = this.getProviderInfoBased(hasError, providerDisconnected) + const details = this.getProviderDetailsBased(hasError, providerDisconnected) - return ( - - {/* hasError && */} - {/* providerDisconnected && */} - { providerConnected && - - } - - ) + return } }