make tables scrollable when they would overflow, make long keys expandable
This commit is contained in:
parent
5e837207a1
commit
b855c547fb
@ -285,42 +285,42 @@ msgstr "Bezahlung bestätigen"
|
|||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr "Saldo"
|
msgstr "Saldo"
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:209
|
#: src/webex/renderHtml.tsx:212
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "Withdrawal fees:"
|
msgid "Withdrawal fees:"
|
||||||
msgstr "Abheben bei"
|
msgstr "Abheben bei"
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:210
|
#: src/webex/renderHtml.tsx:213
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Rounding loss:"
|
msgid "Rounding loss:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:211
|
#: src/webex/renderHtml.tsx:214
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Earliest expiration (for deposit): %1$s"
|
msgid "Earliest expiration (for deposit): %1$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:216
|
#: src/webex/renderHtml.tsx:220
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "# Coins"
|
msgid "# Coins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:217
|
#: src/webex/renderHtml.tsx:221
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:218
|
#: src/webex/renderHtml.tsx:222
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "Withdraw Fee"
|
msgid "Withdraw Fee"
|
||||||
msgstr "Abheben bei %1$s"
|
msgstr "Abheben bei %1$s"
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:219
|
#: src/webex/renderHtml.tsx:223
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Refresh Fee"
|
msgid "Refresh Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:220
|
#: src/webex/renderHtml.tsx:224
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Deposit Fee"
|
msgid "Deposit Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -282,42 +282,42 @@ msgstr ""
|
|||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:209
|
#: src/webex/renderHtml.tsx:212
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdrawal fees:"
|
msgid "Withdrawal fees:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:210
|
#: src/webex/renderHtml.tsx:213
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Rounding loss:"
|
msgid "Rounding loss:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:211
|
#: src/webex/renderHtml.tsx:214
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Earliest expiration (for deposit): %1$s"
|
msgid "Earliest expiration (for deposit): %1$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:216
|
#: src/webex/renderHtml.tsx:220
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "# Coins"
|
msgid "# Coins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:217
|
#: src/webex/renderHtml.tsx:221
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:218
|
#: src/webex/renderHtml.tsx:222
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdraw Fee"
|
msgid "Withdraw Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:219
|
#: src/webex/renderHtml.tsx:223
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Refresh Fee"
|
msgid "Refresh Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:220
|
#: src/webex/renderHtml.tsx:224
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Deposit Fee"
|
msgid "Deposit Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -282,42 +282,42 @@ msgstr ""
|
|||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:209
|
#: src/webex/renderHtml.tsx:212
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdrawal fees:"
|
msgid "Withdrawal fees:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:210
|
#: src/webex/renderHtml.tsx:213
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Rounding loss:"
|
msgid "Rounding loss:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:211
|
#: src/webex/renderHtml.tsx:214
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Earliest expiration (for deposit): %1$s"
|
msgid "Earliest expiration (for deposit): %1$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:216
|
#: src/webex/renderHtml.tsx:220
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "# Coins"
|
msgid "# Coins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:217
|
#: src/webex/renderHtml.tsx:221
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:218
|
#: src/webex/renderHtml.tsx:222
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdraw Fee"
|
msgid "Withdraw Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:219
|
#: src/webex/renderHtml.tsx:223
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Refresh Fee"
|
msgid "Refresh Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:220
|
#: src/webex/renderHtml.tsx:224
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Deposit Fee"
|
msgid "Deposit Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -282,42 +282,42 @@ msgstr ""
|
|||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:209
|
#: src/webex/renderHtml.tsx:212
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdrawal fees:"
|
msgid "Withdrawal fees:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:210
|
#: src/webex/renderHtml.tsx:213
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Rounding loss:"
|
msgid "Rounding loss:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:211
|
#: src/webex/renderHtml.tsx:214
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Earliest expiration (for deposit): %1$s"
|
msgid "Earliest expiration (for deposit): %1$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:216
|
#: src/webex/renderHtml.tsx:220
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "# Coins"
|
msgid "# Coins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:217
|
#: src/webex/renderHtml.tsx:221
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:218
|
#: src/webex/renderHtml.tsx:222
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdraw Fee"
|
msgid "Withdraw Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:219
|
#: src/webex/renderHtml.tsx:223
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Refresh Fee"
|
msgid "Refresh Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:220
|
#: src/webex/renderHtml.tsx:224
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Deposit Fee"
|
msgid "Deposit Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -163,7 +163,7 @@ strings['de'] = {
|
|||||||
"Saldo"
|
"Saldo"
|
||||||
],
|
],
|
||||||
"Withdrawal fees:": [
|
"Withdrawal fees:": [
|
||||||
"Abheben bei %1$s"
|
"Abheben bei"
|
||||||
],
|
],
|
||||||
"Rounding loss:": [
|
"Rounding loss:": [
|
||||||
""
|
""
|
||||||
|
@ -282,42 +282,42 @@ msgstr ""
|
|||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:209
|
#: src/webex/renderHtml.tsx:212
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdrawal fees:"
|
msgid "Withdrawal fees:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:210
|
#: src/webex/renderHtml.tsx:213
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Rounding loss:"
|
msgid "Rounding loss:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:211
|
#: src/webex/renderHtml.tsx:214
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Earliest expiration (for deposit): %1$s"
|
msgid "Earliest expiration (for deposit): %1$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:216
|
#: src/webex/renderHtml.tsx:220
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "# Coins"
|
msgid "# Coins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:217
|
#: src/webex/renderHtml.tsx:221
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:218
|
#: src/webex/renderHtml.tsx:222
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdraw Fee"
|
msgid "Withdraw Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:219
|
#: src/webex/renderHtml.tsx:223
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Refresh Fee"
|
msgid "Refresh Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/renderHtml.tsx:220
|
#: src/webex/renderHtml.tsx:224
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Deposit Fee"
|
msgid "Deposit Fee"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -42,7 +42,7 @@ import {
|
|||||||
refresh,
|
refresh,
|
||||||
} from "../wxApi";
|
} from "../wxApi";
|
||||||
|
|
||||||
import { renderAmount } from "../renderHtml";
|
import { ExpanderText, renderAmount } from "../renderHtml";
|
||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as ReactDOM from "react-dom";
|
import * as ReactDOM from "react-dom";
|
||||||
@ -244,49 +244,6 @@ interface DenominationListProps {
|
|||||||
exchange: ExchangeRecord;
|
exchange: ExchangeRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ExpanderTextProps {
|
|
||||||
text: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ExpanderText extends ImplicitStateComponent<ExpanderTextProps> {
|
|
||||||
private expanded = this.makeState<boolean>(false);
|
|
||||||
private textArea: any = undefined;
|
|
||||||
|
|
||||||
componentDidUpdate() {
|
|
||||||
if (this.expanded() && this.textArea) {
|
|
||||||
this.textArea.focus();
|
|
||||||
this.textArea.scrollTop = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render(): JSX.Element {
|
|
||||||
if (!this.expanded()) {
|
|
||||||
return (
|
|
||||||
<span onClick={() => { this.expanded(true); }}>
|
|
||||||
{(this.props.text.length <= 10)
|
|
||||||
? this.props.text
|
|
||||||
: (
|
|
||||||
<span>
|
|
||||||
{this.props.text.substring(0, 10)}
|
|
||||||
<span style={{textDecoration: "underline"}}>...</span>
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<textarea
|
|
||||||
readOnly
|
|
||||||
style={{display: "block"}}
|
|
||||||
onBlur={() => this.expanded(false)}
|
|
||||||
ref={(e) => this.textArea = e}>
|
|
||||||
{this.props.text}
|
|
||||||
</textarea>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class DenominationList extends ImplicitStateComponent<DenominationListProps> {
|
class DenominationList extends ImplicitStateComponent<DenominationListProps> {
|
||||||
private expanded = this.makeState<boolean>(false);
|
private expanded = this.makeState<boolean>(false);
|
||||||
private denoms = this.makeState<undefined|DenominationRecord[]>(undefined);
|
private denoms = this.makeState<undefined|DenominationRecord[]>(undefined);
|
||||||
|
@ -31,6 +31,8 @@ import {
|
|||||||
ReserveCreationInfo,
|
ReserveCreationInfo,
|
||||||
} from "../types";
|
} from "../types";
|
||||||
|
|
||||||
|
import { ImplicitStateComponent } from "./components";
|
||||||
|
|
||||||
import * as moment from "moment";
|
import * as moment from "moment";
|
||||||
|
|
||||||
import * as i18n from "../i18n";
|
import * as i18n from "../i18n";
|
||||||
@ -131,7 +133,7 @@ function AuditorDetailsView(props: {rci: ReserveCreationInfo|null}): JSX.Element
|
|||||||
{rci.exchangeInfo.auditors.map((a) => (
|
{rci.exchangeInfo.auditors.map((a) => (
|
||||||
<div>
|
<div>
|
||||||
<h3>Auditor {a.auditor_url}</h3>
|
<h3>Auditor {a.auditor_url}</h3>
|
||||||
<p>Public key: {a.auditor_pub}</p>
|
<p>Public key: <ExpanderText text={a.auditor_pub} /></p>
|
||||||
<p>Trusted: {rci.trustedAuditorPubs.indexOf(a.auditor_pub) >= 0 ? "yes" : "no"}</p>
|
<p>Trusted: {rci.trustedAuditorPubs.indexOf(a.auditor_pub) >= 0 ? "yes" : "no"}</p>
|
||||||
<p>Audits {a.denomination_keys.length} of {rci.numOfferedDenoms} denominations</p>
|
<p>Audits {a.denomination_keys.length} of {rci.numOfferedDenoms} denominations</p>
|
||||||
</div>
|
</div>
|
||||||
@ -206,10 +208,12 @@ function FeeDetailsView(props: {rci: ReserveCreationInfo|null}): JSX.Element {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h3>Overview</h3>
|
<h3>Overview</h3>
|
||||||
|
<p>Public key: <ExpanderText text={rci.exchangeInfo.masterPublicKey} /></p>
|
||||||
<p>{i18n.str`Withdrawal fees:`} {withdrawFee}</p>
|
<p>{i18n.str`Withdrawal fees:`} {withdrawFee}</p>
|
||||||
<p>{i18n.str`Rounding loss:`} {overhead}</p>
|
<p>{i18n.str`Rounding loss:`} {overhead}</p>
|
||||||
<p>{i18n.str`Earliest expiration (for deposit): ${moment.unix(rci.earliestDepositExpiration).fromNow()}`}</p>
|
<p>{i18n.str`Earliest expiration (for deposit): ${moment.unix(rci.earliestDepositExpiration).fromNow()}`}</p>
|
||||||
<h3>Coin Fees</h3>
|
<h3>Coin Fees</h3>
|
||||||
|
<div style={{overflow: "auto"}}>
|
||||||
<table className="pure-table">
|
<table className="pure-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -224,10 +228,13 @@ function FeeDetailsView(props: {rci: ReserveCreationInfo|null}): JSX.Element {
|
|||||||
{uniq.map(row)}
|
{uniq.map(row)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
<h3>Wire Fees</h3>
|
<h3>Wire Fees</h3>
|
||||||
<table className="pure-table">
|
<div style={{overflow: "auto"}}>
|
||||||
{Object.keys(rci.wireFees.feesForType).map(wireFee)}
|
<table className="pure-table">
|
||||||
</table>
|
{Object.keys(rci.wireFees.feesForType).map(wireFee)}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -246,3 +253,48 @@ export function WithdrawDetailView(props: {rci: ReserveCreationInfo | null}): JS
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface ExpanderTextProps {
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ExpanderText extends ImplicitStateComponent<ExpanderTextProps> {
|
||||||
|
private expanded = this.makeState<boolean>(false);
|
||||||
|
private textArea: any = undefined;
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
if (this.expanded() && this.textArea) {
|
||||||
|
this.textArea.focus();
|
||||||
|
this.textArea.scrollTop = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render(): JSX.Element {
|
||||||
|
if (!this.expanded()) {
|
||||||
|
return (
|
||||||
|
<span onClick={() => { this.expanded(true); }}>
|
||||||
|
{(this.props.text.length <= 10)
|
||||||
|
? this.props.text
|
||||||
|
: (
|
||||||
|
<span>
|
||||||
|
{this.props.text.substring(0, 10)}
|
||||||
|
<span style={{textDecoration: "underline"}}>...</span>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<textarea
|
||||||
|
readOnly
|
||||||
|
style={{display: "block"}}
|
||||||
|
onBlur={() => this.expanded(false)}
|
||||||
|
ref={(e) => this.textArea = e}>
|
||||||
|
{this.props.text}
|
||||||
|
</textarea>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user