11import { Layout } from '../../design/common/layout'
2+ import { FeaturedCard } from '../../design/components/featured-card'
23import { RepoCard } from '../../design/components/repo-card'
34import { Select } from '../../design/components/select'
45import type { Catalog , CatalogEntry } from '../../catalog/types'
@@ -21,60 +22,63 @@ export function WorkIndex({
2122 config : SiteConfig
2223} ) {
2324 const visible = catalog . filter ( ( e ) => ! e . hidden )
24- const sorted = [ ...visible ] . sort ( defaultSort )
25+ const featured = visible . filter ( ( e ) => e . featured )
26+ const rest = visible . filter ( ( e ) => ! e . featured ) . sort ( defaultSort )
2527
2628 return (
2729 < Layout title = "Work" config = { config } >
2830 < h1 > Our work</ h1 >
2931 < p class = "work-index__intro" >
3032 Flexion's public portfolio — tools we've built, prototypes we've shipped, and
31- open-source projects we actively contribute to. Use the filters to explore by
32- tier or category. See our{ ' ' }
33+ open-source projects we actively contribute to. See our{ ' ' }
3334 < a href = { url ( '/work/health/' , config . basePath ) } > stewardship scorecard</ a > for
3435 how each repo measures up.
3536 </ p >
36- < catalog-filter >
37- < form class = "catalog-filter" >
38- < fieldset >
39- < legend > Filter</ legend >
40- < Select name = "tier" label = "Tier" >
41- < option value = "" > All</ option >
42- < option value = "active" > Active</ option >
43- < option value = "unreviewed" > Unreviewed</ option >
44- < option value = "as-is" > As-is</ option >
45- < option value = "archived" > Archived</ option >
46- </ Select >
47- < Select name = "category" label = "Category" >
48- < option value = "" > All</ option >
49- < option value = "product" > Product</ option >
50- < option value = "tool" > Tool</ option >
51- < option value = "workshop" > Workshop</ option >
52- < option value = "prototype" > Prototype</ option >
53- < option value = "fork" > Fork</ option >
54- < option value = "uncategorized" > Uncategorized</ option >
55- </ Select >
56- </ fieldset >
57- </ form >
58- < ul class = "work-index__list" >
59- { sorted . map ( ( entry , i ) => (
60- < >
61- { entry . featured && i === 0 ? (
62- < li class = "work-index__section-heading" data-featured = "true" role = "presentation" aria-hidden = "true" >
63- < h2 > Featured</ h2 >
64- </ li >
65- ) : null }
66- { ! entry . featured && ( i === 0 || sorted [ i - 1 ] . featured ) ? (
67- < li class = "work-index__section-heading" role = "presentation" aria-hidden = "true" >
68- < h2 > All projects</ h2 >
69- </ li >
70- ) : null }
71- < li data-tier = { entry . tier } data-category = { entry . category } data-featured = { entry . featured ? 'true' : undefined } >
37+
38+ { featured . length > 0 ? (
39+ < section class = "work-index__featured" aria-labelledby = "featured-heading" >
40+ < h2 id = "featured-heading" > Featured</ h2 >
41+ < div class = "work-index__featured-grid" >
42+ { featured . map ( ( entry ) => (
43+ < FeaturedCard entry = { entry } basePath = { config . basePath } />
44+ ) ) }
45+ </ div >
46+ </ section >
47+ ) : null }
48+
49+ < section aria-labelledby = "all-heading" >
50+ < h2 id = "all-heading" > All projects</ h2 >
51+ < catalog-filter >
52+ < form class = "catalog-filter" >
53+ < fieldset >
54+ < legend > Filter</ legend >
55+ < Select name = "tier" label = "Tier" >
56+ < option value = "" > All</ option >
57+ < option value = "active" > Active</ option >
58+ < option value = "unreviewed" > Unreviewed</ option >
59+ < option value = "as-is" > As-is</ option >
60+ < option value = "archived" > Archived</ option >
61+ </ Select >
62+ < Select name = "category" label = "Category" >
63+ < option value = "" > All</ option >
64+ < option value = "product" > Product</ option >
65+ < option value = "tool" > Tool</ option >
66+ < option value = "workshop" > Workshop</ option >
67+ < option value = "prototype" > Prototype</ option >
68+ < option value = "fork" > Fork</ option >
69+ < option value = "uncategorized" > Uncategorized</ option >
70+ </ Select >
71+ </ fieldset >
72+ </ form >
73+ < ul class = "work-index__list" >
74+ { rest . map ( ( entry ) => (
75+ < li data-tier = { entry . tier } data-category = { entry . category } >
7276 < RepoCard entry = { entry } basePath = { config . basePath } />
7377 </ li >
74- </ >
75- ) ) }
76- </ ul >
77- </ catalog-filter >
78+ ) ) }
79+ </ ul >
80+ </ catalog-filter >
81+ </ section >
7882 </ Layout >
7983 )
8084}
0 commit comments