Skip to content

Commit 0dbf945

Browse files
author
Shannon Anahata
committed
fixed a few more top nav bugs
1 parent c65f6a2 commit 0dbf945

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

src/components/TopNavClient.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export default function TopNavClient({platforms}: {platforms: Platform[]}) {
7777
const platformDropdownRef = useRef<HTMLDivElement>(null);
7878
const pathname = usePathname();
7979
const isPlatformsRoute = pathname?.startsWith('/platforms/');
80-
const isProductRoot = pathname === '/product/sentry' || pathname === '/product/sentry/';
8180
const closeTimers = useRef<{products?: NodeJS.Timeout; sdks?: NodeJS.Timeout}>({});
8281
const [productsDropdownOpen, setProductsDropdownOpen] = useState(false);
8382
const [conceptsDropdownOpen, setConceptsDropdownOpen] = useState(false);
@@ -225,7 +224,11 @@ export default function TopNavClient({platforms}: {platforms: Platform[]}) {
225224
</svg>
226225
</button>
227226
)}
228-
<div ref={navRef} className="overflow-x-auto whitespace-nowrap max-w-full scrollbar-hide pr-8 pl-8">
227+
<div
228+
ref={navRef}
229+
className="overflow-x-auto whitespace-nowrap max-w-full scrollbar-hide pr-8 pl-8"
230+
style={{scrollbarWidth: 'none', msOverflowStyle: 'none'}}
231+
>
229232
<ul
230233
className="flex gap-4 w-full items-center overflow-x-visible"
231234
style={{scrollbarWidth: 'none'}}>
@@ -236,7 +239,7 @@ export default function TopNavClient({platforms}: {platforms: Platform[]}) {
236239
<button
237240
ref={productsBtnRef}
238241
className={`text-[var(--gray-12)] transition-colors duration-150 inline-block py-2 px-1 rounded-t-md flex items-center gap-1 text-[0.875rem] font-normal ${
239-
productsDropdownOpen || isProductRoot
242+
productsDropdownOpen || productSections.some(p => pathname?.startsWith(p.href))
240243
? 'border-b-2 border-[var(--accent-purple)]'
241244
: 'hover:text-[var(--accent)]'
242245
}`}
@@ -569,7 +572,11 @@ export default function TopNavClient({platforms}: {platforms: Platform[]}) {
569572
</div>,
570573
document.body
571574
)}
572-
<style>{`div[role='menu']::-webkit-scrollbar { display: none !important; }`}</style>
575+
<style>{`
576+
.scrollbar-hide::-webkit-scrollbar {
577+
display: none;
578+
}
579+
`}</style>
573580
</div>
574581
);
575582
}

src/components/header.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
import {HamburgerMenuIcon} from '@radix-ui/react-icons';
4+
import {Button} from '@radix-ui/themes';
45
import Image from 'next/image';
56
import Link from 'next/link';
67

@@ -80,11 +81,21 @@ export default function Header({
8081
showChatBot
8182
useStoredSearchPlatforms={useStoredSearchPlatforms}
8283
/>
84+
<Button
85+
asChild
86+
variant="ghost"
87+
color="gray"
88+
size="3"
89+
radius="medium"
90+
className="font-medium text-[var(--foreground)] py-2 px-3 uppercase cursor-pointer kapa-ai-class hidden md:flex mr-4"
91+
>
92+
<a href="https://sentry.io/" target="_blank" rel="noopener noreferrer">Go to Sentry</a>
93+
</Button>
8394
<ThemeToggle />
8495
</div>
8596
)}
8697
{!noSearch && (
87-
<div className="flex items-center sm:hidden ml-2 gap-2">
98+
<div className="flex items-center sm:hidden ml-2 gap-2 w-full justify-between">
8899
<MobileMenu pathname={pathname} searchPlatforms={searchPlatforms || []} />
89100
<ThemeToggle />
90101
</div>

src/components/search/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export function Search({
319319
color="gray"
320320
size="3"
321321
radius="medium"
322-
className="font-medium text-[var(--foreground)] py-2 px-3 uppercase cursor-pointer kapa-ai-class hidden md:flex"
322+
className="font-medium text-[var(--foreground)] py-2 px-3 uppercase cursor-pointer kapa-ai-class hidden md:flex mr-4"
323323
>
324324
<div>
325325
<MagicIcon />

0 commit comments

Comments
 (0)