From d44740b787c974c5388811a2989557d93923c49a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 27 Mar 2021 14:35:58 +0100 Subject: fix build issues --- .../taler-wallet-webextension/src/renderHtml.tsx | 167 +-------------------- 1 file changed, 6 insertions(+), 161 deletions(-) (limited to 'packages/taler-wallet-webextension/src/renderHtml.tsx') diff --git a/packages/taler-wallet-webextension/src/renderHtml.tsx b/packages/taler-wallet-webextension/src/renderHtml.tsx index c18c5c199..3e66e5c5d 100644 --- a/packages/taler-wallet-webextension/src/renderHtml.tsx +++ b/packages/taler-wallet-webextension/src/renderHtml.tsx @@ -23,9 +23,12 @@ /** * Imports. */ -import { AmountJson, Amounts, stringifyTimestamp, ExchangeWithdrawDetails } from "@gnu-taler/taler-wallet-core"; -import * as i18n from "./i18n"; import React from "react"; +import { + AmountJson, + Amounts, + amountFractionalBase, +} from "@gnu-taler/taler-util"; /** * Render amount as HTML, which non-breaking space between @@ -41,7 +44,7 @@ export function renderAmount(amount: AmountJson | string): JSX.Element { if (!a) { return (invalid amount); } - const x = a.value + a.fraction / Amounts.fractionalBase; + const x = a.value + a.fraction / amountFractionalBase; return ( {x} {a.currency} @@ -125,164 +128,6 @@ export class Collapsible extends React.Component< } } -function WireFee(props: { - s: string; - rci: ExchangeWithdrawDetails; -}): JSX.Element { - return ( - <> - - - Wire Method {props.s} - - - Applies Until - Wire Fee - Closing Fee - - - - {props.rci.wireFees.feesForType[props.s].map((f) => ( - - {stringifyTimestamp(f.endStamp)} - {renderAmount(f.wireFee)} - {renderAmount(f.closingFee)} - - ))} - - - ); -} - -function AuditorDetailsView(props: { - rci: ExchangeWithdrawDetails | null; -}): JSX.Element { - const rci = props.rci; - console.log("rci", rci); - if (!rci) { - return ( -

- Details will be displayed when a valid exchange provider URL is entered. -

- ); - } - if ((rci.exchangeInfo.details?.auditors ?? []).length === 0) { - return

The exchange is not audited by any auditors.

; - } - return ( -
- {(rci.exchangeInfo.details?.auditors ?? []).map((a) => ( -
-

Auditor {a.auditor_url}

-

- Public key: -

-

- Trusted:{" "} - {rci.trustedAuditorPubs.indexOf(a.auditor_pub) >= 0 ? "yes" : "no"} -

-

- Audits {a.denomination_keys.length} of {rci.numOfferedDenoms}{" "} - denominations -

-
- ))} -
- ); -} - -function FeeDetailsView(props: { - rci: ExchangeWithdrawDetails | null; -}): JSX.Element { - const rci = props.rci; - if (!rci) { - return ( -

- Details will be displayed when a valid exchange provider URL is entered. -

- ); - } - - const denoms = rci.selectedDenoms; - const withdrawFee = renderAmount(rci.withdrawFee); - const overhead = renderAmount(rci.overhead); - - return ( -
-

Overview

-

- Public key:{" "} - -

-

- {i18n.str`Withdrawal fees:`} {withdrawFee} -

-

- {i18n.str`Rounding loss:`} {overhead} -

-

{i18n.str`Earliest expiration (for deposit): ${stringifyTimestamp( - rci.earliestDepositExpiration, - )}`}

-

Coin Fees

-
- - - - - - - - - - - - {denoms.selectedDenoms.map((ds) => { - return ( - - - - - - - - ); - })} - -
{i18n.str`# Coins`}{i18n.str`Value`}{i18n.str`Withdraw Fee`}{i18n.str`Refresh Fee`}{i18n.str`Deposit Fee`}
{ds.count + "x"}{renderAmount(ds.denom.value)}{renderAmount(ds.denom.feeWithdraw)}{renderAmount(ds.denom.feeRefresh)}{renderAmount(ds.denom.feeDeposit)}
-
-

Wire Fees

-
- - {Object.keys(rci.wireFees.feesForType).map((s) => ( - - ))} -
-
-
- ); -} - -/** - * Shows details about a withdraw request. - */ -export function WithdrawDetailView(props: { - rci: ExchangeWithdrawDetails | null; -}): JSX.Element { - const rci = props.rci; - return ( -
- - - - - - -
- ); -} - interface ExpanderTextProps { text: string; } -- cgit v1.2.3