@@ -92,7 +92,9 @@ export function PlatformSelector({
92
92
93
93
const router = useRouter ( ) ;
94
94
const onPlatformChange = ( platformKey : string ) => {
95
- const platform_ = platformsAndGuides . find ( platform => platform . key === platformKey ) ;
95
+ const platform_ = platformsAndGuides . find (
96
+ platform => platform . key === platformKey . replace ( '-redirect' , '' )
97
+ ) ;
96
98
if ( platform_ ) {
97
99
localStorage . setItem ( 'active-platform' , platform_ . key ) ;
98
100
router . push ( platform_ . url ) ;
@@ -277,8 +279,17 @@ function PlatformItem({
277
279
isLastGuide : i === guides . length - 1 ,
278
280
} ) ) ;
279
281
282
+ const isPlatformWithGuidesAndTopLevelAlias =
283
+ platform . guides . length > 0 && ! ! platform . topLevelAlias ;
284
+
280
285
const guides = platform . isExpanded
281
- ? markLastGuide ( platform . guides . length > 0 ? platform . guides : platform . integrations )
286
+ ? markLastGuide (
287
+ platform . guides . length > 0
288
+ ? isPlatformWithGuidesAndTopLevelAlias
289
+ ? [ platform as unknown as PlatformGuide , ...platform . guides ]
290
+ : platform . guides
291
+ : platform . integrations
292
+ )
282
293
: [ ] ;
283
294
284
295
return (
@@ -288,7 +299,11 @@ function PlatformItem({
288
299
< RadixSelect . Label className = "flex" >
289
300
< Fragment >
290
301
< RadixSelect . Item
291
- value = { platform . key }
302
+ value = {
303
+ isPlatformWithGuidesAndTopLevelAlias
304
+ ? `${ platform . key } -redirect`
305
+ : platform . key
306
+ }
292
307
asChild
293
308
className = { styles . item }
294
309
data-platform-with-guides
@@ -303,7 +318,7 @@ function PlatformItem({
303
318
format = "sm"
304
319
className = { styles [ 'platform-icon' ] }
305
320
/>
306
- { platform . title }
321
+ { platform . topLevelAlias ?? platform . title }
307
322
</ span >
308
323
</ RadixSelect . ItemText >
309
324
</ ComboboxItem >
@@ -327,7 +342,7 @@ function PlatformItem({
327
342
</ RadixSelect . Label >
328
343
</ RadixSelect . Group >
329
344
{ guides . map ( guide => {
330
- return < GuideItem key = { guide . key } guide = { guide } /> ;
345
+ return < GuideItem key = { guide . key + '-guide' } guide = { guide } /> ;
331
346
} ) }
332
347
</ Fragment >
333
348
) ;
@@ -339,7 +354,7 @@ type GuideItemProps = {
339
354
function GuideItem ( { guide} : GuideItemProps ) {
340
355
return (
341
356
< RadixSelect . Item
342
- key = { guide . key }
357
+ key = { guide . key + '-guide' }
343
358
value = { guide . key }
344
359
asChild
345
360
className = { styles . item }
0 commit comments