From c48c4315a8b6d4576c0ca12b23d8f3c5975afbc2 Mon Sep 17 00:00:00 2001 From: Csillag Kristof Date: Wed, 14 Jun 2023 17:42:13 +0200 Subject: [PATCH] Fix dashboard links to latest blocks and transactions --- .changelog/537.bugfix.md | 1 + src/app/pages/DashboardPage/LatestBlocks.tsx | 10 ++++++++-- src/app/pages/DashboardPage/LatestTransactions.tsx | 10 ++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .changelog/537.bugfix.md diff --git a/.changelog/537.bugfix.md b/.changelog/537.bugfix.md new file mode 100644 index 000000000..701431484 --- /dev/null +++ b/.changelog/537.bugfix.md @@ -0,0 +1 @@ +Fix dashboard links to latest blocks and transactions diff --git a/src/app/pages/DashboardPage/LatestBlocks.tsx b/src/app/pages/DashboardPage/LatestBlocks.tsx index 5af254b58..962a08980 100644 --- a/src/app/pages/DashboardPage/LatestBlocks.tsx +++ b/src/app/pages/DashboardPage/LatestBlocks.tsx @@ -11,12 +11,14 @@ import { NUMBER_OF_ITEMS_ON_DASHBOARD } from '../../config' import { COLORS } from '../../../styles/theme/colors' import { AppErrors } from '../../../types/errors' import { useRequiredScopeParam } from '../../hooks/useScopeParam' +import { RouteUtils } from '../../utils/route-utils' const limit = NUMBER_OF_ITEMS_ON_DASHBOARD export const LatestBlocks: FC = () => { const { t } = useTranslation() - const { network, layer } = useRequiredScopeParam() + const scope = useRequiredScopeParam() + const { network, layer } = scope if (layer === Layer.consensus) { throw AppErrors.UnsupportedLayer // Listing the latest consensus blocks is not yet implemented. @@ -31,7 +33,11 @@ export const LatestBlocks: FC = () => { component="h3" title={t('blocks.latest')} action={ - + {t('common.viewAll')} } diff --git a/src/app/pages/DashboardPage/LatestTransactions.tsx b/src/app/pages/DashboardPage/LatestTransactions.tsx index 203c559d1..832beb1d1 100644 --- a/src/app/pages/DashboardPage/LatestTransactions.tsx +++ b/src/app/pages/DashboardPage/LatestTransactions.tsx @@ -11,12 +11,14 @@ import { NUMBER_OF_ITEMS_ON_DASHBOARD } from '../../config' import { COLORS } from '../../../styles/theme/colors' import { AppErrors } from '../../../types/errors' import { useRequiredScopeParam } from '../../hooks/useScopeParam' +import { RouteUtils } from '../../utils/route-utils' const limit = NUMBER_OF_ITEMS_ON_DASHBOARD export const LatestTransactions: FC = () => { const { t } = useTranslation() - const { network, layer } = useRequiredScopeParam() + const scope = useRequiredScopeParam() + const { network, layer } = scope if (layer === Layer.consensus) { throw AppErrors.UnsupportedLayer // Listing the latest consensus transactions is not yet supported. @@ -31,7 +33,11 @@ export const LatestTransactions: FC = () => { component="h3" title={t('transactions.latest')} action={ - + {t('common.viewAll')} }