Skip to content

Commit 8d2c40b

Browse files
[getsentry/action-github-commit] Auto commit
1 parent 0301af1 commit 8d2c40b

File tree

8 files changed

+308
-82
lines changed

8 files changed

+308
-82
lines changed

src/components/TopNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export default async function TopNav() {
66
const rootNode = await getDocsRootNode();
77
const platforms = extractPlatforms(rootNode);
88
return <TopNavClient platforms={platforms} />;
9-
}
9+
}

src/components/TopNavClient.tsx

Lines changed: 89 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use client";
1+
'use client';
22
import {useEffect, useRef, useState} from 'react';
33
import Link from 'next/link';
44
import {usePathname} from 'next/navigation';
@@ -16,25 +16,33 @@ const productSections = [
1616
const mainSections = [
1717
{label: 'Products', href: '/product/sentry'},
1818
{label: 'SDKs', href: '/platforms/'},
19-
{label: 'Concepts & Reference', href: '/concepts/', dropdown: [
20-
{label: 'Key Terms', href: '/concepts/key-terms/'},
21-
{label: 'Search', href: '/concepts/search/'},
22-
{label: 'Migration', href: '/concepts/migration/'},
23-
{label: 'Data Management', href: '/concepts/data-management/'},
24-
{label: 'Sentry CLI', href: '/cli/'},
25-
]},
26-
{label: 'Admin', href: '/organization/', dropdown: [
27-
{label: 'Account Settings', href: '/account/'},
28-
{label: 'Organization Settings', href: '/organization/'},
29-
{label: 'Pricing & Billing', href: '/pricing'},
30-
]},
19+
{
20+
label: 'Concepts & Reference',
21+
href: '/concepts/',
22+
dropdown: [
23+
{label: 'Key Terms', href: '/concepts/key-terms/'},
24+
{label: 'Search', href: '/concepts/search/'},
25+
{label: 'Migration', href: '/concepts/migration/'},
26+
{label: 'Data Management', href: '/concepts/data-management/'},
27+
{label: 'Sentry CLI', href: '/cli/'},
28+
],
29+
},
30+
{
31+
label: 'Admin',
32+
href: '/organization/',
33+
dropdown: [
34+
{label: 'Account Settings', href: '/account/'},
35+
{label: 'Organization Settings', href: '/organization/'},
36+
{label: 'Pricing & Billing', href: '/pricing'},
37+
],
38+
},
3139
];
3240
const moreSections = [
3341
{label: 'API', href: '/api/'},
3442
{label: 'Security, Legal, & PII', href: '/security-legal-pii/'},
3543
];
3644

37-
export default function TopNavClient({platforms}: { platforms: Platform[] }) {
45+
export default function TopNavClient({platforms}: {platforms: Platform[]}) {
3846
const [platformDropdownOpen, setPlatformDropdownOpen] = useState(false);
3947
const [platformDropdownByClick, setPlatformDropdownByClick] = useState(false);
4048
const platformBtnRef = useRef<HTMLButtonElement>(null);
@@ -93,7 +101,13 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
93101
}
94102
document.addEventListener('mousedown', handleClick);
95103
return () => document.removeEventListener('mousedown', handleClick);
96-
}, [platformDropdownOpen, platformDropdownByClick, productsDropdownOpen, conceptsDropdownOpen, adminDropdownOpen]);
104+
}, [
105+
platformDropdownOpen,
106+
platformDropdownByClick,
107+
productsDropdownOpen,
108+
conceptsDropdownOpen,
109+
adminDropdownOpen,
110+
]);
97111

98112
return (
99113
<ul className="flex gap-4 w-full items-center">
@@ -104,7 +118,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
104118
<button
105119
ref={productsBtnRef}
106120
className={`text-[var(--gray-12)] transition-colors duration-150 inline-block ${
107-
(productsDropdownOpen || isProductRoot)
121+
productsDropdownOpen || isProductRoot
108122
? 'bg-[var(--accent-purple)] text-white rounded-md'
109123
: 'hover:text-[var(--accent)] py-2 px-1 rounded-t-md'
110124
} flex items-center gap-1`}
@@ -119,10 +133,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
119133
{section.label}
120134
<svg
121135
className={`ml-1 transition-transform duration-150 ${productsDropdownOpen ? 'rotate-180' : ''}`}
122-
width="16" height="16" viewBox="0 0 16 16" fill="none"
136+
width="16"
137+
height="16"
138+
viewBox="0 0 16 16"
139+
fill="none"
123140
xmlns="http://www.w3.org/2000/svg"
124141
>
125-
<path d="M4 6L8 10L12 6" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
142+
<path
143+
d="M4 6L8 10L12 6"
144+
stroke="currentColor"
145+
strokeWidth="1.5"
146+
strokeLinecap="round"
147+
strokeLinejoin="round"
148+
/>
126149
</svg>
127150
</button>
128151
{productsDropdownOpen && (
@@ -149,7 +172,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
149172
<button
150173
ref={platformBtnRef}
151174
className={`text-[var(--gray-12)] transition-colors duration-150 inline-block ${
152-
(platformDropdownOpen || isPlatformsRoute)
175+
platformDropdownOpen || isPlatformsRoute
153176
? 'bg-[var(--accent-purple)] text-white rounded-md'
154177
: 'hover:text-[var(--accent)] py-2 px-1 rounded-t-md'
155178
} flex items-center gap-1`}
@@ -164,10 +187,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
164187
{section.label}
165188
<svg
166189
className={`ml-1 transition-transform duration-150 ${platformDropdownOpen ? 'rotate-180' : ''}`}
167-
width="16" height="16" viewBox="0 0 16 16" fill="none"
190+
width="16"
191+
height="16"
192+
viewBox="0 0 16 16"
193+
fill="none"
168194
xmlns="http://www.w3.org/2000/svg"
169195
>
170-
<path d="M4 6L8 10L12 6" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
196+
<path
197+
d="M4 6L8 10L12 6"
198+
stroke="currentColor"
199+
strokeWidth="1.5"
200+
strokeLinecap="round"
201+
strokeLinejoin="round"
202+
/>
171203
</svg>
172204
</button>
173205
{platformDropdownOpen && (
@@ -177,10 +209,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
177209
style={{top: '100%', marginTop: 0}}
178210
onClick={e => e.stopPropagation()}
179211
>
180-
<PlatformSelector
181-
platforms={platforms}
182-
currentPlatform={undefined}
183-
/>
212+
<PlatformSelector platforms={platforms} currentPlatform={undefined} />
184213
</div>
185214
)}
186215
</div>
@@ -204,10 +233,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
204233
{section.label}
205234
<svg
206235
className={`ml-1 transition-transform duration-150 ${conceptsDropdownOpen ? 'rotate-180' : ''}`}
207-
width="16" height="16" viewBox="0 0 16 16" fill="none"
236+
width="16"
237+
height="16"
238+
viewBox="0 0 16 16"
239+
fill="none"
208240
xmlns="http://www.w3.org/2000/svg"
209241
>
210-
<path d="M4 6L8 10L12 6" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
242+
<path
243+
d="M4 6L8 10L12 6"
244+
stroke="currentColor"
245+
strokeWidth="1.5"
246+
strokeLinecap="round"
247+
strokeLinejoin="round"
248+
/>
211249
</svg>
212250
</button>
213251
{conceptsDropdownOpen && (
@@ -249,10 +287,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
249287
{section.label}
250288
<svg
251289
className={`ml-1 transition-transform duration-150 ${adminDropdownOpen ? 'rotate-180' : ''}`}
252-
width="16" height="16" viewBox="0 0 16 16" fill="none"
290+
width="16"
291+
height="16"
292+
viewBox="0 0 16 16"
293+
fill="none"
253294
xmlns="http://www.w3.org/2000/svg"
254295
>
255-
<path d="M4 6L8 10L12 6" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
296+
<path
297+
d="M4 6L8 10L12 6"
298+
stroke="currentColor"
299+
strokeWidth="1.5"
300+
strokeLinecap="round"
301+
strokeLinejoin="round"
302+
/>
256303
</svg>
257304
</button>
258305
{adminDropdownOpen && (
@@ -293,7 +340,7 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
293340
<div style={{display: 'inline-block'}}>
294341
<button
295342
className={`text-[var(--gray-12)] transition-colors duration-150 inline-block ${
296-
(moreDropdownOpen || moreSections.some(s => pathname?.startsWith(s.href)))
343+
moreDropdownOpen || moreSections.some(s => pathname?.startsWith(s.href))
297344
? 'bg-[var(--accent-purple)] text-white rounded-md'
298345
: 'hover:text-[var(--accent)] py-2 px-1 rounded-t-md'
299346
} flex items-center gap-1`}
@@ -304,10 +351,19 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
304351
More
305352
<svg
306353
className={`ml-1 transition-transform duration-150 ${moreDropdownOpen ? 'rotate-180' : ''}`}
307-
width="16" height="16" viewBox="0 0 16 16" fill="none"
354+
width="16"
355+
height="16"
356+
viewBox="0 0 16 16"
357+
fill="none"
308358
xmlns="http://www.w3.org/2000/svg"
309359
>
310-
<path d="M4 6L8 10L12 6" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
360+
<path
361+
d="M4 6L8 10L12 6"
362+
stroke="currentColor"
363+
strokeWidth="1.5"
364+
strokeLinecap="round"
365+
strokeLinejoin="round"
366+
/>
311367
</svg>
312368
</button>
313369
{moreDropdownOpen && (
@@ -346,4 +402,4 @@ export default function TopNavClient({platforms}: { platforms: Platform[] }) {
346402
))}
347403
</ul>
348404
);
349-
}
405+
}

src/components/docPage/index.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import {ReactNode} from 'react';
22

3-
import {extractPlatforms,getCurrentGuide, getCurrentPlatform, nodeForPath} from 'sentry-docs/docTree';
3+
import {
4+
extractPlatforms,
5+
getCurrentGuide,
6+
getCurrentPlatform,
7+
nodeForPath,
8+
} from 'sentry-docs/docTree';
49
import {serverContext} from 'sentry-docs/serverContext';
510
import {FrontMatter} from 'sentry-docs/types';
611
import {PaginationNavNode} from 'sentry-docs/types/paginationNavNode';
@@ -61,14 +66,21 @@ export function DocPage({
6166

6267
return (
6368
<div className="tw-app">
64-
<Header pathname={pathname} searchPlatforms={searchPlatforms} platforms={platforms} />
69+
<Header
70+
pathname={pathname}
71+
searchPlatforms={searchPlatforms}
72+
platforms={platforms}
73+
/>
6574
<section className="px-0 flex relative">
6675
{sidebar ?? (
6776
<Sidebar path={unversionedPath.split('/')} versions={frontMatter.versions} />
6877
)}
6978
<main
7079
className="main-content flex w-full flex-1 mx-auto"
71-
style={{marginTop: 'calc(var(--header-height) + var(--topnav-height))', paddingTop: '78px'}}
80+
style={{
81+
marginTop: 'calc(var(--header-height) + var(--topnav-height))',
82+
paddingTop: '78px',
83+
}}
7284
>
7385
<div
7486
className={[

src/components/focus-active-link.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ type Props = {
88
/** Make sure the active link is visible in the sidebar */
99
export function ScrollActiveLink({activeLinkSelector}: Props) {
1010
useEffect(() => {
11-
const activeLinks = Array.from(document.querySelectorAll(activeLinkSelector)) as HTMLElement[];
11+
const activeLinks = Array.from(
12+
document.querySelectorAll(activeLinkSelector)
13+
) as HTMLElement[];
1214
const activeLink = activeLinks[activeLinks.length - 1];
1315
if (activeLink) {
1416
// Find the closest scrollable sidebar container
@@ -17,8 +19,7 @@ export function ScrollActiveLink({activeLinkSelector}: Props) {
1719
const linkRect = activeLink.getBoundingClientRect();
1820
const containerRect = sidebarMain.getBoundingClientRect();
1921
const isFullyVisible =
20-
linkRect.top >= containerRect.top &&
21-
linkRect.bottom <= containerRect.bottom;
22+
linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom;
2223
if (!isFullyVisible) {
2324
activeLink.scrollIntoView({block: 'nearest'});
2425
}

src/components/header.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export default function Header({
7979
showChatBot
8080
useStoredSearchPlatforms={useStoredSearchPlatforms}
8181
/>
82-
<NavLink href="https://sentry.io/" className="ml-4 whitespace-nowrap">Go to Sentry</NavLink>
82+
<NavLink href="https://sentry.io/" className="ml-4 whitespace-nowrap">
83+
Go to Sentry
84+
</NavLink>
8385
</div>
8486
)}
8587
<div className="ml-2">

0 commit comments

Comments
 (0)