From e8bec33231a620579ccd1acd30824fd6c3a13dc2 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Tue, 28 Mar 2017 09:47:22 +0200
Subject: add auditor editing

---
 src/pages/auditors.tsx | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

(limited to 'src/pages/auditors.tsx')

diff --git a/src/pages/auditors.tsx b/src/pages/auditors.tsx
index b0bce8fd5..7cffec403 100644
--- a/src/pages/auditors.tsx
+++ b/src/pages/auditors.tsx
@@ -62,28 +62,39 @@ class CurrencyList extends React.Component<any, CurrencyListState> {
     }
   }
 
+  renderAuditors(c: CurrencyRecord): any {
+    if (c.auditors.length == 0) {
+      return <p>No trusted auditors for this currency.</p>
+    }
+    return (
+      <div>
+        <p>Trusted Auditors:</p>
+        <ul>
+        {c.auditors.map(a => (
+          <li>{a.baseUrl} <button className="pure-button button-destructive" onClick={() => this.confirmRemove(c, a)}>Remove</button>
+            <ul>
+              <li>valid until {new Date(a.expirationStamp).toString()}</li>
+              <li>public key {a.auditorPub}</li>
+            </ul>
+          </li>
+        ))}
+        </ul>
+      </div>
+    );
+  }
+
   render(): JSX.Element {
     let currencies = this.state.currencies;
     if (!currencies) {
       return <span>...</span>;
     }
     return (
-      <div>
+      <div id="main">
       {currencies.map(c => (
         <div>
           <h1>Currency {c.name}</h1>
           <p>Displayed with {c.fractionalDigits} fractional digits.</p>
-          <p>Auditors:</p>
-          <ul>
-          {c.auditors.map(a => (
-            <li>{a.baseUrl} (<button className="button-linky" onClick={() => this.confirmRemove(c, a)}>Remove</button>)
-              <ul>
-                <li>valid until {new Date(a.expirationStamp).toString()}</li>
-                <li>public key {a.auditorPub}</li>
-              </ul>
-            </li>
-          ))}
-          </ul>
+          <div>{this.renderAuditors(c)}</div>
         </div>
       ))}
       </div>
-- 
cgit v1.2.3

