diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-09 11:58:39 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-09 11:58:39 -0300 |
commit | f2b319921c53010446e05ac4f24eef9995f65836 (patch) | |
tree | 43d0293b872673855534dbff7158dd94cb67cc3a /packages/demobank-ui/src/pages | |
parent | d14eedd2843f1dcbe3fea25214dbda2299378ece (diff) | |
download | wallet-core-f2b319921c53010446e05ac4f24eef9995f65836.tar.xz |
use translation from commons
Diffstat (limited to 'packages/demobank-ui/src/pages')
12 files changed, 17 insertions, 20 deletions
diff --git a/packages/demobank-ui/src/pages/home/AccountPage.tsx b/packages/demobank-ui/src/pages/home/AccountPage.tsx index f2745e45c..da22568f9 100644 --- a/packages/demobank-ui/src/pages/home/AccountPage.tsx +++ b/packages/demobank-ui/src/pages/home/AccountPage.tsx @@ -15,12 +15,12 @@ */ import { Amounts, HttpStatusCode, Logger } from "@gnu-taler/taler-util"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { ComponentChildren, Fragment, h, VNode } from "preact"; import { useEffect } from "preact/hooks"; import useSWR, { SWRConfig, useSWRConfig } from "swr"; import { useBackendContext } from "../../context/backend.js"; import { PageStateType, usePageContext } from "../../context/pageState.js"; -import { useTranslationContext } from "../../context/translation.js"; import { BackendInfo } from "../../hooks/backend.js"; import { bankUiSettings } from "../../settings.js"; import { getIbanFromPayto, prepareHeaders } from "../../utils.js"; @@ -253,7 +253,7 @@ function Account({ accountLabel }: { accountLabel: string }): VNode { } // function useTransactionPageNumber(): [number, StateUpdater<number>] { -// const ret = hooks.useNotNullLocalStorage("transaction-page", "0"); +// const ret = useNotNullLocalStorage("transaction-page", "0"); // const retObj = JSON.parse(ret[0]); // const retSetter: StateUpdater<number> = function (val) { // const newVal = diff --git a/packages/demobank-ui/src/pages/home/BankFrame.tsx b/packages/demobank-ui/src/pages/home/BankFrame.tsx index 2a0c797f2..cb629effb 100644 --- a/packages/demobank-ui/src/pages/home/BankFrame.tsx +++ b/packages/demobank-ui/src/pages/home/BankFrame.tsx @@ -20,7 +20,7 @@ import talerLogo from "../../assets/logo-white.svg"; import { LangSelectorLikePy as LangSelector } from "../../components/menu/LangSelector.js"; import { useBackendContext } from "../../context/backend.js"; import { PageStateType, usePageContext } from "../../context/pageState.js"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { bankUiSettings } from "../../settings.js"; const logger = new Logger("BankFrame"); diff --git a/packages/demobank-ui/src/pages/home/LoginForm.tsx b/packages/demobank-ui/src/pages/home/LoginForm.tsx index f31f91190..4f38bc91d 100644 --- a/packages/demobank-ui/src/pages/home/LoginForm.tsx +++ b/packages/demobank-ui/src/pages/home/LoginForm.tsx @@ -18,7 +18,7 @@ import { h, VNode } from "preact"; import { route } from "preact-router"; import { useEffect, useRef, useState } from "preact/hooks"; import { useBackendContext } from "../../context/backend.js"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { BackendStateHandler } from "../../hooks/backend.js"; import { bankUiSettings } from "../../settings.js"; import { getBankBackendBaseUrl, undefinedIfEmpty } from "../../utils.js"; diff --git a/packages/demobank-ui/src/pages/home/PaymentOptions.tsx b/packages/demobank-ui/src/pages/home/PaymentOptions.tsx index e442ac2a3..ae876d556 100644 --- a/packages/demobank-ui/src/pages/home/PaymentOptions.tsx +++ b/packages/demobank-ui/src/pages/home/PaymentOptions.tsx @@ -16,7 +16,7 @@ import { h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { PaytoWireTransferForm } from "./PaytoWireTransferForm.js"; import { WalletWithdrawForm } from "./WalletWithdrawForm.js"; diff --git a/packages/demobank-ui/src/pages/home/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/home/PaytoWireTransferForm.tsx index fb2ae3196..36182cd93 100644 --- a/packages/demobank-ui/src/pages/home/PaytoWireTransferForm.tsx +++ b/packages/demobank-ui/src/pages/home/PaytoWireTransferForm.tsx @@ -15,7 +15,7 @@ */ import { Amounts, Logger, parsePaytoUri } from "@gnu-taler/taler-util"; -import { hooks } from "@gnu-taler/web-util/lib/index.browser"; +import { useLocalStorage } from "@gnu-taler/web-util/lib/index.browser"; import { h, VNode } from "preact"; import { StateUpdater, useEffect, useRef, useState } from "preact/hooks"; import { useBackendContext } from "../../context/backend.js"; @@ -23,7 +23,7 @@ import { PageStateType, usePageContext } from "../../context/pageState.js"; import { InternationalizationAPI, useTranslationContext, -} from "../../context/translation.js"; +} from "@gnu-taler/web-util/lib/index.browser"; import { BackendState } from "../../hooks/backend.js"; import { prepareHeaders, undefinedIfEmpty } from "../../utils.js"; import { ShowInputErrorLabel } from "./ShowInputErrorLabel.js"; @@ -330,7 +330,7 @@ type WireTransferRequestTypeOpt = WireTransferRequestType | undefined; function useWireTransferRequestType( state?: WireTransferRequestType, ): [WireTransferRequestTypeOpt, StateUpdater<WireTransferRequestTypeOpt>] { - const ret = hooks.useLocalStorage( + const ret = useLocalStorage( "wire-transfer-request-state", JSON.stringify(state), ); diff --git a/packages/demobank-ui/src/pages/home/PublicHistoriesPage.tsx b/packages/demobank-ui/src/pages/home/PublicHistoriesPage.tsx index a0fb8493b..1577e0dfc 100644 --- a/packages/demobank-ui/src/pages/home/PublicHistoriesPage.tsx +++ b/packages/demobank-ui/src/pages/home/PublicHistoriesPage.tsx @@ -15,13 +15,13 @@ */ import { Logger } from "@gnu-taler/taler-util"; -import { hooks } from "@gnu-taler/web-util/lib/index.browser"; +import { useLocalStorage } from "@gnu-taler/web-util/lib/index.browser"; import { ComponentChildren, Fragment, h, VNode } from "preact"; import { route } from "preact-router"; import { StateUpdater } from "preact/hooks"; import useSWR, { SWRConfig } from "swr"; import { PageStateType, usePageContext } from "../../context/pageState.js"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { getBankBackendBaseUrl } from "../../utils.js"; import { BankFrame } from "./BankFrame.js"; import { Transactions } from "./Transactions.js"; @@ -169,10 +169,7 @@ function PublicHistories(): VNode { function useShowPublicAccount( state?: string, ): [string | undefined, StateUpdater<string | undefined>] { - const ret = hooks.useLocalStorage( - "show-public-account", - JSON.stringify(state), - ); + const ret = useLocalStorage("show-public-account", JSON.stringify(state)); const retObj: string | undefined = ret[0] ? JSON.parse(ret[0]) : ret[0]; const retSetter: StateUpdater<string | undefined> = function (val) { const newVal = diff --git a/packages/demobank-ui/src/pages/home/QrCodeSection.tsx b/packages/demobank-ui/src/pages/home/QrCodeSection.tsx index 4199ead86..531df75bc 100644 --- a/packages/demobank-ui/src/pages/home/QrCodeSection.tsx +++ b/packages/demobank-ui/src/pages/home/QrCodeSection.tsx @@ -17,7 +17,7 @@ import { h, VNode } from "preact"; import { useEffect } from "preact/hooks"; import { QR } from "../../components/QR.js"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; export function QrCodeSection({ talerWithdrawUri, diff --git a/packages/demobank-ui/src/pages/home/RegistrationPage.tsx b/packages/demobank-ui/src/pages/home/RegistrationPage.tsx index fb7e975fb..c21693885 100644 --- a/packages/demobank-ui/src/pages/home/RegistrationPage.tsx +++ b/packages/demobank-ui/src/pages/home/RegistrationPage.tsx @@ -22,7 +22,7 @@ import { PageStateType, usePageContext } from "../../context/pageState.js"; import { InternationalizationAPI, useTranslationContext, -} from "../../context/translation.js"; +} from "@gnu-taler/web-util/lib/index.browser"; import { BackendStateHandler } from "../../hooks/backend.js"; import { bankUiSettings } from "../../settings.js"; import { getBankBackendBaseUrl, undefinedIfEmpty } from "../../utils.js"; diff --git a/packages/demobank-ui/src/pages/home/Transactions.tsx b/packages/demobank-ui/src/pages/home/Transactions.tsx index a00046648..ca88abd4d 100644 --- a/packages/demobank-ui/src/pages/home/Transactions.tsx +++ b/packages/demobank-ui/src/pages/home/Transactions.tsx @@ -18,7 +18,7 @@ import { Logger } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; import { useEffect } from "preact/hooks"; import useSWR from "swr"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; const logger = new Logger("Transactions"); /** diff --git a/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx b/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx index 5304b6273..440d16c6c 100644 --- a/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx +++ b/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx @@ -22,7 +22,7 @@ import { PageStateType, usePageContext } from "../../context/pageState.js"; import { InternationalizationAPI, useTranslationContext, -} from "../../context/translation.js"; +} from "@gnu-taler/web-util/lib/index.browser"; import { BackendState } from "../../hooks/backend.js"; import { prepareHeaders, validateAmount } from "../../utils.js"; diff --git a/packages/demobank-ui/src/pages/home/WithdrawalConfirmationQuestion.tsx b/packages/demobank-ui/src/pages/home/WithdrawalConfirmationQuestion.tsx index 0d52bbbf0..693f85bcd 100644 --- a/packages/demobank-ui/src/pages/home/WithdrawalConfirmationQuestion.tsx +++ b/packages/demobank-ui/src/pages/home/WithdrawalConfirmationQuestion.tsx @@ -22,7 +22,7 @@ import { PageStateType, usePageContext } from "../../context/pageState.js"; import { InternationalizationAPI, useTranslationContext, -} from "../../context/translation.js"; +} from "@gnu-taler/web-util/lib/index.browser"; import { BackendState } from "../../hooks/backend.js"; import { prepareHeaders } from "../../utils.js"; diff --git a/packages/demobank-ui/src/pages/home/WithdrawalQRCode.tsx b/packages/demobank-ui/src/pages/home/WithdrawalQRCode.tsx index f7b059816..978d3a840 100644 --- a/packages/demobank-ui/src/pages/home/WithdrawalQRCode.tsx +++ b/packages/demobank-ui/src/pages/home/WithdrawalQRCode.tsx @@ -18,7 +18,7 @@ import { Logger } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import useSWR from "swr"; import { PageStateType, usePageContext } from "../../context/pageState.js"; -import { useTranslationContext } from "../../context/translation.js"; +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { QrCodeSection } from "./QrCodeSection.js"; import { WithdrawalConfirmationQuestion } from "./WithdrawalConfirmationQuestion.js"; |