X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fmain.jsx;h=909f1bd9a26f5b8037069b2d96a91dd98d900e29;hb=85545aba62546f219a9c9730945511412a3174ef;hp=e5e505d8daa5ef4ba301c5112b026bf4aebe69ae;hpb=2f91f20a8645339385ada602684f4957f20f4da4;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index e5e505d..909f1bd 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -1,20 +1,43 @@ -var SignupForm = require('./signup.js').SignupForm; -var SigninForm = require('./signin.js').SigninForm; -var OtpEnrollForm = require('./otp.js').OtpEnrollForm; -var PoloniexController = require('./poloniex.js').PoloniexController; -var App = require('./app.js'); -var Api = require('./api.js').Api; -var cookies = require('./cookies.js'); - -var Logo = React.createClass({ - render: function() { - return (
- -
); +import SignupForm from './signup.js'; +import SigninForm from './signin.js'; +import PasswordResetForm from './password_reset.js'; +import ChangePasswordForm from './change_password.js'; +import OtpEnrollForm from './otp.js'; +import PoloniexController from './poloniex.js'; +import App from './app.js'; +import Api from './api.js'; +import cookies from './cookies.js'; +import React from 'react'; +import qs from 'qs'; + +class Header extends React.Component { + render = () => { + if (this.props.displayLogout === true) { + return ; + } + return ; + } -}); +} + +class Logo extends React.Component { + render() { + return ; + } +} App.page('/signup', false, function(context) { if (App.isUserSignedIn()) { @@ -22,12 +45,10 @@ App.page('/signup', false, function(context) { return; } - App.mount( -
- + App.mount(
+
-
- ); +
); }); App.page('/signin', false, function(context) { @@ -36,12 +57,41 @@ App.page('/signin', false, function(context) { return; } - App.mount( -
- + App.mount(
+
-
- ); +
); +}); + +App.page('/reset-password', false, function(context) { + if (App.isUserSignedIn()) { + App.go('/me'); + return; + } + + App.mount(
+
+ +
); +}); + +App.page('/change-password', false, function(context) { + if (App.isUserSignedIn()) { + App.go('/me'); + return; + } + + var token = qs.parse(context.querystring).token; + + if (token === undefined) { + App.go('/'); + return; + } + + App.mount(
+
+ +
); }); App.page('/signout', true, function(context) { @@ -51,12 +101,22 @@ App.page('/signout', true, function(context) { }); App.page('/me', true, function(context) { - App.mount( -
- + App.mount(
+
-
- ); +
); +}); + +App.page('/not_confirmed', true, function(context) { + App.mount(
+
+
+
+

Please be patient, you account is being confirmed...

+

Refresh

+
+
+
); }); App.page('/otp/setup', true, function(context) { @@ -66,23 +126,19 @@ App.page('/otp/setup', true, function(context) { return; } - App.mount( -
- + App.mount(
+
-
- ); +
); - }.bind(this)); + }); }); App.page('/otp/validate', true, function(context) { - App.mount( -
- + App.mount(
+
-
- ); +
); }); App.page('/', false, function(context) {