diff options
author | jloup <jeanloup.jamet@gmail.com> | 2018-05-05 12:36:58 +0200 |
---|---|---|
committer | jloup <jeanloup.jamet@gmail.com> | 2018-05-05 12:38:08 +0200 |
commit | 87b6d05e5b289f3e9d1554fe455296ba09655c3a (patch) | |
tree | bcf6a679f435216840a749a311470583cd0f05c3 /cmd/web/js/main.jsx | |
parent | 8dbd9d291b203424d3c06755c7e24f71cc5b8bb7 (diff) | |
download | Front-87b6d05e5b289f3e9d1554fe455296ba09655c3a.tar.gz Front-87b6d05e5b289f3e9d1554fe455296ba09655c3a.tar.zst Front-87b6d05e5b289f3e9d1554fe455296ba09655c3a.zip |
Factorize Header/Footer code.v0.0.7
Diffstat (limited to 'cmd/web/js/main.jsx')
-rw-r--r-- | cmd/web/js/main.jsx | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index 909f1bd..8a4fce8 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx | |||
@@ -10,35 +10,6 @@ import cookies from './cookies.js'; | |||
10 | import React from 'react'; | 10 | import React from 'react'; |
11 | import qs from 'qs'; | 11 | import qs from 'qs'; |
12 | 12 | ||
13 | class Header extends React.Component { | ||
14 | render = () => { | ||
15 | if (this.props.displayLogout === true) { | ||
16 | return <div id="header" className="row"> | ||
17 | <div className="offset-4 col-4"> | ||
18 | <Logo /> | ||
19 | </div> | ||
20 | <div className="offset-2 col-2 align-self-center h-100"> | ||
21 | <a href="/signout"><u>Logout</u></a> | ||
22 | </div> | ||
23 | </div>; | ||
24 | } | ||
25 | return <div id="header" className="row"> | ||
26 | <div className="offset-4 col-4"> | ||
27 | <Logo /> | ||
28 | </div> | ||
29 | </div>; | ||
30 | |||
31 | } | ||
32 | } | ||
33 | |||
34 | class Logo extends React.Component { | ||
35 | render() { | ||
36 | return <div id="logo" className="w-100 h-100 align-self-center"> | ||
37 | <h1><a href="/">CryptoPF</a></h1> | ||
38 | </div>; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | App.page('/signup', false, function(context) { | 13 | App.page('/signup', false, function(context) { |
43 | if (App.isUserSignedIn()) { | 14 | if (App.isUserSignedIn()) { |
44 | App.go('/me'); | 15 | App.go('/me'); |
@@ -46,7 +17,6 @@ App.page('/signup', false, function(context) { | |||
46 | } | 17 | } |
47 | 18 | ||
48 | App.mount(<div> | 19 | App.mount(<div> |
49 | <Header /> | ||
50 | <SignupForm onSuccess={App.onUserSignUp}/> | 20 | <SignupForm onSuccess={App.onUserSignUp}/> |
51 | </div>); | 21 | </div>); |
52 | }); | 22 | }); |
@@ -58,7 +28,6 @@ App.page('/signin', false, function(context) { | |||
58 | } | 28 | } |
59 | 29 | ||
60 | App.mount(<div> | 30 | App.mount(<div> |
61 | <Header /> | ||
62 | <SigninForm onSuccess={App.onUserSignIn}/> | 31 | <SigninForm onSuccess={App.onUserSignIn}/> |
63 | </div>); | 32 | </div>); |
64 | }); | 33 | }); |
@@ -70,7 +39,6 @@ App.page('/reset-password', false, function(context) { | |||
70 | } | 39 | } |
71 | 40 | ||
72 | App.mount(<div> | 41 | App.mount(<div> |
73 | <Header /> | ||
74 | <PasswordResetForm /> | 42 | <PasswordResetForm /> |
75 | </div>); | 43 | </div>); |
76 | }); | 44 | }); |
@@ -89,7 +57,6 @@ App.page('/change-password', false, function(context) { | |||
89 | } | 57 | } |
90 | 58 | ||
91 | App.mount(<div> | 59 | App.mount(<div> |
92 | <Header /> | ||
93 | <ChangePasswordForm token={token} onSuccess={App.go.bind(App, '/signin')}/> | 60 | <ChangePasswordForm token={token} onSuccess={App.go.bind(App, '/signin')}/> |
94 | </div>); | 61 | </div>); |
95 | }); | 62 | }); |
@@ -102,14 +69,12 @@ App.page('/signout', true, function(context) { | |||
102 | 69 | ||
103 | App.page('/me', true, function(context) { | 70 | App.page('/me', true, function(context) { |
104 | App.mount(<div> | 71 | App.mount(<div> |
105 | <Header displayLogout={true} /> | ||
106 | <PoloniexController/> | 72 | <PoloniexController/> |
107 | </div>); | 73 | </div>); |
108 | }); | 74 | }); |
109 | 75 | ||
110 | App.page('/not_confirmed', true, function(context) { | 76 | App.page('/not_confirmed', true, function(context) { |
111 | App.mount(<div> | 77 | App.mount(<div> |
112 | <Header displayLogout={true}/> | ||
113 | <div className="row"> | 78 | <div className="row"> |
114 | <div className="box offset-3 col-6 text-center"> | 79 | <div className="box offset-3 col-6 text-center"> |
115 | <p>Please be patient, you account is being confirmed...</p> | 80 | <p>Please be patient, you account is being confirmed...</p> |
@@ -127,7 +92,6 @@ App.page('/otp/setup', true, function(context) { | |||
127 | } | 92 | } |
128 | 93 | ||
129 | App.mount(<div> | 94 | App.mount(<div> |
130 | <Header displayLogout={true}/> | ||
131 | <OtpEnrollForm onSuccess={App.onUserValidateOtp} img={'data:image/png;base64,' + data.base64img} secret={data.secret}/> | 95 | <OtpEnrollForm onSuccess={App.onUserValidateOtp} img={'data:image/png;base64,' + data.base64img} secret={data.secret}/> |
132 | </div>); | 96 | </div>); |
133 | 97 | ||
@@ -136,7 +100,6 @@ App.page('/otp/setup', true, function(context) { | |||
136 | 100 | ||
137 | App.page('/otp/validate', true, function(context) { | 101 | App.page('/otp/validate', true, function(context) { |
138 | App.mount(<div> | 102 | App.mount(<div> |
139 | <Header displayLogout={true}/> | ||
140 | <OtpEnrollForm onSuccess={App.onUserValidateOtp} /> | 103 | <OtpEnrollForm onSuccess={App.onUserValidateOtp} /> |
141 | </div>); | 104 | </div>); |
142 | }); | 105 | }); |