Skip to content

Commit

Permalink
Toggle component needs an id
Browse files Browse the repository at this point in the history
  • Loading branch information
rvennam987 committed Jun 28, 2017
1 parent 475a4c9 commit 563474b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions ui-react/src/User/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class User extends Component {
super(props);
this.state = {
route: Route.LOGIN,
showBlocks:false
showBlocks: false
};
this.isLoggedIn = this.isLoggedIn.bind(this);
this.isLoggedIn();
Expand All @@ -40,12 +40,11 @@ class User extends Component {
}

onToggleBlocks() {
this.setState({
showBlocks: !this.state.showBlocks
});
console.log('toggle')

}
this.setState({
showBlocks: !this.state.showBlocks
});
console.log('toggle');
}

onLoggedIn() {
this.setState({
Expand Down Expand Up @@ -98,10 +97,17 @@ class User extends Component {
<Phone homeButton={this.logout}>
{view}
</Phone>
{(this.state.showBlocks) && <BlockExplorer/> }
{(this.state.showBlocks) && <BlockExplorer /> }
</div>
</div>
<Toggle labelA="Hide Blockchain" labelB="Show Blockchain" className="toggler" toggled={this.state.showBlocks} onToggle={this.onToggleBlocks}></Toggle>
<Toggle
id="myToggle"
labelA="Hide Blockchain"
labelB="Show Blockchain"
className="toggler"
toggled={this.state.showBlocks}
onToggle={this.onToggleBlocks}
/>
</div>
</div>
</SiteLayout>
Expand Down

0 comments on commit 563474b

Please sign in to comment.