Merge pull request #805 from embark-framework/feature/blockchain-indicator

Adding blockchain indicator
This commit is contained in:
Iuri Matias 2018-09-11 14:00:01 -04:00 committed by GitHub
commit cbd208cae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)}>