Skip to content

Commit

Permalink
fix: remove getBlockInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpeach committed Jul 14, 2023
1 parent 541b6cd commit 96814a5
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/lib/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,10 @@ const blockTimeInfo = {
};

const blockInfo = {
title: "Latest Block Height",
tooltip:
"Latest Block Height tracks transactions and network growth for a healthy blockchain ecosystem.",
};

const indexedBlockInfo = {
title: "Latest Indexed Block Height",
tooltip: "The latest block height indexed by the indexer.",
};

const getBlockInfo = (chain: string) =>
chain === "sei" ? indexedBlockInfo : blockInfo;

interface CardInfoProps {
title: string;
tooltip: string;
Expand Down Expand Up @@ -120,7 +111,7 @@ const Home = () => {
const { isDevMode } = useCelatoneApp();

const {
chainConfig: { chain, prettyName },
chainConfig: { prettyName },
} = useCelatoneApp();
const {
data: latestBlockInfo,
Expand All @@ -134,8 +125,6 @@ const Home = () => {
);
const { data: txsCount, isLoading: isLoadingTxsCount } = useTxsCount();

const chainBlockInfo = getBlockInfo(chain);

const toTxs = () =>
navigate({
pathname: "/txs",
Expand Down Expand Up @@ -215,8 +204,8 @@ const Home = () => {
navigate={toTxs}
/>
<CardInfo
title={chainBlockInfo.title}
tooltip={chainBlockInfo.tooltip}
title={blockInfo.title}
tooltip={blockInfo.tooltip}
value={latestBlockInfo?.height?.toString() ?? "N/A"}
isLoading={isLoadingLatestBlockInfo}
navigate={toBlocks}
Expand Down

0 comments on commit 96814a5

Please sign in to comment.