@@ -92,7 +92,9 @@ export function PlatformSelector({
9292
9393 const router = useRouter ( ) ;
9494 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+ ) ;
9698 if ( platform_ ) {
9799 localStorage . setItem ( 'active-platform' , platform_ . key ) ;
98100 router . push ( platform_ . url ) ;
@@ -277,8 +279,17 @@ function PlatformItem({
277279 isLastGuide : i === guides . length - 1 ,
278280 } ) ) ;
279281
282+ const isPlatformWithGuidesAndTopLevelAlias =
283+ platform . guides . length > 0 && ! ! platform . topLevelAlias ;
284+
280285 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+ )
282293 : [ ] ;
283294
284295 return (
@@ -288,7 +299,11 @@ function PlatformItem({
288299 < RadixSelect . Label className = "flex" >
289300 < Fragment >
290301 < RadixSelect . Item
291- value = { platform . key }
302+ value = {
303+ isPlatformWithGuidesAndTopLevelAlias
304+ ? `${ platform . key } -redirect`
305+ : platform . key
306+ }
292307 asChild
293308 className = { styles . item }
294309 data-platform-with-guides
@@ -303,7 +318,7 @@ function PlatformItem({
303318 format = "sm"
304319 className = { styles [ 'platform-icon' ] }
305320 />
306- { platform . title }
321+ { platform . topLevelAlias ?? platform . title }
307322 </ span >
308323 </ RadixSelect . ItemText >
309324 </ ComboboxItem >
@@ -327,7 +342,7 @@ function PlatformItem({
327342 </ RadixSelect . Label >
328343 </ RadixSelect . Group >
329344 { guides . map ( guide => {
330- return < GuideItem key = { guide . key } guide = { guide } /> ;
345+ return < GuideItem key = { guide . key + '-guide' } guide = { guide } /> ;
331346 } ) }
332347 </ Fragment >
333348 ) ;
@@ -339,7 +354,7 @@ type GuideItemProps = {
339354function GuideItem ( { guide} : GuideItemProps ) {
340355 return (
341356 < RadixSelect . Item
342- key = { guide . key }
357+ key = { guide . key + '-guide' }
343358 value = { guide . key }
344359 asChild
345360 className = { styles . item }
0 commit comments