diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-20 16:04:51 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-20 16:05:59 -0300 |
commit | 52ec740c825d4e94fd59ef0a5cd8e8b73f4dfc06 (patch) | |
tree | dd65f9852005097c2cd8975b14ccbd198bef57e8 /packages/taler-wallet-webextension/src/cta/Withdraw/index.ts | |
parent | a5525eab1e96d5b08fbb6442275b1e92f7f8d806 (diff) | |
download | wallet-core-52ec740c825d4e94fd59ef0a5cd8e8b73f4dfc06.tar.xz |
new compose feature: sub-states
implemented in withdraw page, WIP
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/index.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/index.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts index 2d9aaf828..d38c27a2f 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts @@ -26,11 +26,16 @@ import { useComponentStateFromURI, } from "./state.js"; import { + State as SelectExchangeState +} from "../../hooks/useSelectedExchange.js"; + +import { LoadingExchangeView, LoadingInfoView, LoadingUriView, SuccessView, } from "./views.js"; +import { ExchangeSelectionPage } from "../../wallet/ExchangeSelection/index.js"; export interface PropsFromURI { talerWithdrawUri: string | undefined; @@ -49,6 +54,7 @@ export type State = | State.LoadingUriError | State.LoadingExchangeError | State.LoadingInfoError + | SelectExchangeState.Selecting | State.Success; export namespace State { @@ -57,12 +63,12 @@ export namespace State { error: undefined; } export interface LoadingUriError { - status: "loading-uri"; + status: "loading-error"; error: HookError; } export interface LoadingExchangeError { - status: "loading-exchange"; - error: HookError; + status: "no-exchange"; + error: undefined, } export interface LoadingInfoError { status: "loading-info"; @@ -80,6 +86,7 @@ export namespace State { toBeReceived: AmountJson; doWithdrawal: ButtonHandler; + doSelectExchange: ButtonHandler; tosProps?: TermsOfServiceSectionProps; mustAcceptFirst: boolean; @@ -92,9 +99,10 @@ export namespace State { const viewMapping: StateViewMap<State> = { loading: Loading, - "loading-uri": LoadingUriView, - "loading-exchange": LoadingExchangeView, + "loading-error": LoadingUriView, + "no-exchange": LoadingExchangeView, "loading-info": LoadingInfoView, + "selecting-exchange": ExchangeSelectionPage, success: SuccessView, }; |