Skip to content

Commit edb5516

Browse files
authored
Merge pull request #7496 from QwikDev/docs-filter-showcase
feat(showcase): filter and group sites by score
2 parents d8aeb96 + 4fd9c4f commit edb5516

File tree

4 files changed

+533
-407
lines changed

4 files changed

+533
-407
lines changed

packages/docs/src/routes/(ecosystem)/ecosystem/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import { EcosystemMenu } from './ecosystem-menu';
1010
import { MobileEcosystemMenu } from './mobile-ecosystem-menu';
1111
import { QwikPlusLogo } from './qwik-plus-logo';
1212

13+
const getRandomSites = (sites: typeof SHOWCASE) => {
14+
return sites
15+
.filter((site) => site.perf.score >= 0.9)
16+
.sort(() => (Math.random() > 0.5 ? 1 : -1))
17+
.slice(0, 6);
18+
};
19+
1320
export default component$(() => {
1421
useStyles$(styles);
1522

@@ -19,7 +26,7 @@ export default component$(() => {
1926
const videos = MEDIA.videos.filter(mediaFilter);
2027
const podcasts = MEDIA.podcasts.filter(mediaFilter);
2128
const presentations = MEDIA.presentations.filter(mediaFilter);
22-
const showcaseSites = SHOWCASE.slice(0, 6);
29+
const showcaseSites = getRandomSites(SHOWCASE);
2330

2431
return (
2532
<>

0 commit comments

Comments
 (0)