diff --git a/src/components/platformFilter/client.tsx b/src/components/platformFilter/client.tsx index 2a99b5321a8322..9b9594779c8d6f 100644 --- a/src/components/platformFilter/client.tsx +++ b/src/components/platformFilter/client.tsx @@ -70,6 +70,10 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) { return matches_; }, [filter, platformsAndGuides]); + const matchKeys = useMemo(() => { + return matches.map(x => x.key); + }, [matches]); + const platformColumns: Platform[][] = splitToChunks( 3, uniqByReference(matches.map(x => (x.type === 'platform' ? x : x.platform))).map(p => { @@ -161,6 +165,7 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) { = 2} /> @@ -180,11 +185,19 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) { function PlatformWithGuides({ platform, forceExpand, + matchKeys, }: { forceExpand: boolean; + matchKeys: string[]; platform: Platform; }) { const [expanded, setExpanded] = useState(false); + + const guides = useMemo(() => { + const showPlatformInContent = matchKeys.includes(platform.key); + return showPlatformInContent ? [platform, ...platform.guides] : platform.guides; + }, [matchKeys, platform]); + return ( = 8 || platform.integrations.length >= 8} > - {[platform, ...platform.guides].map((guide, i) => ( + {guides.map((guide, i) => (