File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff 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" >
Original file line number Diff line number Diff line change @@ -195,9 +195,15 @@ export function PlatformSelector({
195195 platform = { {
196196 ...platform ,
197197 // only keep guides that are in the matches list
198- guides : platform . guides . filter ( g =>
199- matches . some ( m => m . key === g . key )
200- ) ,
198+ guides : platform . guides
199+ . filter ( g =>
200+ matches . some ( m => m . key === g . key && m . type === 'guide' )
201+ )
202+ . sort ( ( a , b ) => {
203+ const indexA = matches . findIndex ( m => m . key === a . key ) ;
204+ const indexB = matches . findIndex ( m => m . key === b . key ) ;
205+ return indexA - indexB ;
206+ } ) ,
201207
202208 integrations : platform . integrations . filter ( i =>
203209 matches . some ( m => m . key === i . key )
You can’t perform that action at this time.
0 commit comments