Skip to content

Commit 50d15a8

Browse files
committed
refactor past sponsor creation
1 parent 5b627dc commit 50d15a8

File tree

1 file changed

+42
-62
lines changed

1 file changed

+42
-62
lines changed

src/app/conf/2025/past-sponsors.tsx

Lines changed: 42 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,46 @@ import Graphweaver from "public/img/conf/Sponsors/Graphweaver.svg"
99
import { clsx } from "clsx"
1010
import NextImage from "next-image-export-optimizer"
1111

12-
interface Image {
12+
type LogosType = {
1313
icon: string
1414
name: string
1515
link: string
1616
}
1717

18-
const sponsorDiamond: Image[] = [
19-
{ icon: TheGuild, name: "The Guild", link: "https://the-guild.dev" },
20-
{ icon: IBM, name: "IBM", link: "https://www.ibm.com/products/api-connect" },
21-
]
22-
23-
const sponsorPlatinum: Image[] = []
24-
25-
const sponsorGold: Image[] = [
26-
{ icon: Apollo, name: "Apollo", link: "https://www.apollographql.com/" },
27-
{ icon: Graphweaver, name: "Graphweaver", link: "https://graphweaver.com" },
28-
{ icon: Hasura, name: "Hasura", link: "https://hasura.io" },
29-
]
30-
31-
const sponsorSilver: Image[] = [
32-
{ icon: Stellate, name: "Stellate", link: "https://stellate.co" },
33-
{ icon: Tyk, name: "Tyk", link: "https://tyk.io/" },
18+
const SPONSORS: Array<{
19+
title: string
20+
logos: Array<LogosType>
21+
}> = [
22+
{
23+
title: "Diamond",
24+
logos: [
25+
{ icon: TheGuild, name: "The Guild", link: "https://the-guild.dev" },
26+
{
27+
icon: IBM,
28+
name: "IBM",
29+
link: "https://www.ibm.com/products/api-connect",
30+
},
31+
],
32+
},
33+
{
34+
title: "Gold",
35+
logos: [
36+
{ icon: Apollo, name: "Apollo", link: "https://www.apollographql.com/" },
37+
{
38+
icon: Graphweaver,
39+
name: "Graphweaver",
40+
link: "https://graphweaver.com",
41+
},
42+
{ icon: Hasura, name: "Hasura", link: "https://hasura.io" },
43+
],
44+
},
45+
{
46+
title: "Silver",
47+
logos: [
48+
{ icon: Stellate, name: "Stellate", link: "https://stellate.co" },
49+
{ icon: Tyk, name: "Tyk", link: "https://tyk.io/" },
50+
],
51+
},
3452
]
3553

3654
function List({
@@ -39,7 +57,7 @@ function List({
3957
linkClassName,
4058
}: {
4159
className?: string
42-
items: Image[]
60+
items: Array<LogosType>
4361
linkClassName?: string
4462
}) {
4563
return (
@@ -80,58 +98,20 @@ export function PastSponsors() {
8098
return (
8199
<section>
82100
<h1 className="conf-heading mb-12">Thanks to our 2024 sponsors!</h1>
83-
{sponsorDiamond.length > 0 && (
101+
{SPONSORS.map(({ title, logos }, i) => (
84102
<>
85103
<div className="flex items-center gap-2 mb-2 border-b-2 border-dotted pb-1.5 border-white/40">
86-
<div className="size-2.5 bg-[#E10098]"></div>
87-
<h3 className=" font-medium">DIAMOND</h3>
104+
{/* Square box */}
105+
<div className="size-2.5 bg-primary" />
106+
<h3 className=" font-medium uppercase">{title}</h3>
88107
</div>
89108
<List
90-
items={sponsorDiamond}
109+
items={logos}
91110
className="flex"
92111
linkClassName="p-8 lg:p-16 h-28 lg:h-[220px]"
93112
/>
94113
</>
95-
)}
96-
{sponsorPlatinum.length > 0 && (
97-
<>
98-
<div className="flex items-center gap-2 mb-2 border-b-2 border-dotted pb-1.5 border-white/40">
99-
<div className="size-2.5 bg-[#E10098]"></div>
100-
<h3 className=" font-medium">PLATINUM</h3>
101-
</div>
102-
<List
103-
items={sponsorPlatinum}
104-
className="flex"
105-
linkClassName="p-8 lg:py-14 h-28 lg:h-[210px]"
106-
/>
107-
</>
108-
)}
109-
{sponsorGold.length > 0 && (
110-
<>
111-
<div className="flex items-center gap-2 mb-2 border-b-2 border-dotted pb-1.5 border-white/40">
112-
<div className="size-2.5 bg-[#E10098]"></div>
113-
<h3 className=" font-medium">GOLD</h3>
114-
</div>
115-
<List
116-
items={sponsorGold}
117-
className="flex"
118-
linkClassName="p-8 lg:py-14 h-28 lg:h-[170px]"
119-
/>
120-
</>
121-
)}
122-
{sponsorSilver.length > 0 && (
123-
<>
124-
<div className="flex items-center gap-2 mb-2 border-b-2 border-dotted pb-1.5 border-white/40">
125-
<div className="size-2.5 bg-[#E10098]"></div>
126-
<h3 className="font-medium">SILVER</h3>
127-
</div>
128-
<List
129-
items={sponsorSilver}
130-
className="flex"
131-
linkClassName="p-6 lg:p-10 h-28 lg:h-[155px]"
132-
/>
133-
</>
134-
)}
114+
))}
135115
</section>
136116
)
137117
}

0 commit comments

Comments
 (0)