diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-15 17:11:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-15 17:11:24 -0300 |
commit | f93bd51499ed34844b666bf6d333227adf4368bf (patch) | |
tree | ed3cf0c38b7db54276436d1743a6085c94f71977 /packages/taler-wallet-webextension/src/NavigationBar.tsx | |
parent | 8d8d71807df6b775e5b0335eb1b2526a56d42ac6 (diff) | |
download | wallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.tar.xz |
wxApi from context and using the new testing sdk
Diffstat (limited to 'packages/taler-wallet-webextension/src/NavigationBar.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/NavigationBar.tsx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx b/packages/taler-wallet-webextension/src/NavigationBar.tsx index 8fb289aa6..ab36af376 100644 --- a/packages/taler-wallet-webextension/src/NavigationBar.tsx +++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx @@ -24,20 +24,20 @@ /** * Imports. */ +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { Fragment, h, VNode } from "preact"; +import { JustInDevMode } from "./components/JustInDevMode.js"; import { NavigationHeader, NavigationHeaderHolder, SvgIcon, } from "./components/styled/index.js"; +import { useBackendContext } from "./context/backend.js"; import { useTranslationContext } from "./context/translation.js"; -import settingsIcon from "./svg/settings_black_24dp.svg"; +import { useAsyncAsHook } from "./hooks/useAsyncAsHook.js"; import qrIcon from "./svg/qr_code_24px.svg"; +import settingsIcon from "./svg/settings_black_24dp.svg"; import warningIcon from "./svg/warning_24px.svg"; -import { useAsyncAsHook } from "./hooks/useAsyncAsHook.js"; -import { wxApi } from "./wxApi.js"; -import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { JustInDevMode } from "./components/JustInDevMode.js"; /** * List of pages used by the wallet @@ -133,13 +133,8 @@ export const Pages = { ), }; -export function PopupNavBar({ - path = "", -}: { - path?: string; -}): // api: typeof wxApi, -VNode { - const api = wxApi; //FIXME: as parameter +export function PopupNavBar({ path = "" }: { path?: string }): VNode { + const api = useBackendContext(); const hook = useAsyncAsHook(async () => { return await api.wallet.call( WalletApiOperation.GetUserAttentionUnreadCount, @@ -194,7 +189,7 @@ VNode { export function WalletNavBar({ path = "" }: { path?: string }): VNode { const { i18n } = useTranslationContext(); - const api = wxApi; //FIXME: as parameter + const api = useBackendContext(); const hook = useAsyncAsHook(async () => { return await api.wallet.call( WalletApiOperation.GetUserAttentionUnreadCount, |