Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/img/ambassadors/donna-zhou.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ambassadors/itamar-kestenbaum.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ambassadors/jamie-barton.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ambassadors/jeff-auriemma.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ambassadors/sarah-sanders.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ambassadors/warren-day.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions src/components/ambassador-grid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import type { Ambassador } from "./info-card/ambassador-data"
import { InfoCard, InfoCardRow } from "./info-card"

function buildRows(ambassador: Ambassador): InfoCardRow[] {
return [
{
type: "label",
label: ambassador.label,
},
{
type: "image",
imageUrl: ambassador.imageUrl,
alt: ambassador.alt,
},
{
type: "label",
label: ambassador.organization,
},
{
type: "label",
label:
ambassador.tags.length > 0 ? (
<div className="flex flex-wrap items-center gap-3">
{ambassador.tags.map(tag => (
<a
key={tag.url}
href={tag.url}
aria-label={tag.label}
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"
target="_blank"
rel="noopener noreferrer"
>
{tag.icon ?? tag.label}
</a>
))}
</div>
) : null,
},
]
}

export function AmbassadorGrid({ ambassadors }: { ambassadors: Ambassador[] }) {
return (
<div className="mx-auto mt-10 flex w-full max-w-6xl flex-wrap justify-center gap-8">
{ambassadors.map((ambassador, index) => (
<InfoCard
key={`${ambassador.label}-${index}`}
rows={buildRows(ambassador)}
className="h-full"
/>
))}
</div>
)
}
Loading