display account, net ID, and error
This commit is contained in:
parent
9f4c668029
commit
438aa2ad7a
|
@ -1,4 +1,19 @@
|
|||
import React from 'react';
|
||||
|
||||
export default function App(props) {
|
||||
return `Hello World ${props.account}`;
|
||||
if (!props.initialized) {
|
||||
return "initializing...";
|
||||
}
|
||||
|
||||
if (props.error) {
|
||||
return <>
|
||||
<p>Error: {props.error}</p>
|
||||
</>;
|
||||
}
|
||||
|
||||
return <>
|
||||
<p>Network ID {props.networkID}</p>
|
||||
<p>Hello {props.account}</p>
|
||||
</>;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,10 @@ import { connect } from 'react-redux';
|
|||
import App from '../components/App';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
initialized: state.web3.networkID,
|
||||
networkID: state.web3.networkID,
|
||||
account: state.web3.account,
|
||||
error: state.web3.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
|
Loading…
Reference in New Issue