From 9f8139e09b21ec12f9b9ba4926ea80557698c559 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 4 Jan 2022 17:06:17 -0300 Subject: replace jest with mocha --- .../src/popupEntryPoint.tsx | 163 +++++++++++---------- 1 file changed, 88 insertions(+), 75 deletions(-) (limited to 'packages/taler-wallet-webextension/src/popupEntryPoint.tsx') diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx index ac1872fb1..27372db5e 100644 --- a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx +++ b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx @@ -22,7 +22,7 @@ import { setupI18n } from "@gnu-taler/taler-util"; import { createHashHistory } from "history"; -import { render, h } from "preact"; +import { render, h, VNode, Fragment } from "preact"; import Router, { route, Route } from "preact-router"; import { useEffect } from "preact/hooks"; import { PopupBox } from "./components/styled"; @@ -39,6 +39,7 @@ import { ProviderDetailPage } from "./wallet/ProviderDetailPage"; import { SettingsPage } from "./popup/Settings"; import { TalerActionFound } from "./popup/TalerActionFound"; import { ExchangeAddPage } from "./wallet/ExchangeAddPage"; +import { IoCProviderForRuntime } from "./context/iocContext"; function main(): void { try { @@ -63,87 +64,99 @@ if (document.readyState === "loading") { main(); } -function Application() { - const [talerActionUrl, setDismissed] = useTalerActionURL(); +function CheckTalerActionComponent(): VNode { + const [talerActionUrl] = useTalerActionURL(); useEffect(() => { - if (talerActionUrl) route(Pages.cta); + if (talerActionUrl) + route(Pages.cta.replace(":action", encodeURIComponent(talerActionUrl))); }, [talerActionUrl]); + return ; +} + +function Application() { return (
- - - - - - - goToWalletPage(Pages.manual_withdraw) - } - goToWalletDeposit={(currency: string) => - goToWalletPage(Pages.deposit.replace(":currency", currency)) - } - /> - - ( - { - setDismissed(true); - route(Pages.balance); - }} - /> - )} - /> - - - goToWalletPage(Pages.transaction.replace(":tid", tid)) - } - /> - - - - { - route(Pages.provider_add); - }} - /> - { - route(Pages.backup); - }} - /> - { - route(Pages.backup); - }} - /> - - { - route(Pages.balance); - }} - /> - - - - + + + + + + + + + goToWalletPage(Pages.manual_withdraw) + } + goToWalletDeposit={(currency: string) => + goToWalletPage(Pages.deposit.replace(":currency", currency)) + } + /> + + { + setDismissed(true); + route(Pages.balance); + }} + /> + ); + }} + /> + + + goToWalletPage(Pages.transaction.replace(":tid", tid)) + } + /> + + + + { + route(Pages.provider_add); + }} + /> + { + route(Pages.backup); + }} + /> + { + route(Pages.backup); + }} + /> + + { + route(Pages.balance); + }} + /> + + + + +
); -- cgit v1.2.3