diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/History.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/History.tsx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index dcc3c43e3..41b03424c 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -18,6 +18,7 @@ import { AbsoluteTime, Amounts, NotificationType, + ScopeType, Transaction, WalletBalance, } from "@gnu-taler/taler-util"; @@ -132,11 +133,10 @@ export function HistoryView({ (transactionByCurrency[av.currency] && transactionByCurrency[av.currency].length > 0) ); - }) - .map((b) => b.available.split(":")[0]); + }); const defaultCurrencyIndex = currencies.findIndex( - (c) => c === defaultCurrency, + (c) => c.scopeInfo.currency === defaultCurrency, ); const [currencyIndex, setCurrencyIndex] = useState( defaultCurrencyIndex === -1 ? 0 : defaultCurrencyIndex, @@ -151,7 +151,7 @@ export function HistoryView({ const ts = selectedCurrency === undefined ? [] - : transactionByCurrency[selectedCurrency] ?? []; + : transactionByCurrency[selectedCurrency.scopeInfo.currency] ?? []; const datesWithTransaction: string[] = []; const byDate = ts.reduce((rv, x) => { @@ -199,7 +199,7 @@ export function HistoryView({ {selectedCurrency} </CenteredText> ) : ( - <NiceSelect> + <NiceSelect style={{ flexDirection: "column" }}> <select style={{ fontSize: "x-large", @@ -209,14 +209,17 @@ export function HistoryView({ setCurrencyIndex(Number(e.currentTarget.value)); }} > - {currencies.map((currency, index) => { + {currencies.map((entry, index) => { return ( - <option value={index} key={currency}> - {currency} + <option value={index} key={entry.scopeInfo.currency}> + {entry.scopeInfo.currency} </option> ); })} </select> + <div style={{ fontSize: "small", color: "grey" }}> + {selectedCurrency.scopeInfo.type === ScopeType.Exchange || selectedCurrency.scopeInfo.type === ScopeType.Auditor ? selectedCurrency.scopeInfo.url : undefined} + </div> </NiceSelect> )} {currencyAmount && ( @@ -236,7 +239,7 @@ export function HistoryView({ tooltip="Transfer money to the wallet" startIcon={DownloadIcon} variant="contained" - onClick={() => goToWalletManualWithdraw(selectedCurrency)} + onClick={() => goToWalletManualWithdraw(selectedCurrency.scopeInfo.currency)} > <i18n.Translate>Add</i18n.Translate> </Button> @@ -246,7 +249,7 @@ export function HistoryView({ startIcon={UploadIcon} variant="outlined" color="primary" - onClick={() => goToWalletDeposit(selectedCurrency)} + onClick={() => goToWalletDeposit(selectedCurrency.scopeInfo.currency)} > <i18n.Translate>Send</i18n.Translate> </Button> |