diff options
author | Sebastian <sebasjm@gmail.com> | 2021-11-19 14:51:27 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-11-19 14:51:35 -0300 |
commit | a35604fd562a72e4e266bf6a4255d89d3c1374a1 (patch) | |
tree | d0c4df01a89dc78c412be6da3aba3cec343937ff /packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx | |
parent | 60cfb0e78f3afed92f315c1394da717329db9564 (diff) | |
download | wallet-core-a35604fd562a72e4e266bf6a4255d89d3c1374a1.tar.xz |
some changes:
- simplify design to reuse more components (from wallet instead of popup)
- simplify hooks (useAsyncAsHook)
- updateNotification from backend now filter events by type
- new balance design proposed by Belen
- more information when the withdrawal is in process
- manual withdrawal implementation
- some bugs killed
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx index 1af4e8d8d..88d5f1722 100644 --- a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx @@ -23,9 +23,9 @@ import { AmountJson, Amounts, } from "@gnu-taler/taler-util"; -import { ReserveCreated } from "./ReserveCreated.js"; +import { ReserveCreated } from "./ReserveCreated"; import { route } from "preact-router"; -import { Pages } from "../NavigationBar.js"; +import { Pages } from "../NavigationBar"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook"; export function ManualWithdrawPage(): VNode { @@ -39,7 +39,7 @@ export function ManualWithdrawPage(): VNode { >(undefined); const [error, setError] = useState<string | undefined>(undefined); - const knownExchangesHook = useAsyncAsHook(() => wxApi.listExchanges()); + const state = useAsyncAsHook(() => wxApi.listExchanges()); async function doCreate( exchangeBaseUrl: string, @@ -75,10 +75,13 @@ export function ManualWithdrawPage(): VNode { ); } - if (!knownExchangesHook || knownExchangesHook.hasError) { - return <div>No Known exchanges</div>; + if (!state) { + return <div>loading...</div>; } - const exchangeList = knownExchangesHook.response.exchanges.reduce( + if (state.hasError) { + return <div>There was an error getting the known exchanges</div>; + } + const exchangeList = state.response.exchanges.reduce( (p, c) => ({ ...p, [c.exchangeBaseUrl]: c.currency, |