summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx16
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
index b3e8a2c25..c7958eb8a 100644
--- a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import { VNode, h } from "preact";
+import { VNode, h, Fragment } from "preact";
import { useState } from "preact/hooks";
import { CreateManualWithdraw } from "./CreateManualWithdraw";
import * as wxApi from "../wxApi";
@@ -29,8 +29,10 @@ import { route } from "preact-router";
import { Pages } from "../NavigationBar";
import { useAsyncAsHook } from "../hooks/useAsyncAsHook";
import { ExchangeAddPage } from "./ExchangeAddPage";
+import { Loading } from "../components/Loading";
+import { ErrorBox } from "../components/styled";
-export function ManualWithdrawPage(): VNode {
+export function ManualWithdrawPage({ currency }: { currency?: string }): VNode {
const [success, setSuccess] = useState<
| {
response: AcceptManualWithdrawalResult;
@@ -86,10 +88,15 @@ export function ManualWithdrawPage(): VNode {
}
if (!state) {
- return <div>loading...</div>;
+ return <Loading />;
}
if (state.hasError) {
- return <div>There was an error getting the known exchanges</div>;
+ return (
+ <Fragment>
+ <ErrorBox>{state.message}</ErrorBox>
+ <p>There was an error getting the known exchanges</p>
+ </Fragment>
+ );
}
const exchangeList = state.response.exchanges.reduce(
(p, c) => ({
@@ -105,6 +112,7 @@ export function ManualWithdrawPage(): VNode {
error={error}
exchangeList={exchangeList}
onCreate={doCreate}
+ initialCurrency={currency}
/>
);
}