diff --git a/src/components/platformFilter/client.tsx b/src/components/platformFilter/client.tsx index 2a99b5321a832..eb89669416862 100644 --- a/src/components/platformFilter/client.tsx +++ b/src/components/platformFilter/client.tsx @@ -7,7 +7,7 @@ import {matchSorter, rankings} from 'match-sorter'; import Link from 'next/link'; import {type Platform} from 'sentry-docs/types'; -import {splitToChunks, uniqByReference} from 'sentry-docs/utils'; +import {uniqByReference} from 'sentry-docs/utils'; import styles from './style.module.scss'; @@ -70,19 +70,18 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) { return matches_; }, [filter, platformsAndGuides]); - const platformColumns: Platform[][] = splitToChunks( - 3, - uniqByReference(matches.map(x => (x.type === 'platform' ? x : x.platform))).map(p => { - return { - ...p, - guides: matches - .filter(m => m.type === 'guide' && m.platform.key === p.key) - .map(m => p.guides.find(g => g.key === m.key)!) - .filter(Boolean), - integrations: p.integrations.filter(i => matches.some(m => m.key === i.key)), - }; - }) - ); + const filteredPlatforms: Platform[] = uniqByReference( + matches.map(x => (x.type === 'platform' ? x : x.platform)) + ).map(p => { + return { + ...p, + guides: matches + .filter(m => m.type === 'guide' && m.platform.key === p.key) + .map(m => p.guides.find(g => g.key === m.key)!) + .filter(Boolean), + integrations: p.integrations.filter(i => matches.some(m => m.key === i.key)), + }; + }); return (
@@ -133,41 +132,38 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) { />
- {matches.length > 0 && ( -
- {platformColumns.map((column, i) => ( -
- {column.map(platform => - platform.guides.length === 0 && platform.integrations.length === 0 ? ( - -
- - {platform.title} -
- - ) : ( - = 2} + {filteredPlatforms.length > 0 && ( +
+ {filteredPlatforms.map(platform => + platform.guides.length === 0 && platform.integrations.length === 0 ? ( + +
+ - ) - )} -
- ))} + {platform.title} +
+ + ) : ( + = 2} + /> + ) + )}
)} {!matches.length && ( diff --git a/src/components/platformFilter/style.module.scss b/src/components/platformFilter/style.module.scss index 83e749959699d..3c00a910b3fed 100644 --- a/src/components/platformFilter/style.module.scss +++ b/src/components/platformFilter/style.module.scss @@ -41,21 +41,17 @@ .CollapsibleRoot { border-radius: 0.25rem; box-shadow: var(--shadow-6); + align-self: flex-start; } .CollapsibleTrigger { cursor: pointer; - padding-right: 0.5rem; - padding-left: 0.5rem; flex: 1; display: flex; align-items: center; justify-content: space-between; - font-size: 15px; - line-height: 1; background-color: var(--item-bg); - padding-top: 6px; - padding-bottom: 6px; + padding: 0.75rem 1rem; border-radius: 0.25rem; user-select: none; @@ -67,7 +63,6 @@ display: flex; align-items: center; gap: 0.5rem; - padding: 0.5rem; } } @@ -154,8 +149,6 @@ } .ChevronButton { - width: 24px; - height: 24px; display: flex; align-items: center; justify-content: center;