Skip to content

Commit 128ce9b

Browse files
authored
Ambassador pages (#2201)
1 parent 985d043 commit 128ce9b

File tree

19 files changed

+968
-0
lines changed

19 files changed

+968
-0
lines changed
108 KB
Loading
147 KB
Loading
70.1 KB
Loading
86.6 KB
Loading
51.9 KB
Loading
11.3 KB
Loading

src/components/ambassador-grid.tsx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import type { Ambassador } from "./info-card/ambassador-data"
2+
import { InfoCard, InfoCardRow } from "./info-card"
3+
4+
function buildRows(ambassador: Ambassador): InfoCardRow[] {
5+
return [
6+
{
7+
type: "label",
8+
label: ambassador.label,
9+
},
10+
{
11+
type: "image",
12+
imageUrl: ambassador.imageUrl,
13+
alt: ambassador.alt,
14+
},
15+
{
16+
type: "label",
17+
label: ambassador.organization,
18+
},
19+
{
20+
type: "label",
21+
label:
22+
ambassador.tags.length > 0 ? (
23+
<div className="flex flex-wrap items-center gap-3">
24+
{ambassador.tags.map(tag => (
25+
<a
26+
key={tag.url}
27+
href={tag.url}
28+
aria-label={tag.label}
29+
className="inline-flex h-8 w-8 shrink-0 items-center justify-center bg-neu-100 text-current transition hover:bg-sec-base/10 hover:text-sec-base"
30+
target="_blank"
31+
rel="noopener noreferrer"
32+
>
33+
{tag.icon ?? tag.label}
34+
</a>
35+
))}
36+
</div>
37+
) : null,
38+
},
39+
]
40+
}
41+
42+
export function AmbassadorGrid({ ambassadors }: { ambassadors: Ambassador[] }) {
43+
return (
44+
<div className="mx-auto mt-10 flex w-full max-w-6xl flex-wrap justify-center gap-8">
45+
{ambassadors.map((ambassador, index) => (
46+
<InfoCard
47+
key={`${ambassador.label}-${index}`}
48+
rows={buildRows(ambassador)}
49+
className="h-full"
50+
/>
51+
))}
52+
</div>
53+
)
54+
}

0 commit comments

Comments
 (0)