From 770ab6f01dc81a16f384f314982bd761540f8e65 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 19 Dec 2022 12:11:50 -0300 Subject: build and test like other webapps --- packages/merchant-backoffice-ui/src/index.tsx | 94 ++------------------------- 1 file changed, 4 insertions(+), 90 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/index.tsx') diff --git a/packages/merchant-backoffice-ui/src/index.tsx b/packages/merchant-backoffice-ui/src/index.tsx index 3802a2149..c60471099 100644 --- a/packages/merchant-backoffice-ui/src/index.tsx +++ b/packages/merchant-backoffice-ui/src/index.tsx @@ -14,97 +14,11 @@ GNU Taler; see the file COPYING. If not, see */ -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ +import {Application} from "./Application.js"; -import { h, VNode } from 'preact'; -import { route } from 'preact-router'; -import { useMemo } from "preact/hooks"; -import { ApplicationReadyRoutes } from "./ApplicationReadyRoutes.js"; -import { Loading } from "./components/exception/loading.js"; -import { NotificationCard, NotYetReadyAppMenu } from "./components/menu/index.js"; -import { BackendContextProvider, useBackendContext } from './context/backend.js'; -import { ConfigContextProvider } from './context/config.js'; -import { TranslationProvider } from './context/translation.js'; -import { useBackendConfig } from "./hooks/backend.js"; -import { useTranslator } from './i18n/index.js'; -import LoginPage from './paths/login/index.js'; +import { h, render } from "preact"; import "./scss/main.scss"; -export default function Application(): VNode { - return ( - // - - - - - - // - ); -} +const app = document.getElementById("app"); -function ApplicationStatusRoutes(): VNode { - const { updateLoginStatus, triedToLog } = useBackendContext() - const result = useBackendConfig(); - const i18n = useTranslator() - - const updateLoginInfoAndGoToRoot = (url: string, token?: string) => { - updateLoginStatus(url, token) - route('/') - } - - const { currency, version } = result.ok ? result.data : { currency: 'unknown', version: 'unknown' } - const ctx = useMemo(() => ({ currency, version }), [currency, version]) - - if (!triedToLog) { - return
- - -
- } - - if (result.clientError && result.isUnauthorized) return
- - -
- - if (result.clientError && result.isNotfound) return
- - - -
- - if (result.serverError) return
- - - -
- - if (result.loading) return - - if (!result.ok) return
- - - -
- - return
- - - -
-} +render(, app as any); -- cgit v1.2.3