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, error: null,
activeKey: 1, activeKey: 1,
whisperEnabled: false, whisperEnabled: false,
storageEnabled: false storageEnabled: false,
blockchainEnabled: false
}; };
} }
componentDidMount() { componentDidMount() {
EmbarkJS.onReady((err) => { EmbarkJS.onReady((err) => {
this.setState({blockchainEnabled: true});
if (err) { if (err) {
// If err is not null then it means something went wrong connecting to ethereum // 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 // 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> return (<div>
<h3>Embark - Usage Example</h3> <h3>Embark - Usage Example</h3>
<Tabs onSelect={this.handleSelect} activeKey={this.state.activeKey} id="uncontrolled-tab-example"> <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/> <Blockchain/>
</Tab> </Tab>
<Tab eventKey={2} title={this._renderStatus('Decentralized Storage', this.state.storageEnabled)}> <Tab eventKey={2} title={this._renderStatus('Decentralized Storage', this.state.storageEnabled)}>