diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-23 08:30:43 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-23 08:30:43 -0300 |
commit | 73e36c99037cef1ccc43bb80b67b19e0f44326fd (patch) | |
tree | c076b0084a3fb5004b8f3ffa32cc09a9b1a42d22 /packages/demobank-ui/src/pages/admin/AdminHome.tsx | |
parent | 271488f041890391e1c6d946fd1aef00c2113fd0 (diff) | |
download | wallet-core-73e36c99037cef1ccc43bb80b67b19e0f44326fd.tar.xz |
return to form after 2fa cancelled
Diffstat (limited to 'packages/demobank-ui/src/pages/admin/AdminHome.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/admin/AdminHome.tsx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/demobank-ui/src/pages/admin/AdminHome.tsx b/packages/demobank-ui/src/pages/admin/AdminHome.tsx index 1803f1b9c..4695d35cf 100644 --- a/packages/demobank-ui/src/pages/admin/AdminHome.tsx +++ b/packages/demobank-ui/src/pages/admin/AdminHome.tsx @@ -50,9 +50,13 @@ import { AccountList } from "./AccountList.js"; * Query account information and show QR code if there is pending withdrawal */ interface Props { - routeCreate: RouteDefinition<Record<string, never>>; - routeDownloadStats: RouteDefinition<Record<string, never>>; - routeCreateWireTransfer: RouteDefinition<{ destination: string }>; + routeCreate: RouteDefinition; + routeDownloadStats: RouteDefinition; + routeCreateWireTransfer: RouteDefinition<{ + account?: string, + subject?: string, + amount?: string, + }>; routeShowAccount: RouteDefinition<{ account: string }>; routeRemoveAccount: RouteDefinition<{ account: string }>; @@ -73,7 +77,7 @@ export function AdminHome({ return ( <Fragment> <Metrics routeDownloadStats={routeDownloadStats} /> - <WireTransfer onAuthorizationRequired={onAuthorizationRequired} /> + <WireTransfer routeHere={routeCreateWireTransfer} onAuthorizationRequired={onAuthorizationRequired} /> <Transactions account="admin" @@ -149,7 +153,7 @@ export function getTimeframesForDate( function Metrics({ routeDownloadStats, }: { - routeDownloadStats: RouteDefinition<Record<string, never>>; + routeDownloadStats: RouteDefinition; }): VNode { const { i18n, dateLocale } = useTranslationContext(); const [metricType, setMetricType] = @@ -351,7 +355,7 @@ function Metrics({ </div> <dl class="mt-5 grid grid-cols-1 md:grid-cols-2 divide-y divide-gray-200 overflow-hidden rounded-lg bg-white shadow-lg md:divide-x md:divide-y-0"> {resp.current.body.type !== "with-conversions" || - resp.previous.body.type !== "with-conversions" ? undefined : ( + resp.previous.body.type !== "with-conversions" ? undefined : ( <Fragment> <div class="px-4 py-5 sm:p-6"> <dt class="text-base font-normal text-gray-900"> @@ -428,9 +432,9 @@ function MetricValue({ const rate = !currAmount || - Number.isNaN(currAmount) || - !prevAmount || - Number.isNaN(prevAmount) + Number.isNaN(currAmount) || + !prevAmount || + Number.isNaN(prevAmount) ? 0 : cmp === -1 ? 1 - Math.round(currAmount) / Math.round(prevAmount) |