Skip to content

Commit ca9fe31

Browse files
committed
obtain matches sort rank for filtering guides
1 parent 01c55e8 commit ca9fe31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/platformFilter/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ export function PlatformFilter({platforms}: {platforms: Platform[]}) {
3838
uniqByReference(matches.map(x => (x.type === 'platform' ? x : x.platform))).map(p => {
3939
return {
4040
...p,
41-
guides: p.guides.filter(g => matches.some(m => m.key === g.key)),
41+
guides: matches
42+
.filter(m => m.type === 'guide' && m.platform.key === p.key)
43+
.map(m => p.guides.find(g => g.key === m.key)!)
44+
.filter(Boolean),
4245
integrations: p.integrations.filter(i => matches.some(m => m.key === i.key)),
4346
};
4447
})
4548
);
49+
4650
return (
4751
<div>
4852
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 py-8 md:items-end">

0 commit comments

Comments
 (0)