on e9a3a34 help sign in
bridge/src/components/AppNavigation.js
42 lines 812 B history raw
1import React from 'react';
3class AppNavigation extends React.Component {
4 constructor(props) {
5 super(props)
7 this.navigate = this.navigate.bind(this)
8 }
10 navigate() {
11 let appView;
12 if (this.props.appView === "bridge") appView = "walletgen"
13 if (this.props.appView === "walletgen") appView = "bridge"
15 this.props.setView(appView)
16 }
18 render() {
19 let buttonText;
20 if (this.props.appView === "bridge") buttonText = "Go to Walletgen"
21 if (this.props.appView === "walletgen") buttonText = "Go to Bridge"
23 let style = {
24 position: "absolute",
25 top: "10px",
26 right: "10px"
27 }
29 return (
30 <button
31 type="button"
32 style={style}
33 onClick={this.navigate}>
34 {buttonText}
35 </button>
36 )
37 }
40export {
41 AppNavigation