From 3d43828ac0491341615f6aa8abdc8d62603c2773 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Wed, 25 Jun 2025 00:02:37 +0500 Subject: [PATCH] Fixed top banner overlap issue --- src/components/Layout.tsx | 138 ++++++++++++++++------------------- src/components/TopBanner.tsx | 2 +- 2 files changed, 65 insertions(+), 75 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 69c7847e9..402ab0687 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -12,6 +12,7 @@ import { useEffect, useState } from 'react'; import { LogoMark } from './LogoMark'; import { Search } from './search/Search'; import VersionSelector from './VersionSelector'; +import { TopBanner } from './TopBanner'; function GitHubIcon(props: React.ComponentPropsWithoutRef<'svg'>) { return ( @@ -24,6 +25,10 @@ function GitHubIcon(props: React.ComponentPropsWithoutRef<'svg'>) { function Header() { let [isScrolled, setIsScrolled] = useState(false); + const pathname = usePathname(); + const isCodyDocs = pathname.includes('/cody'); + const isopenCtxDocs = pathname.includes('/cody/capabilities/openctx'); + useEffect(() => { function onScroll() { setIsScrolled(window.scrollY > 0); @@ -37,87 +42,17 @@ function Header() { return (
-
-
- -
-
- - - - {/* - Documentation - - - Help - */} - - - -
-
- -
-
- - - - - - - -
-
-
- ); -} - -export function Layout({ children }: { children: React.ReactNode }) { - let pathname = usePathname(); - let isHomePage = pathname === '/'; - let isCodyDocs = pathname.includes('/cody'); - let isopenCtxDocs = pathname.includes('/cody/capabilities/openctx'); - - return ( -
-
- {/* Cody docs banner */} - {/*isCodyDocs && !isopenCtxDocs && /*} + />} {/* Openctx docs banner */} {/* {isopenCtxDocs && } */} + />} */} + +
+
+
+ +
+
+ + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ ); +} + +export function Layout({ children }: { children: React.ReactNode }) { + let pathname = usePathname(); + let isHomePage = pathname === '/'; + return ( +
+
{isHomePage && } {/* {isHomePage && } */} diff --git a/src/components/TopBanner.tsx b/src/components/TopBanner.tsx index 803a2580b..5ffd14ef4 100644 --- a/src/components/TopBanner.tsx +++ b/src/components/TopBanner.tsx @@ -36,7 +36,7 @@ export function TopBanner({ return (
{text}