From d5b8f0ffbbde5fb8d41c3abb4b0969b962746b52 Mon Sep 17 00:00:00 2001
From: jloup <jloup@jloup.work>
Date: Sun, 13 May 2018 23:04:56 +0200
Subject: JS factorization + clean.

---
 cmd/web/js/balance.jsx | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

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

diff --git a/cmd/web/js/balance.jsx b/cmd/web/js/balance.jsx
index d141aa8..515a7ed 100644
--- a/cmd/web/js/balance.jsx
+++ b/cmd/web/js/balance.jsx
@@ -1,14 +1,13 @@
 import React from 'react';
 import moment from 'moment';
+import classnames from 'classnames';
 
 class CurrencyLogo extends React.Component {
     render = () => {
-      return <div className="d-inline-block h-100">
-               <img className="currency-logo align-top"
-                  src={'/public/icons/black/' + this.props.currency.toLowerCase() + '.svg' }
-                  title={this.props.currency}
-                  alt={this.props.currency} />
-             </div>;
+      var className = classnames('cc', this.props.currency, 'currency-logo');
+      return <i className={className}
+                title={this.props.currency}
+                alt={this.props.currency}></i>;
     }
  }
 
@@ -42,7 +41,7 @@ class CurrencyRate extends React.Component {
     render = () => {
         return <React.Fragment>
               <div className="row text-center">
-                <div className="d-inline col-2 text-left"><CurrencyLogo currency={this.props.currency} /><span>{this.props.currency}</span></div>
+                <div className="d-inline col-2 text-left"><CurrencyLogo currency={this.props.currency} /> <span>{this.props.currency}</span></div>
                 <div className="d-inline col-2">{this.props.positionType}</div>
                 <div className="d-inline col-2">{this.props.quantity}</div>
                 <div className="d-inline col-2">{this.props.BTCValue}</div>
-- 
cgit v1.2.3

