From 9851ba9c9e17a74cd1e70f334d01183adf067344 Mon Sep 17 00:00:00 2001 From: ejmg Date: Fri, 30 Aug 2024 00:20:05 -0500 Subject: [PATCH] fixed breadcrumb on search page --- apps/web/src/components/Navbar/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/Navbar/index.tsx b/apps/web/src/components/Navbar/index.tsx index 45b0411..dd90dd2 100644 --- a/apps/web/src/components/Navbar/index.tsx +++ b/apps/web/src/components/Navbar/index.tsx @@ -71,13 +71,15 @@ const Breadcrumbs : FC<{ pathName: string }>= ({ pathName }) => { const isIbc = segments.length >= 2 ? isIbcPath(segments) : false; const isBlockOrTx = segments.length === 2 && segments[0] === "block" || segments[0] === "transaction"; const isTable = isTablePath(segments); + const isSearch = segments.length === 2 && segments[0] === "search"; - // Handle case of /{transactions|blocks} and /ibc/{clients|channels|connections} - if (isTable) { + console.log("building breadcrumb...", isSearch); + // Handle case of /{transactions|blocks}, /ibc/{clients|channels|connections}, /search + if (isTable || isSearch) { // /{transactions|blocks|clients|channels|connections} const parent = isIbc ? segments[1] : segments[0]; const _href = isIbc ? `/ibc/${parent}` : `/${parent}`; - const linkText = isIbc ? `IBC ${capitalize(parent)}` : `Recent ${capitalize(parent)}`; + const linkText = isIbc ? `IBC ${capitalize(parent)}` : isSearch ? `${capitalize(parent)}` : `Recent ${capitalize(parent)}`; return ( @@ -105,7 +107,7 @@ const Breadcrumbs : FC<{ pathName: string }>= ({ pathName }) => { const tableRef = isIbc ? `/ibc/${parentTable}` : `/${parentTable}`; const _href = isIbc ? `/ibc/${parent}/${slug}` : `/${parent}/${slug}`; // Same prefixing but for the "current" breadcrumb - const linkText = isIbc ? `IBC ${capitalize(parent)} Summary` : `${capitalize(parent)} Summary`; + const linkText = `${capitalize(parent)} Summary`; return (