diff options
author | Florian Dold <florian@dold.me> | 2024-02-21 12:38:29 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-02-21 12:38:29 +0100 |
commit | 06635c195816121ed7d90cf7bd3834850b674564 (patch) | |
tree | 8a59626aae6b896ee065709004a1fd14085414ac | |
parent | 6c2d6e9ad96b0eeb3f88b4b54bb75f87ba244e87 (diff) | |
download | wallet-core-06635c195816121ed7d90cf7bd3834850b674564.tar.xz |
english
-rw-r--r-- | packages/demobank-ui/src/pages/admin/AdminHome.tsx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/packages/demobank-ui/src/pages/admin/AdminHome.tsx b/packages/demobank-ui/src/pages/admin/AdminHome.tsx index 2df8ac112..1803f1b9c 100644 --- a/packages/demobank-ui/src/pages/admin/AdminHome.tsx +++ b/packages/demobank-ui/src/pages/admin/AdminHome.tsx @@ -75,7 +75,10 @@ export function AdminHome({ <Metrics routeDownloadStats={routeDownloadStats} /> <WireTransfer onAuthorizationRequired={onAuthorizationRequired} /> - <Transactions account="admin" routeCreateWireTransfer={routeCreateWireTransfer} /> + <Transactions + account="admin" + routeCreateWireTransfer={routeCreateWireTransfer} + /> <AccountList routeCreate={routeCreate} routeRemoveAccount={routeRemoveAccount} @@ -143,7 +146,9 @@ export function getTimeframesForDate( } } -function Metrics({ routeDownloadStats }: { +function Metrics({ + routeDownloadStats, +}: { routeDownloadStats: RouteDefinition<Record<string, never>>; }): VNode { const { i18n, dateLocale } = useTranslationContext(); @@ -168,11 +173,11 @@ function Metrics({ routeDownloadStats }: { switch (respInfo.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention - type="danger" - title={i18n.str`Cashout are disabled`} - > - <i18n.Translate>Cashout should be enable by configuration and the conversion rate should be initialized with fee, ratio and rounding mode.</i18n.Translate> + <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <i18n.Translate> + Cashout should be enable by configuration and the conversion rate + should be initialized with fee, ratio and rounding mode. + </i18n.Translate> </Attention> ); } @@ -212,7 +217,7 @@ function Metrics({ routeDownloadStats }: { value={TalerCorebankApi.MonitorTimeframeParam.day} selected={metricType == TalerCorebankApi.MonitorTimeframeParam.day} > - <i18n.Translate>Last day</i18n.Translate> + <i18n.Translate>Previous day</i18n.Translate> </option> <option value={TalerCorebankApi.MonitorTimeframeParam.month} @@ -261,7 +266,7 @@ function Metrics({ routeDownloadStats }: { </button> <button type="button" - name="set last day" + name="set previous day" onClick={(e) => { e.preventDefault(); setMetricType(TalerCorebankApi.MonitorTimeframeParam.day); @@ -272,7 +277,7 @@ function Metrics({ routeDownloadStats }: { class=" text-gray-500 hover:text-gray-700 data-[selected=true]:text-gray-900 group relative min-w-0 flex-1 overflow-hidden bg-white py-4 px-4 text-center text-sm font-medium hover:bg-gray-50 focus:z-10" > <span> - <i18n.Translate>Last day</i18n.Translate> + <i18n.Translate>Previous day</i18n.Translate> </span> <span aria-hidden="true" @@ -346,7 +351,7 @@ function Metrics({ routeDownloadStats }: { </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"> @@ -423,9 +428,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) |