mirror of
https://github.com/status-im/keycard-redeem.git
synced 2025-02-18 15:07:32 +00:00
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) {
|
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';
|
import App from '../components/App';
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
|
initialized: state.web3.networkID,
|
||||||
|
networkID: state.web3.networkID,
|
||||||
account: state.web3.account,
|
account: state.web3.account,
|
||||||
|
error: state.web3.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user