import cookies from './cookies.js';
import React from 'react';
+class Header extends React.Component {
+ render = () => {
+ if (this.props.displayLogout === true) {
+ return <div id="header" className="row">
+ <div className="offset-4 col-4">
+ <Logo />
+ </div>
+ <div className="offset-2 col-2 align-self-center h-100">
+ <a href="/signout"><u>Logout</u></a>
+ </div>
+ </div>;
+ }
+ return <div id="header" className="row">
+ <div className="offset-4 col-4">
+ <Logo />
+ </div>
+ </div>;
+
+ }
+}
+
class Logo extends React.Component {
render() {
- return <div className="row">
- <div id="logo" className="offset-4 col-4">
- <a href="/">Cryptoportfolio</a>
- </div>
- </div>;
+ return <div id="logo" className="w-100">
+ <h1><a href="/">CryptoPF</a></h1>
+ </div>;
}
}
}
App.mount(<div>
- <Logo />
+ <Header />
<SignupForm onSuccess={App.onUserSignUp}/>
</div>);
});
}
App.mount(<div>
- <Logo />
+ <Header />
<SigninForm onSuccess={App.onUserSignIn}/>
</div>);
});
App.page('/me', true, function(context) {
App.mount(<div>
- <Logo />
+ <Header displayLogout={true} />
<PoloniexController/>
</div>);
});
App.page('/not_confirmed', true, function(context) {
App.mount(<div>
- <Logo />
+ <Header displayLogout={true}/>
<div className="row">
<div className="box offset-3 col-6 text-center">
<p>Please be patient, you account is being confirmed...</p>
}
App.mount(<div>
- <Logo />
+ <Header displayLogout={true}/>
<OtpEnrollForm onSuccess={App.onUserValidateOtp} img={'data:image/png;base64,' + data.base64img} secret={data.secret}/>
</div>);
App.page('/otp/validate', true, function(context) {
App.mount(<div>
- <Logo />
+ <Header displayLogout={true}/>
<OtpEnrollForm onSuccess={App.onUserValidateOtp} />
</div>);
});