Skip to content

Commit 85ceb31

Browse files
coolguyzoneAlex Krawiecs1gr1d
authored
Add new menu to homepage for most viewed platforms (#12319)
* Add new menu to homepage for most viewed platforms * Update copy * Update next-env.d.ts * Swap Node for JavaScript * Fix dark mode appearance of new menu * move data outside component --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: s1gr1d <[email protected]>
1 parent 2004f78 commit 85ceb31

File tree

2 files changed

+72
-2
lines changed

2 files changed

+72
-2
lines changed

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
"git.ignoreLimitWarning": true,
1313
"search.exclude": {
1414
"**/src/wizard/**": true
15-
}
15+
},
16+
"cSpell.words": [
17+
"laravel"
18+
]
1619
}

src/components/platformFilter/client.tsx

+68-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,40 @@ import styles from './style.module.scss';
1313

1414
import {PlatformIcon} from '../platformIcon';
1515

16+
const mostViewedPlatforms: {icon: string; key: string; title: string; url: string}[] = [
17+
{
18+
url: '/platforms/javascript/guides/nextjs/',
19+
key: 'javascript-nextjs',
20+
icon: 'javascript-nextjs',
21+
title: 'Next.js',
22+
},
23+
{
24+
url: '/platforms/javascript/guides/react/',
25+
key: 'javascript-react',
26+
icon: 'javascript-react',
27+
title: 'React',
28+
},
29+
{
30+
url: 'platforms/php/guides/laravel/',
31+
key: 'php-laravel',
32+
icon: 'php-laravel',
33+
title: 'Laravel',
34+
},
35+
{
36+
url: '/platforms/javascript/guides/node/',
37+
key: 'node',
38+
icon: 'javascript-node',
39+
title: 'Node.js',
40+
},
41+
{url: '/platforms/python/', key: 'python', icon: 'python', title: 'Python'},
42+
{
43+
url: '/platforms/react-native/',
44+
key: 'react-native',
45+
icon: 'react-native',
46+
title: 'React Native',
47+
},
48+
];
49+
1650
export function PlatformFilterClient({platforms}: {platforms: Platform[]}) {
1751
const platformsAndGuides = platforms
1852
.map(p => [
@@ -49,9 +83,42 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) {
4983

5084
return (
5185
<div>
86+
{/* TODO: Refactor a more elegant solution for this top grid, this was thrown together quickly for https://github.com/getsentry/projects/issues/548 */}
87+
<div style={{marginBottom: '40px'}}>
88+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 py-8 md:items-end">
89+
<div className="lg:col-span-2 space-y-2">
90+
<h2 className="text-2xl font-medium">Most Viewed Sentry SDKs</h2>
91+
</div>
92+
</div>
93+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
94+
{mostViewedPlatforms.map(platform => (
95+
<div className={`flex flex-col gap-4 ${styles.platform}`} key={platform.key}>
96+
<Link
97+
href={platform.url}
98+
key={platform.key}
99+
style={{
100+
textDecoration: 'none',
101+
color: 'var(--foreground) !important',
102+
}}
103+
>
104+
<div className={styles.StandalonePlatform}>
105+
<PlatformIcon
106+
size={20}
107+
platform={platform.icon ?? platform.key}
108+
format="lg"
109+
className={`${styles.PlatformIcon} !border-none !shadow-none`}
110+
/>
111+
{platform.title}
112+
</div>
113+
</Link>
114+
</div>
115+
))}
116+
</div>
117+
</div>
118+
52119
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 py-8 md:items-end">
53120
<div className="lg:col-span-2 space-y-2">
54-
<h2 className="text-2xl font-medium">SDKs Supported by Sentry</h2>
121+
<h2 className="text-2xl font-medium">All SDKs Supported by Sentry</h2>
55122
<p className="m-0">If you use it, we probably support it.</p>
56123
</div>
57124
<div className="w-full flex justify-end">

0 commit comments

Comments
 (0)