aboutsummaryrefslogtreecommitdiff
path: root/cmd/web
diff options
context:
space:
mode:
authorjloup <jeanloup.jamet@gmail.com>2018-02-25 21:11:38 +0100
committerjloup <jeanloup.jamet@gmail.com>2018-02-25 21:11:38 +0100
commitee902062a71c1ef31176cf5061555618b288b1d4 (patch)
treebd5d6c47567fc043c68a054ab914c8bd31114674 /cmd/web
parentadf936f66a5c59e6cc2e7a1c644148e0f119e5c8 (diff)
downloadFront-ee902062a71c1ef31176cf5061555618b288b1d4.tar.gz
Front-ee902062a71c1ef31176cf5061555618b288b1d4.tar.zst
Front-ee902062a71c1ef31176cf5061555618b288b1d4.zip
Logout link.
Diffstat (limited to 'cmd/web')
-rw-r--r--cmd/web/js/main.jsx41
-rw-r--r--cmd/web/js/otp.jsx1
-rw-r--r--cmd/web/static/style.css10
3 files changed, 39 insertions, 13 deletions
diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx
index 79bf976..c95c748 100644
--- a/cmd/web/js/main.jsx
+++ b/cmd/web/js/main.jsx
@@ -7,13 +7,32 @@ import Api from './api.js';
7import cookies from './cookies.js'; 7import cookies from './cookies.js';
8import React from 'react'; 8import React from 'react';
9 9
10class Header extends React.Component {
11 render = () => {
12 if (this.props.displayLogout === true) {
13 return <div id="header" className="row">
14 <div className="offset-4 col-4">
15 <Logo />
16 </div>
17 <div className="offset-2 col-2 align-self-center h-100">
18 <a href="/signout"><u>Logout</u></a>
19 </div>
20 </div>;
21 }
22 return <div id="header" className="row">
23 <div className="offset-4 col-4">
24 <Logo />
25 </div>
26 </div>;
27
28 }
29}
30
10class Logo extends React.Component { 31class Logo extends React.Component {
11 render() { 32 render() {
12 return <div className="row"> 33 return <div id="logo" className="w-100">
13 <div id="logo" className="offset-4 col-4"> 34 <h1><a href="/">CryptoPF</a></h1>
14 <a href="/">Cryptoportfolio</a> 35 </div>;
15 </div>
16 </div>;
17 } 36 }
18} 37}
19 38
@@ -24,7 +43,7 @@ App.page('/signup', false, function(context) {
24 } 43 }
25 44
26 App.mount(<div> 45 App.mount(<div>
27 <Logo /> 46 <Header />
28 <SignupForm onSuccess={App.onUserSignUp}/> 47 <SignupForm onSuccess={App.onUserSignUp}/>
29 </div>); 48 </div>);
30}); 49});
@@ -36,7 +55,7 @@ App.page('/signin', false, function(context) {
36 } 55 }
37 56
38 App.mount(<div> 57 App.mount(<div>
39 <Logo /> 58 <Header />
40 <SigninForm onSuccess={App.onUserSignIn}/> 59 <SigninForm onSuccess={App.onUserSignIn}/>
41 </div>); 60 </div>);
42}); 61});
@@ -49,14 +68,14 @@ App.page('/signout', true, function(context) {
49 68
50App.page('/me', true, function(context) { 69App.page('/me', true, function(context) {
51 App.mount(<div> 70 App.mount(<div>
52 <Logo /> 71 <Header displayLogout={true} />
53 <PoloniexController/> 72 <PoloniexController/>
54 </div>); 73 </div>);
55}); 74});
56 75
57App.page('/not_confirmed', true, function(context) { 76App.page('/not_confirmed', true, function(context) {
58 App.mount(<div> 77 App.mount(<div>
59 <Logo /> 78 <Header displayLogout={true}/>
60 <div className="row"> 79 <div className="row">
61 <div className="box offset-3 col-6 text-center"> 80 <div className="box offset-3 col-6 text-center">
62 <p>Please be patient, you account is being confirmed...</p> 81 <p>Please be patient, you account is being confirmed...</p>
@@ -74,7 +93,7 @@ App.page('/otp/setup', true, function(context) {
74 } 93 }
75 94
76 App.mount(<div> 95 App.mount(<div>
77 <Logo /> 96 <Header displayLogout={true}/>
78 <OtpEnrollForm onSuccess={App.onUserValidateOtp} img={'data:image/png;base64,' + data.base64img} secret={data.secret}/> 97 <OtpEnrollForm onSuccess={App.onUserValidateOtp} img={'data:image/png;base64,' + data.base64img} secret={data.secret}/>
79 </div>); 98 </div>);
80 99
@@ -83,7 +102,7 @@ App.page('/otp/setup', true, function(context) {
83 102
84App.page('/otp/validate', true, function(context) { 103App.page('/otp/validate', true, function(context) {
85 App.mount(<div> 104 App.mount(<div>
86 <Logo /> 105 <Header displayLogout={true}/>
87 <OtpEnrollForm onSuccess={App.onUserValidateOtp} /> 106 <OtpEnrollForm onSuccess={App.onUserValidateOtp} />
88 </div>); 107 </div>);
89}); 108});
diff --git a/cmd/web/js/otp.jsx b/cmd/web/js/otp.jsx
index aecf032..6c22c8c 100644
--- a/cmd/web/js/otp.jsx
+++ b/cmd/web/js/otp.jsx
@@ -55,6 +55,7 @@ class OtpEnrollForm extends React.Component {
55 if (this.props.img) { 55 if (this.props.img) {
56 qrCode = 56 qrCode =
57 <div className="row justify-content-center"> 57 <div className="row justify-content-center">
58 <p>Please setup 2FA (Google Authenticator, Authy)</p>
58 <OtpQrCode img={this.props.img} secret={this.props.secret} /> 59 <OtpQrCode img={this.props.img} secret={this.props.secret} />
59 </div>; 60 </div>;
60} 61}
diff --git a/cmd/web/static/style.css b/cmd/web/static/style.css
index bfa43f0..cdbcd06 100644
--- a/cmd/web/static/style.css
+++ b/cmd/web/static/style.css
@@ -32,14 +32,20 @@ i.cc {
32 text-align: center; 32 text-align: center;
33 display: inline-block; 33 display: inline-block;
34 color: white; 34 color: white;
35 font-size: 28px;
36 background-color: rgb(20, 20, 20); 35 background-color: rgb(20, 20, 20);
37 border-radius: 4px; 36 border-radius: 4px;
38 font-weight: bold; 37 font-weight: bold;
39 padding: 10px 10px 10px 10px; 38 padding: 10px 10px 10px 10px;
40 vertical-align: middle; 39 vertical-align: middle;
41 margin-bottom: 30px; 40}
41
42#header {
42 margin-top: 20px; 43 margin-top: 20px;
44 margin-bottom: 30px;
45}
46
47h1 {
48 font-size: 1.5em;
43} 49}
44 50
45.sign-in .form-control { 51.sign-in .form-control {