From 2f91f20a8645339385ada602684f4957f20f4da4 Mon Sep 17 00:00:00 2001
From: jloup <jeanloup.jamet@gmail.com>
Date: Thu, 22 Feb 2018 11:31:59 +0100
Subject: Poloniex connection.

---
 cmd/web/js/main.jsx | 41 +++++++++++++++++------------------------
 1 file changed, 17 insertions(+), 24 deletions(-)

(limited to 'cmd/web/js/main.jsx')

diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx
index eb53057..e5e505d 100644
--- a/cmd/web/js/main.jsx
+++ b/cmd/web/js/main.jsx
@@ -1,15 +1,17 @@
-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 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 (<div id='logo'>
-              <a href='/'>Cryptoportfolio</a>
+    return (<div className='row'>
+              <div id='logo' className='offset-4 col-4'>
+                <a href='/'>Cryptoportfolio</a>
+              </div>
             </div>);
   }
 });
@@ -49,21 +51,12 @@ 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(
-      <div>
-        <Logo />
-        <p>Poloniex</p>
-        <PoloniexForm apiKey={data.key} apiSecret={data.secret}/>
-      </div>
-    );
-
-  }.bind(this));
+  App.mount(
+    <div>
+      <Logo />
+      <PoloniexController/>
+    </div>
+  );
 });
 
 App.page('/otp/setup', true, function(context) {
-- 
cgit v1.2.3

