X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fmain.jsx;h=7fa2d2601c2331b896c47e520431ba6634a69104;hb=d1c0ccfcb84f1b8778e38b027a333d03e1f4ae9e;hp=eb530577fa2ae53e4a075cde960f109fea702d19;hpb=7a9e5112eaaea58d55f181d3e5296e4ff839921c;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index eb53057..7fa2d26 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -1,18 +1,15 @@ -var SignupForm = require('./signup.js').SignupForm; -var SigninForm = require('./signin.js').SigninForm; -var OtpEnrollForm = require('./otp.js').OtpEnrollForm; -var PoloniexForm = require('./poloniex.js').PoloniexForm; -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 UserAccount from './account.js'; +import App from './app.js'; +import Api from './api.js'; +import cookies from './cookies.js'; +import React from 'react'; +import qs from 'qs'; App.page('/signup', false, function(context) { if (App.isUserSignedIn()) { @@ -20,12 +17,9 @@ App.page('/signup', false, function(context) { return; } - App.mount( -
- + App.mount(
-
- ); +
); }); App.page('/signin', false, function(context) { @@ -34,11 +28,58 @@ 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('/confirm', false, function(context) { + var token = qs.parse(context.querystring).token; + + if (token === undefined) { + App.go('/'); + return; + } + + Api.Call( + 'CONFIRM_EMAIL', + {'token': token}, + function(err, status, data) { + if (err) { + console.error(err, data); + } + + App.go('/me'); + } ); }); @@ -49,21 +90,26 @@ App.page('/signout', true, function(context) { }); App.page('/me', true, function(context) { - Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) { - if (err) { - console.error(err, data); - return; - } + App.mount(
+ +
); +}); - App.mount( -
- -

Poloniex

- -
- ); +App.page('/account', true, function(context) { + App.mount(
+ +
); +}); - }.bind(this)); +App.page('/not_confirmed', true, function(context) { + App.mount(
+
+
+

An email has now been sent to your email address.

+

{'Please click the \'Confirm your account\' button to validate your email.'}

+
+
+
); }); App.page('/otp/setup', true, function(context) { @@ -73,23 +119,17 @@ 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) {