Adding blockchain indicator

This commit is contained in:
Anthony Laibe 2018-09-11 09:11:22 +01:00
parent 8c3ac34fac
commit 0884cd7c8e
1 changed files with 4 additions and 2 deletions

View File

@ -21,12 +21,14 @@ class App extends React.Component {
error: null,
activeKey: 1,
whisperEnabled: false,
storageEnabled: false
storageEnabled: false,
blockchainEnabled: false
};
}
componentDidMount() {
EmbarkJS.onReady((err) => {
this.setState({blockchainEnabled: true});
if (err) {
// If err is not null then it means something went wrong connecting to ethereum
// you can use this to ask the user to enable metamask for e.g
@ -81,7 +83,7 @@ class App extends React.Component {
return (<div>
<h3>Embark - Usage Example</h3>
<Tabs onSelect={this.handleSelect} activeKey={this.state.activeKey} id="uncontrolled-tab-example">
<Tab eventKey={1} title="Blockchain">
<Tab eventKey={1} title={this._renderStatus('Blockchain', this.state.blockchainEnabled)}>
<Blockchain/>
</Tab>
<Tab eventKey={2} title={this._renderStatus('Decentralized Storage', this.state.storageEnabled)}>