aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/auditors.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-30 16:09:32 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-30 16:09:32 +0530
commitaaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf (patch)
tree9274139660f30c4857d80044eb4ac283aac1775a /src/webex/pages/auditors.tsx
parent15e18440dbad55df19977a2eb7053681259afc18 (diff)
downloadwallet-core-aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf.tar.gz
wallet-core-aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf.tar.bz2
wallet-core-aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf.zip
re-format with prettier v2, fix HTML
Diffstat (limited to 'src/webex/pages/auditors.tsx')
-rw-r--r--src/webex/pages/auditors.tsx84
1 files changed, 47 insertions, 37 deletions
diff --git a/src/webex/pages/auditors.tsx b/src/webex/pages/auditors.tsx
index 876cf326b..e2bb29af1 100644
--- a/src/webex/pages/auditors.tsx
+++ b/src/webex/pages/auditors.tsx
@@ -20,17 +20,13 @@
* @author Florian Dold
*/
-
import {
AuditorRecord,
CurrencyRecord,
ExchangeForCurrencyRecord,
} from "../../types/dbTypes";
-import {
- getCurrencies,
- updateCurrency,
-} from "../wxApi";
+import { getCurrencies, updateCurrency } from "../wxApi";
import * as React from "react";
import * as ReactDOM from "react-dom";
@@ -60,14 +56,22 @@ class CurrencyList extends React.Component<{}, CurrencyListState> {
}
async confirmRemoveAuditor(c: CurrencyRecord, a: AuditorRecord) {
- if (window.confirm(`Do you really want to remove auditor ${a.baseUrl} for currency ${c.name}?`)) {
+ if (
+ window.confirm(
+ `Do you really want to remove auditor ${a.baseUrl} for currency ${c.name}?`,
+ )
+ ) {
c.auditors = c.auditors.filter((x) => x.auditorPub !== a.auditorPub);
await updateCurrency(c);
}
}
async confirmRemoveExchange(c: CurrencyRecord, e: ExchangeForCurrencyRecord) {
- if (window.confirm(`Do you really want to remove exchange ${e.baseUrl} for currency ${c.name}?`)) {
+ if (
+ window.confirm(
+ `Do you really want to remove exchange ${e.baseUrl} for currency ${c.name}?`,
+ )
+ ) {
c.exchanges = c.exchanges.filter((x) => x.baseUrl !== e.baseUrl);
await updateCurrency(c);
}
@@ -81,18 +85,21 @@ class CurrencyList extends React.Component<{}, CurrencyListState> {
<div>
<p>Trusted Auditors:</p>
<ul>
- {c.auditors.map((a) => (
- <li>
- {a.baseUrl}{" "}
- <button className="pure-button button-destructive" onClick={() => this.confirmRemoveAuditor(c, a)}>
- Remove
- </button>
- <ul>
- <li>valid until {new Date(a.expirationStamp).toString()}</li>
- <li>public key {a.auditorPub}</li>
- </ul>
- </li>
- ))}
+ {c.auditors.map((a) => (
+ <li>
+ {a.baseUrl}{" "}
+ <button
+ className="pure-button button-destructive"
+ onClick={() => this.confirmRemoveAuditor(c, a)}
+ >
+ Remove
+ </button>
+ <ul>
+ <li>valid until {new Date(a.expirationStamp).toString()}</li>
+ <li>public key {a.auditorPub}</li>
+ </ul>
+ </li>
+ ))}
</ul>
</div>
);
@@ -106,14 +113,17 @@ class CurrencyList extends React.Component<{}, CurrencyListState> {
<div>
<p>Trusted Exchanges:</p>
<ul>
- {c.exchanges.map((e) => (
- <li>
- {e.baseUrl}{" "}
- <button className="pure-button button-destructive" onClick={() => this.confirmRemoveExchange(c, e)}>
- Remove
- </button>
- </li>
- ))}
+ {c.exchanges.map((e) => (
+ <li>
+ {e.baseUrl}{" "}
+ <button
+ className="pure-button button-destructive"
+ onClick={() => this.confirmRemoveExchange(c, e)}
+ >
+ Remove
+ </button>
+ </li>
+ ))}
</ul>
</div>
);
@@ -126,16 +136,16 @@ class CurrencyList extends React.Component<{}, CurrencyListState> {
}
return (
<div id="main">
- {currencies.map((c) => (
- <div>
- <h1>Currency {c.name}</h1>
- <p>Displayed with {c.fractionalDigits} fractional digits.</p>
- <h2>Auditors</h2>
- <div>{this.renderAuditors(c)}</div>
- <h2>Exchanges</h2>
- <div>{this.renderExchanges(c)}</div>
- </div>
- ))}
+ {currencies.map((c) => (
+ <div>
+ <h1>Currency {c.name}</h1>
+ <p>Displayed with {c.fractionalDigits} fractional digits.</p>
+ <h2>Auditors</h2>
+ <div>{this.renderAuditors(c)}</div>
+ <h2>Exchanges</h2>
+ <div>{this.renderExchanges(c)}</div>
+ </div>
+ ))}
</div>
);
}