From a01ad4758f8d8f7605e9efd5694d6e203e2d2b6b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 19 Jan 2022 00:20:51 -0300 Subject: header rendering --- .../taler-wallet-webextension/src/walletEntryPoint.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-webextension/src/walletEntryPoint.tsx') diff --git a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx index b54d49ded..978d6fde5 100644 --- a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx +++ b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx @@ -24,6 +24,7 @@ import { setupI18n } from "@gnu-taler/taler-util"; import { createHashHistory } from "history"; import { h, render, VNode } from "preact"; import Router, { route, Route } from "preact-router"; +import Match from "preact-router/match"; import { useEffect, useState } from "preact/hooks"; import { LogoHeader } from "./components/LogoHeader"; import { SuccessBox, WalletBox } from "./components/styled"; @@ -34,7 +35,7 @@ import { RefundPage } from "./cta/Refund"; import { TipPage } from "./cta/Tip"; import { WithdrawPage } from "./cta/Withdraw"; import { strings } from "./i18n/strings"; -import { Pages, WalletNavBar } from "./NavigationBar"; +import { NavBar, Pages } from "./NavigationBar"; import { DeveloperPage } from "./popup/DeveloperPage"; import { BackupPage } from "./wallet/BackupPage"; import { BalancePage } from "./wallet/BalancePage"; @@ -76,20 +77,28 @@ function Application(): VNode { const [globalNotification, setGlobalNotification] = useState< string | undefined >(undefined); + const hash_history = createHashHistory(); return (
{({ devMode }: { devMode: boolean }) => ( - + {/* won't work in the first render if is not called first */} + {/* https://github.com/preactjs/preact-router/issues/415 */} + + + {({ path }: { path: string }) => ( + + )} + {globalNotification && ( setGlobalNotification(undefined)}>
{globalNotification}
)} - +