Skip to content

Commit f403035

Browse files
committed
Add banner fixes
1 parent 06c1b33 commit f403035

3 files changed

Lines changed: 63 additions & 74 deletions

File tree

docs/cody/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Yes, [**Amp**](https://ampcode.com/) is our new AI coding tool for agentic workf
250250

251251
It runs in VS Code with compatible forks like Cursor, Windsurf, and VSCodium and as a CLI. It's also multiplayer — you can share threads and collaborate with your team.
252252

253-
Amp is your way forward if you're using Cody Free or Pro. Sign up today for free $10 Amp credits if you're a Cody Free user and free $40 Amp credits if you're a Cody Pro user.
253+
Amp is your way forward if you're using Cody Free or Pro. Sign up today for $10 in Amp credits if you're a Cody Free user and $40 in Amp credits if you're a Cody Pro user.
254254

255255
### How can I learn more about Amp?
256256

src/components/Layout.tsx

Lines changed: 61 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ function GitHubIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
2525
function Header() {
2626
let [isScrolled, setIsScrolled] = useState(false);
2727

28+
const pathname = usePathname();
29+
const isCodyDocs = pathname.includes('/cody');
30+
const isopenCtxDocs = pathname.includes('/cody/capabilities/openctx');
31+
2832
useEffect(() => {
2933
function onScroll() {
3034
setIsScrolled(window.scrollY > 0);
@@ -38,78 +42,8 @@ function Header() {
3842

3943
return (
4044
<header
41-
className={clsx(
42-
'sticky top-0 z-50 flex flex-none flex-wrap items-center justify-between bg-light-bg px-4 py-6 shadow-md shadow-slate-900/5 transition duration-500 dark:border-dark-border dark:shadow-none sm:px-6 lg:border-b lg:border-light-border lg:px-8',
43-
isScrolled
44-
? 'dark:bg-dark-bg-1 dark:backdrop-blur dark:[@supports(backdrop-filter:blur(0))]:bg-dark-bg-1/80'
45-
: 'dark:bg-transparent'
46-
)}
45+
className="sticky top-0 z-50"
4746
>
48-
<div className="mx-auto flex w-full max-w-8xl items-center justify-between sm:px-2 lg:px-8">
49-
<div className="mr-6 flex lg:hidden">
50-
<MobileNavigation />
51-
</div>
52-
<div className="relative flex flex-grow basis-0 items-center">
53-
<Link
54-
href="/"
55-
aria-label="Home page"
56-
className="relative z-10 hidden md:block"
57-
>
58-
<Logo className="h-9 w-auto" />
59-
</Link>
60-
{/* <Link
61-
href="/"
62-
aria-label="Home page"
63-
className="relative z-10 md:block text-vermilion-08 hover:text-vermilion-07 ml-2"
64-
>
65-
Documentation
66-
</Link>
67-
<Link
68-
href="https://community.sourcegraph.com"
69-
aria-label="Home page"
70-
className="relative z-10 hidden md:block text-vermilion-08 hover:text-vermilion-07 ml-4"
71-
>
72-
Help
73-
</Link> */}
74-
<Link
75-
href="/"
76-
className="relative z-10 block md:hidden"
77-
aria-label="Home page"
78-
>
79-
<LogoMark className="h-6 w-6" />
80-
</Link>
81-
</div>
82-
<div className="-my-5 mr-6 sm:mr-8 md:mr-0">
83-
<Search />
84-
</div>
85-
<div className="relative flex basis-0 items-center justify-end gap-6 sm:gap-6 md:flex-grow">
86-
<VersionSelector />
87-
<ThemeSelector className="relative z-10" />
88-
<Link
89-
href="https://github.com/sourcegraph/docs"
90-
className="group"
91-
aria-label="GitHub"
92-
>
93-
<span className="flex h-7 w-7 items-center justify-center rounded-lg shadow-md shadow-black/5 ring-1 ring-light-border-2 dark:bg-dark-bg-2 dark:ring-inset dark:ring-dark-border">
94-
<GitHubIcon className="h-5 w-5 fill-slate-400 group-hover:fill-slate-500 dark:group-hover:fill-slate-300" />
95-
</span>
96-
</Link>
97-
</div>
98-
</div>
99-
</header>
100-
);
101-
}
102-
103-
export function Layout({ children }: { children: React.ReactNode }) {
104-
let pathname = usePathname();
105-
let isHomePage = pathname === '/';
106-
let isCodyDocs = pathname.includes('/cody');
107-
let isopenCtxDocs = pathname.includes('/cody/capabilities/openctx');
108-
109-
return (
110-
<div className="flex w-full flex-col">
111-
<Header />
112-
11347
{/* Cody docs banner */}
11448
{isCodyDocs && !isopenCtxDocs && <TopBanner
11549
text="UPDATE: Starting July 23, 2025, we're making changes to Cody Free, Pro, and Enterprise Starter plans."
@@ -127,7 +61,62 @@ export function Layout({ children }: { children: React.ReactNode }) {
12761
linkText="Read docs to learn more about configuring MCP."
12862
textColor="#ffffff"
12963
backgroundColor="#F34E3F"
130-
/>} */}
64+
/>} */}
65+
66+
<div className={clsx(
67+
'flex flex-none flex-wrap items-center justify-between bg-light-bg px-4 py-6 shadow-md shadow-slate-900/5 transition duration-500 dark:border-dark-border dark:shadow-none sm:px-6 lg:border-b lg:border-light-border lg:px-8',
68+
isScrolled
69+
? 'dark:bg-dark-bg-1 dark:backdrop-blur dark:[@supports(backdrop-filter:blur(0))]:bg-dark-bg-1/80'
70+
: 'dark:bg-transparent'
71+
)}>
72+
<div className="mx-auto flex w-full max-w-8xl items-center justify-between sm:px-2 lg:px-8">
73+
<div className="mr-6 flex lg:hidden">
74+
<MobileNavigation />
75+
</div>
76+
<div className="relative flex flex-grow basis-0 items-center">
77+
<Link
78+
href="/"
79+
aria-label="Home page"
80+
className="relative z-10 hidden md:block"
81+
>
82+
<Logo className="h-9 w-auto" />
83+
</Link>
84+
<Link
85+
href="/"
86+
className="relative z-10 block md:hidden"
87+
aria-label="Home page"
88+
>
89+
<LogoMark className="h-6 w-6" />
90+
</Link>
91+
</div>
92+
<div className="-my-5 mr-6 sm:mr-8 md:mr-0">
93+
<Search />
94+
</div>
95+
<div className="relative flex basis-0 items-center justify-end gap-6 sm:gap-6 md:flex-grow">
96+
<VersionSelector />
97+
<ThemeSelector className="relative z-10" />
98+
<Link
99+
href="https://github.com/sourcegraph/docs"
100+
className="group"
101+
aria-label="GitHub"
102+
>
103+
<span className="flex h-7 w-7 items-center justify-center rounded-lg shadow-md shadow-black/5 ring-1 ring-light-border-2 dark:bg-dark-bg-2 dark:ring-inset dark:ring-dark-border">
104+
<GitHubIcon className="h-5 w-5 fill-slate-400 group-hover:fill-slate-500 dark:group-hover:fill-slate-300" />
105+
</span>
106+
</Link>
107+
</div>
108+
</div>
109+
</div>
110+
</header>
111+
);
112+
}
113+
114+
export function Layout({ children }: { children: React.ReactNode }) {
115+
let pathname = usePathname();
116+
let isHomePage = pathname === '/';
117+
return (
118+
<div className="flex w-full flex-col">
119+
<Header />
131120

132121
{isHomePage && <Hero />}
133122
{/* {isHomePage && <DemoLayout />} */}

src/components/TopBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function TopBanner({
3636
return (
3737
<div
3838
style={{ backgroundColor: `rgba(${hexToRgb(backgroundColor)}, ${opacity})`, color: textColor }}
39-
className="fixed top-0 z-[100] min-h-[42px] w-full flex items-center justify-center px-4 py-2 md:py-0 md:h-[42px]"
39+
className="sticky top-0 z-[100] min-h-[42px] w-full flex items-center justify-center px-4 py-2 md:py-0 md:h-[42px]"
4040
>
4141
<div className="flex items-center gap-2 text-xs sm:text-sm max-w-[90%] md:max-w-none text-center">
4242
<span className="line-clamp-2 md:line-clamp-1">{text}</span>

0 commit comments

Comments
 (0)