From ae49194d4271f1108ec9b8318ea3b7977314cb85 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Sep 2023 08:40:18 -0300 Subject: more ui --- packages/demobank-ui/src/components/ErrorLoading.tsx | 19 ++++++++++++++----- packages/demobank-ui/src/components/Routing.tsx | 4 +++- .../demobank-ui/src/components/Transactions/views.tsx | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'packages/demobank-ui/src/components') diff --git a/packages/demobank-ui/src/components/ErrorLoading.tsx b/packages/demobank-ui/src/components/ErrorLoading.tsx index fbc4ffceb..a4faa4d5d 100644 --- a/packages/demobank-ui/src/components/ErrorLoading.tsx +++ b/packages/demobank-ui/src/components/ErrorLoading.tsx @@ -15,15 +15,24 @@ GNU Taler; see the file COPYING. If not, see */ -import { useTranslationContext } from "@gnu-taler/web-util/browser"; +import { HttpError, useTranslationContext } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; -export function ErrorLoading(): VNode { +export function ErrorLoading({ error }: { error: HttpError }): VNode { const { i18n } = useTranslationContext() return ( -
- Could not complete the request - +
+
+
+ +
+
+

{error.message}

+
+
+
); } diff --git a/packages/demobank-ui/src/components/Routing.tsx b/packages/demobank-ui/src/components/Routing.tsx index d51bd01eb..2710069c2 100644 --- a/packages/demobank-ui/src/components/Routing.tsx +++ b/packages/demobank-ui/src/components/Routing.tsx @@ -23,7 +23,6 @@ import { BusinessAccount } from "../pages/business/Home.js"; import { HomePage, WithdrawalOperationPage } from "../pages/HomePage.js"; import { PublicHistoriesPage } from "../pages/PublicHistoriesPage.js"; import { RegistrationPage } from "../pages/RegistrationPage.js"; -import { Test } from "../pages/Test.js"; import { useBackendContext } from "../context/backend.js"; import { LoginForm } from "../pages/LoginForm.js"; import { AdminHome } from "../pages/admin/Home.js"; @@ -69,6 +68,9 @@ export function Routing(): VNode { onComplete={() => { route("/account"); }} + onCancel={() => { + route("/account"); + }} /> )} /> diff --git a/packages/demobank-ui/src/components/Transactions/views.tsx b/packages/demobank-ui/src/components/Transactions/views.tsx index b11888320..e34120e34 100644 --- a/packages/demobank-ui/src/components/Transactions/views.tsx +++ b/packages/demobank-ui/src/components/Transactions/views.tsx @@ -32,6 +32,7 @@ export function LoadingUriView({ error }: State.LoadingUriError): VNode { export function ReadyView({ transactions }: State.Ready): VNode { const { i18n } = useTranslationContext(); + if (!transactions.length) return
const txByDate = transactions.reduce((prev, cur) => { const d = cur.when.t_ms === "never" ? "" -- cgit v1.2.3