diff --git a/services/explorer-ui/src/components/blocks/block-table-columns.tsx b/services/explorer-ui/src/components/blocks/block-table-columns.tsx index 6ac77cc8..e02a258f 100644 --- a/services/explorer-ui/src/components/blocks/block-table-columns.tsx +++ b/services/explorer-ui/src/components/blocks/block-table-columns.tsx @@ -4,6 +4,7 @@ import { DataTableColumnHeader } from "~/components/data-table"; import { formatTimeSince } from "~/lib/utils"; import { routes } from "~/routes/__root"; import type { BlockTableSchema } from "./blocks-schema"; +import { truncateHashString } from "~/lib/create-hash-string"; const text = { height: "BLOCK HEIGHT", @@ -49,12 +50,9 @@ export const BlockTableColumns: ColumnDef[] = [ const blockHash = row.getValue("blockHash"); if (typeof blockHash !== "string") return null; const r = `${routes.blocks.route}/${blockHash}`; - const truncatedBlockHash = `${blockHash.slice(0, 6)}...${blockHash.slice( - -4 - )}`; return (
- {truncatedBlockHash} + {truncateHashString(blockHash)}
); }, @@ -103,7 +101,7 @@ export const BlockTableColumns: ColumnDef[] = [ cell: ({ row }) => { const formattedTime = formatTimeSince( // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - (row.getValue("timestamp") as unknown as number) + row.getValue("timestamp") as unknown as number, ); return
{formattedTime}
; }, diff --git a/services/explorer-ui/src/components/contracts/classes/columns.tsx b/services/explorer-ui/src/components/contracts/classes/columns.tsx index 204404ec..f39172f7 100644 --- a/services/explorer-ui/src/components/contracts/classes/columns.tsx +++ b/services/explorer-ui/src/components/contracts/classes/columns.tsx @@ -3,6 +3,7 @@ import { Link } from "@tanstack/react-router"; import { routes } from "~/routes/__root"; import { DataTableColumnHeader } from "~/components/data-table"; import { type ContractClass } from "./schema"; +import { truncateHashString } from "~/lib/create-hash-string"; const text = { blockHash: "BLOCK HASH", @@ -26,13 +27,9 @@ export const contractsTableColumns: ColumnDef[] = [ const contractClassId = row.getValue("contractClassId"); if (typeof contractClassId !== "string") return null; const r = `${routes.contracts.route}/${routes.contracts.children.classes.route}/${contractClassId}`; - const truncatedContractClassId = `${contractClassId.slice( - 0, - 6 - )}...${contractClassId.slice(-4)}`; return (
- {truncatedContractClassId} + {truncateHashString(contractClassId)}
); }, diff --git a/services/explorer-ui/src/components/header.tsx b/services/explorer-ui/src/components/header.tsx index b48a8c54..f3bb6445 100644 --- a/services/explorer-ui/src/components/header.tsx +++ b/services/explorer-ui/src/components/header.tsx @@ -1,4 +1,4 @@ -import { Link, useLocation, useNavigate } from "@tanstack/react-router"; +import { Link, useNavigate } from "@tanstack/react-router"; import { Input } from "~/components/ui/input"; import { routes } from "~/routes/__root.tsx"; import { @@ -12,7 +12,6 @@ import { ChicmozHomeLink } from "./ui/chicmoz-home-link"; export const Header = () => { const navigate = useNavigate(); - const location = useLocation(); const getSelectedItem = (value: string) => { void navigate({ @@ -20,14 +19,6 @@ export const Header = () => { }); }; - const getPlaceholder = () => { - const array = Object.values(routes); - const route = location.pathname; - return array.find((item) => { - if (item.route === route) return item.title; - }); - }; - return (
@@ -38,7 +29,7 @@ export const Header = () => {
+ + + + + {txEffectTabs.map((tab) => ( + + {tab.label} + + ))} + + +
{selectedTab === "ecryptedLogs" && (