From 1d4815c66c395f4fcc86c30e20f3d005e3cb9ff5 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 15 Nov 2021 11:18:58 -0300 Subject: prettier --- .../src/popupEntryPoint.tsx | 77 ++++++++++++++-------- 1 file changed, 48 insertions(+), 29 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 070df554c..a5723ccb5 100644 --- a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx +++ b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx @@ -22,19 +22,17 @@ import { setupI18n } from "@gnu-taler/taler-util"; import { createHashHistory } from "history"; -import { render, h, VNode } from "preact"; -import Router, { route, Route, getCurrentUrl } from "preact-router"; -import { useEffect, useState } from "preact/hooks"; +import { render, h } from "preact"; +import Router, { route, Route } from "preact-router"; +import { useEffect } from "preact/hooks"; import { DevContextProvider } from "./context/devContext"; import { useTalerActionURL } from "./hooks/useTalerActionURL"; import { strings } from "./i18n/strings"; +import { Pages, WalletNavBar } from "./NavigationBar"; import { BackupPage } from "./popup/BackupPage"; import { BalancePage } from "./popup/BalancePage"; -import { DeveloperPage as DeveloperPage } from "./popup/Debug"; +import { DeveloperPage } from "./popup/Debug"; import { HistoryPage } from "./popup/History"; -import { - Pages, WalletNavBar -} from "./NavigationBar"; import { ProviderAddPage } from "./popup/ProviderAddPage"; import { ProviderDetailPage } from "./popup/ProviderDetailPage"; import { SettingsPage } from "./popup/Settings"; @@ -64,11 +62,11 @@ if (document.readyState === "loading") { } function Application() { - const [talerActionUrl, setDismissed] = useTalerActionURL() + const [talerActionUrl, setDismissed] = useTalerActionURL(); useEffect(() => { - if (talerActionUrl) route(Pages.cta) - },[talerActionUrl]) + if (talerActionUrl) route(Pages.cta); + }, [talerActionUrl]); return (
@@ -78,33 +76,54 @@ function Application() { - goToWalletPage(Pages.manual_withdraw)} + + goToWalletPage(Pages.manual_withdraw) + } /> - { - setDismissed(true) - route(Pages.balance) - }} />} /> + ( + { + setDismissed(true); + route(Pages.balance); + }} + /> + )} + /> - goToWalletPage(Pages.transaction.replace(':tid', tid))} + + goToWalletPage(Pages.transaction.replace(":tid", tid)) + } /> - { - route(Pages.provider_add) + route(Pages.provider_add); }} /> - { - route(Pages.backup) + route(Pages.backup); }} /> - { - route(Pages.backup) + route(Pages.backup); }} /> @@ -119,13 +138,13 @@ function goToWalletPage(page: Pages | string): null { chrome.tabs.create({ active: true, url: chrome.extension.getURL(`/static/wallet.html#${page}`), - }) - return null + }); + return null; } function Redirect({ to }: { to: string }): null { useEffect(() => { - route(to, true) - }) - return null + route(to, true); + }); + return null; } -- cgit v1.2.3