diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-20 20:26:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-20 20:26:47 -0300 |
commit | 859991a40c4a7757d874f9ae6e6db7b76145a3c3 (patch) | |
tree | 2d029521929fa63f731e0b62bd3342f6f70ad2f8 /packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts | |
parent | 7adaeff0a57bc2d0633dd6a2c750a91facc03c4d (diff) | |
download | wallet-core-859991a40c4a7757d874f9ae6e6db7b76145a3c3.tar.xz |
exchange selection for invoices and some fixes
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts index 2bee51669..61f286d1f 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts @@ -14,14 +14,19 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ +import { AmountJson, TalerErrorDetail } from "@gnu-taler/taler-util"; import { Loading } from "../../components/Loading.js"; import { HookError } from "../../hooks/useAsyncAsHook.js"; +import { + State as SelectExchangeState +} from "../../hooks/useSelectedExchange.js"; +import { ButtonHandler, TextFieldHandler } from "../../mui/handlers.js"; import { compose, StateViewMap } from "../../utils/index.js"; -import { LoadingUriView, ReadyView } from "./views.js"; +import { ExchangeSelectionPage } from "../../wallet/ExchangeSelection/index.js"; +import { NoExchangesView } from "../../wallet/ExchangeSelection/views.js"; import * as wxApi from "../../wxApi.js"; import { useComponentState } from "./state.js"; -import { AmountJson, TalerErrorDetail } from "@gnu-taler/taler-util"; -import { ButtonHandler, TextFieldHandler } from "../../mui/handlers.js"; +import { LoadingUriView, ReadyView } from "./views.js"; export interface Props { amount: string; @@ -29,7 +34,12 @@ export interface Props { onSuccess: (tx: string) => Promise<void>; } -export type State = State.Loading | State.LoadingUriError | State.Ready; +export type State = State.Loading + | State.LoadingUriError + | State.Ready + | SelectExchangeState.Selecting + | SelectExchangeState.NoExchange + ; export namespace State { export interface Loading { @@ -63,6 +73,8 @@ export namespace State { const viewMapping: StateViewMap<State> = { loading: Loading, "loading-uri": LoadingUriView, + "no-exchange": NoExchangesView, + "selecting-exchange": ExchangeSelectionPage, ready: ReadyView, }; |