Skip to content

Commit 43d98f4

Browse files
Alex KrawiecAlex Krawiec
authored andcommitted
Add new menu to homepage for most viewed platforms
1 parent 69e8a1d commit 43d98f4

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
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
}

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
/// <reference types="next/navigation-types/compat/navigation" />
44

55
// NOTE: This file should not be edited
6-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

src/components/platformFilter/client.tsx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,73 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) {
4747
})
4848
);
4949

50+
const mostViewedPlatforms: {icon: string; key: string; title: string; url: string}[] = [
51+
{
52+
url: '/platforms/javascript/guides/nextjs/',
53+
key: 'javascript-nextjs',
54+
icon: 'javascript-nextjs',
55+
title: 'Next.JS',
56+
},
57+
{
58+
url: '/platforms/javascript/guides/react/',
59+
key: 'javascript-react',
60+
icon: 'javascript-react',
61+
title: 'React',
62+
},
63+
{
64+
url: 'platforms/php/guides/laravel/',
65+
key: 'php-laravel',
66+
icon: 'php-laravel',
67+
title: 'Laravel',
68+
},
69+
{
70+
url: '/platforms/javascript/',
71+
key: 'javascript',
72+
icon: 'javascript',
73+
title: 'JavaScript',
74+
},
75+
{url: '/platforms/python/', key: 'python', icon: 'python', title: 'Python'},
76+
{
77+
url: '/platforms/react-native/',
78+
key: 'react-native',
79+
icon: 'react-native',
80+
title: 'React Native',
81+
},
82+
];
83+
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+
<Link
96+
href={platform.url}
97+
key={platform.key}
98+
style={{
99+
textDecoration: 'none',
100+
color: 'var(--foreground) !important',
101+
}}
102+
>
103+
<div className={styles.StandalonePlatform}>
104+
<PlatformIcon
105+
size={20}
106+
platform={platform.icon ?? platform.key}
107+
format="lg"
108+
className={`${styles.PlatformIcon} !border-none !shadow-none`}
109+
/>
110+
{platform.title}
111+
</div>
112+
</Link>
113+
))}
114+
</div>
115+
</div>
116+
52117
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 py-8 md:items-end">
53118
<div className="lg:col-span-2 space-y-2">
54119
<h2 className="text-2xl font-medium">SDKs Supported by Sentry</h2>

0 commit comments

Comments
 (0)