Skip to content

Commit

Permalink
Fixed network title on Nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Malak67 committed Oct 23, 2023
1 parent 99afb52 commit 7d1bb8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions services/explorer/src/pages/Holders/Holders.effects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { useExplorerLoader, useExplorerNetwork } from '../../hooks';
import { toHolderTableRow } from './HolderRow';
import { BigNumber } from 'ethers';
import { Network } from '../../utils';

const cols: ColumnData[] = [
{ path: 'rank', name: 'Rank' },
Expand Down Expand Up @@ -105,9 +104,7 @@ export const useHoldersEffects = (): {
};

const title = `Holders`;
const description = `Current holders on Taraxa ${
currentNetwork === Network.DEVNET ? Network.MAINNET : currentNetwork
}`;
const description = `Current holders on Taraxa ${currentNetwork}`;

return {
title,
Expand Down
5 changes: 4 additions & 1 deletion services/explorer/src/pages/Nodes/Nodes.effects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const useNodesEffects = (): {
year: number;
loading: boolean;
weekPagination: WeekPagination;
pageSubtitle: string;
} => {
const [loading, setLoading] = useState<boolean>(false);
const [weekNumber, setWeekNumber] = useState<number>();
Expand All @@ -52,7 +53,7 @@ export const useNodesEffects = (): {

const { page, rowsPerPage, handleChangePage, handleChangeRowsPerPage } =
usePagination();
const { backendEndpoint } = useExplorerNetwork();
const { currentNetwork, backendEndpoint } = useExplorerNetwork();

const { data: blocks } = useGetBlocksThisWeek(
backendEndpoint,
Expand Down Expand Up @@ -138,6 +139,7 @@ export const useNodesEffects = (): {
weekPagination?.startDate
)} - ${formatDate(weekPagination?.endDate)})`;
const description = 'Total blocks produced this week';
const pageSubtitle = `List of TARAXA nodes on ${currentNetwork}`;

return {
blocks: blocks?.data,
Expand All @@ -163,5 +165,6 @@ export const useNodesEffects = (): {
year,
loading,
weekPagination,
pageSubtitle,
};
};
3 changes: 2 additions & 1 deletion services/explorer/src/pages/Nodes/Nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ const NodesPage = (): JSX.Element => {
year,
loading,
weekPagination,
pageSubtitle,
} = useNodesEffects();
return (
<>
<PageTitle title='Nodes' subtitle='List of TARAXA nodes on Mainnet' />
<PageTitle title='Nodes' subtitle={pageSubtitle} />
{weekPagination && (
<Box
sx={{
Expand Down

0 comments on commit 7d1bb8f

Please sign in to comment.