aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-08-27 15:35:33 +0200
committerFlorian Dold <florian@dold.me>2024-08-27 15:35:41 +0200
commit9ab9b012f52c198a7dba69ce636b10f4311834f0 (patch)
tree99550684d7ff385033d2d446d23319550984811c /packages
parent3fdbe1441366b470f0ba7d4ba25227fb06d2de8e (diff)
-dce
Diffstat (limited to 'packages')
-rw-r--r--packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx11
-rw-r--r--packages/auditor-backoffice-ui/src/components/forms/FormProvider.tsx16
2 files changed, 1 insertions, 26 deletions
diff --git a/packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx b/packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx
index bbb956c5d..9e0bda499 100644
--- a/packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx
+++ b/packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx
@@ -19,7 +19,6 @@
* @author Sebastian Javier Marchano (sebasjm)
* @author Nic Eigel
*/
-import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { createHashHistory } from "history";
import { Fragment, VNode, h } from "preact";
import { Route, Router } from "preact-router";
@@ -27,10 +26,6 @@ import { useState } from "preact/hooks";
import { InstanceRoutes } from "./InstanceRoutes.js";
import { Loading } from "./components/exception/loading.js";
import { NotYetReadyAppMenu } from "./components/menu/index.js";
-import {
- useBackendContext,
- useBackendTokenContext,
-} from "./context/backend.js";
import { useBackendToken } from "./hooks/backend.js";
import { LoginPage } from "./paths/login/index.js";
import { Settings } from "./paths/settings/index.js";
@@ -40,12 +35,6 @@ import { Settings } from "./paths/settings/index.js";
* @returns
*/
export function ApplicationReadyRoutes(): VNode {
- const { i18n } = useTranslationContext();
- const [unauthorized, setUnauthorized] = useState(false);
- const [backendToken, setToken] = useState(false);
- const { url: backendURL } = useBackendContext();
- const { token } = useBackendTokenContext();
-
//TODO FIX bearer
const result = useBackendToken();
if (result.loading) return <Loading />;
diff --git a/packages/auditor-backoffice-ui/src/components/forms/FormProvider.tsx b/packages/auditor-backoffice-ui/src/components/forms/FormProvider.tsx
index a5f3c1d2f..4abe465c7 100644
--- a/packages/auditor-backoffice-ui/src/components/forms/FormProvider.tsx
+++ b/packages/auditor-backoffice-ui/src/components/forms/FormProvider.tsx
@@ -20,7 +20,7 @@
*/
import { ComponentChildren, createContext, h, VNode } from "preact";
-import { useContext, useMemo } from "preact/hooks";
+import { useMemo } from "preact/hooks";
type Updater<S> = (value: (prevState: S) => S) => void;
@@ -82,16 +82,6 @@ export interface FormType<T> {
const FormContext = createContext<FormType<unknown>>(null!);
-/**
- * FIXME:
- * USE MEMORY EVENTS INSTEAD OF CONTEXT
- * @deprecated
- */
-
-export function useFormContext<T>() {
- return useContext<FormType<T>>(FormContext);
-}
-
export type FormErrors<T> = {
[P in keyof T]?: string | FormErrors<T[P]>;
};
@@ -103,7 +93,3 @@ export type FormtoStr<T> = {
export type FormfromStr<T> = {
[P in keyof T]?: (f: string) => T[P];
};
-
-export type FormUpdater<T> = {
- [P in keyof T]?: (f: keyof T) => (v: T[P]) => void;
-};