aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-03-05 10:02:32 -0300
committerSebastian <sebasjm@gmail.com>2024-03-05 10:02:32 -0300
commita6b6c6abf3f2c5cc9b20a6204078416ea5fba510 (patch)
tree28eddeffc37c70b1746ba0b3208e6019e6ed5c69 /packages/demobank-ui/src
parent63aedafd841f3a3d7d3b7974d4e5b8fbd02afd3d (diff)
fix #8573
Diffstat (limited to 'packages/demobank-ui/src')
-rw-r--r--packages/demobank-ui/src/components/Cashouts/views.tsx19
-rw-r--r--packages/demobank-ui/src/components/Transactions/views.tsx32
-rw-r--r--packages/demobank-ui/src/context/config.ts1
-rw-r--r--packages/demobank-ui/src/pages/BankFrame.tsx6
-rw-r--r--packages/demobank-ui/src/pages/LoginForm.tsx9
5 files changed, 35 insertions, 32 deletions
diff --git a/packages/demobank-ui/src/components/Cashouts/views.tsx b/packages/demobank-ui/src/components/Cashouts/views.tsx
index db1fdbfc5..90ee6bc2f 100644
--- a/packages/demobank-ui/src/components/Cashouts/views.tsx
+++ b/packages/demobank-ui/src/components/Cashouts/views.tsx
@@ -148,16 +148,15 @@ export function ReadyView({
locale: dateLocale,
});
return (
- <tr
+ <a
+ name="cashout details"
key={idx}
- class="border-b border-gray-200 hover:bg-gray-200 last:border-none"
+ class="table-row border-b border-gray-200 hover:bg-gray-200 last:border-none"
+ // class="table-row"
+ href={routeCashoutDetails.url({
+ cid: String(item.id),
+ })}
>
- <a
- name="cashout details"
- href={routeCashoutDetails.url({
- cid: String(item.id),
- })}
- >
<td class="relative py-2 pl-2 pr-2 text-sm ">
<div class="font-medium text-gray-900">
{creationTime}
@@ -201,10 +200,10 @@ export function ReadyView({
</td>
<td class="hidden sm:table-cell px-3 py-3.5 text-sm text-gray-500 break-all min-w-md">
+
{item.subject}
</td>
- </a>
- </tr>
+ </a>
);
})}
</Fragment>
diff --git a/packages/demobank-ui/src/components/Transactions/views.tsx b/packages/demobank-ui/src/components/Transactions/views.tsx
index ba400b37a..cdf134b2f 100644
--- a/packages/demobank-ui/src/components/Transactions/views.tsx
+++ b/packages/demobank-ui/src/components/Transactions/views.tsx
@@ -16,11 +16,10 @@
import { Attention, useTranslationContext } from "@gnu-taler/web-util/browser";
import { format } from "date-fns";
-import { Fragment, h, VNode } from "preact";
+import { Fragment, VNode, h } from "preact";
import { useBankCoreApiContext } from "../../context/config.js";
import { RenderAmount } from "../../pages/PaytoWireTransferForm.js";
import { State } from "./index.js";
-import { useAccountDetails } from "../../hooks/access.js";
export function ReadyView({
transactions,
@@ -31,21 +30,24 @@ export function ReadyView({
const { i18n, dateLocale } = useTranslationContext();
const { config } = useBankCoreApiContext()
- if (!transactions.length) return <div class="px-4 mt-4">
- <div class="sm:flex sm:items-center">
- <div class="sm:flex-auto">
- <h1 class="text-base font-semibold leading-6 text-gray-900">
- <i18n.Translate>Transactions history</i18n.Translate>
- </h1>
+ if (!transactions.length) {
+ return <div class="px-4 mt-4">
+ <div class="sm:flex sm:items-center">
+ <div class="sm:flex-auto">
+ <h1 class="text-base font-semibold leading-6 text-gray-900">
+ <i18n.Translate>Transactions history</i18n.Translate>
+ </h1>
+ </div>
</div>
- </div>
- <Attention type="info" title={i18n.str`No moves in your account yet.`}>
- <i18n.Translate>
- You can start sending a wire transfer or withdrawing to your wallet.
- </i18n.Translate>
- </Attention>
- </div>;
+ <Attention type="low" title={i18n.str`No transactions yet.`}>
+ <i18n.Translate>
+ You can start sending a wire transfer or withdrawing to your wallet.
+ </i18n.Translate>
+ </Attention>
+ </div>;
+ }
+
const txByDate = transactions.reduce(
(prev, cur) => {
const d =
diff --git a/packages/demobank-ui/src/context/config.ts b/packages/demobank-ui/src/context/config.ts
index 529108275..e968b7ff4 100644
--- a/packages/demobank-ui/src/context/config.ts
+++ b/packages/demobank-ui/src/context/config.ts
@@ -239,6 +239,7 @@ class CacheAwareTalerCoreBankHttpClient extends TalerCoreBankHttpClient {
if (resp.type === "ok") {
await revalidateAccountDetails();
await revalidateCashouts();
+ await revalidateTransactions();
}
return resp;
}
diff --git a/packages/demobank-ui/src/pages/BankFrame.tsx b/packages/demobank-ui/src/pages/BankFrame.tsx
index b914aa360..b6bfe1cfb 100644
--- a/packages/demobank-ui/src/pages/BankFrame.tsx
+++ b/packages/demobank-ui/src/pages/BankFrame.tsx
@@ -144,7 +144,11 @@ export function BankFrame({
</Header>
</div>
- <GlobalNotificationsBanner />
+ <div class="fixed z-20 w-full">
+ <div class="mx-auto w-4/5">
+ <GlobalNotificationsBanner />
+ </div>
+ </div>
<main class="-mt-32 flex-1">
{account && routeAccountDetails && (
diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx
index 09c0a8785..f0ca447e1 100644
--- a/packages/demobank-ui/src/pages/LoginForm.tsx
+++ b/packages/demobank-ui/src/pages/LoginForm.tsx
@@ -15,25 +15,22 @@
*/
import {
- HttpStatusCode,
- TranslatedString,
- assertUnreachable,
+ HttpStatusCode
} from "@gnu-taler/taler-util";
import {
Button,
LocalNotificationBanner,
ShowInputErrorLabel,
- useLocalNotification,
useLocalNotificationHandler,
- useTranslationContext,
+ useTranslationContext
} from "@gnu-taler/web-util/browser";
import { VNode, h } from "preact";
import { useEffect, useRef, useState } from "preact/hooks";
import { useBankCoreApiContext } from "../context/config.js";
import { useBackendState } from "../hooks/backend.js";
+import { RouteDefinition } from "../route.js";
import { undefinedIfEmpty } from "../utils.js";
import { doAutoFocus } from "./PaytoWireTransferForm.js";
-import { EmptyObject, RouteDefinition } from "../route.js";
/**
* Collect and submit login data.