on 77325bb help sign in
bridge/src/common/components/AppNavigation.js
39 lines 839 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: 'fixed',
25 bottom: '10px',
26 right: '10px',
27 textDecoration: 'underline',
28 cursor: 'pointer',
29 };
31 return (
32 <span style={style} onClick={this.navigate}>
33 {buttonText}
34 </span>
35 );
36 }
39export { AppNavigation };