diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-03-28 09:47:22 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-03-28 09:47:43 +0200 |
commit | e8bec33231a620579ccd1acd30824fd6c3a13dc2 (patch) | |
tree | 0bf17284382e55a29d83e5967d1243b19574d395 /src/pages/auditors.tsx | |
parent | 2a1ece8417df48c4aac54851397e2f0ee87b9f06 (diff) |
add auditor editing
Diffstat (limited to 'src/pages/auditors.tsx')
-rw-r--r-- | src/pages/auditors.tsx | 35 |
1 files changed, 23 insertions, 12 deletions
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> |