Skip to content

Commit b1a4e67

Browse files
committed
updated bronze sponsors from giving day
1 parent 84574d2 commit b1a4e67

File tree

2 files changed

+51
-25
lines changed

2 files changed

+51
-25
lines changed

src/app/sponsors/SponsorCard.tsx

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import React, { useState } from "react";
34
import Image from "next/image";
45
import { colors } from "@/config/colors";
56

@@ -10,38 +11,40 @@ export function SponsorCard({
1011
sponsor: any;
1112
tier: string;
1213
}) {
14+
const [imgError, setImgError] = useState(false);
15+
16+
const hasLogo = !!sponsor?.logo;
17+
1318
return (
1419
<div className="p-6 rounded-lg shadow-lg flex flex-col items-center text-center transition-transform duration-200 hover:scale-105 bg-transparent">
1520
<div className="flex flex-col items-center w-full">
1621
<div className="flex items-center justify-center w-full h-32 mb-4">
17-
<Image
18-
src={`/sponsors/${sponsor.logo}`}
19-
alt={`${sponsor.name} logo`}
20-
width={sponsor.logo === "BaskinEngineeringLogo.png" ? 240 : 180}
21-
height={sponsor.logo === "BaskinEngineeringLogo.png" ? 160 : 120}
22-
className="object-contain max-w-full max-h-full"
23-
style={{ display: "block" }}
24-
onError={(e) => {
25-
console.warn('Image load failed:', sponsor.logo);
26-
const img = e.currentTarget;
27-
img.style.display = "none";
28-
const fallback =
29-
img.parentElement?.querySelector(".fallback-text");
30-
if (fallback) {
31-
(fallback as HTMLElement).style.display = "flex";
32-
}
33-
}}
34-
/>
35-
<div
36-
className="fallback-text w-full h-full items-center justify-center text-4xl font-bold hidden"
37-
style={{ color: colors.primary, display: "none" }}
38-
>
39-
{sponsor.name.charAt(0)}
40-
</div>
22+
{hasLogo && !imgError ? (
23+
<Image
24+
src={`/sponsors/${sponsor.logo}`}
25+
alt={`${sponsor.name ?? "Sponsor"} logo`}
26+
width={sponsor.logo === "BaskinEngineeringLogo.png" ? 240 : 180}
27+
height={sponsor.logo === "BaskinEngineeringLogo.png" ? 160 : 120}
28+
className="object-contain max-w-full max-h-full"
29+
onError={() => {
30+
console.warn("Image load failed:", sponsor.logo);
31+
setImgError(true);
32+
}}
33+
/>
34+
) : (
35+
<div className="w-full h-full flex items-center justify-center px-2">
36+
<span
37+
className="text-base sm:text-lg md:text-xl lg:text-2xl font-semibold"
38+
style={{ color: '#ffffff', fontFamily: "'Scandia Bold Italic', sans-serif" }}
39+
>
40+
{sponsor?.name ?? "Sponsor"}
41+
</span>
42+
</div>
43+
)}
4144
</div>
4245
</div>
4346
<div className="mt-2">
44-
{sponsor.website !== "#" && (
47+
{sponsor?.website && sponsor.website !== "#" && (
4548
<a
4649
href={sponsor.website}
4750
target="_blank"

src/app/sponsors/page.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,29 @@ export default function SponsorsPage() {
121121
website: "#"
122122
}
123123

124+
,
125+
{
126+
name: "Andrew Lee"
127+
},
128+
{
129+
name: "Robert Shen"
130+
},
131+
{
132+
name: "Abhishek and Tuhina Lal"
133+
},
134+
{
135+
name: "Ruhmit Sahu"
136+
},
137+
{
138+
name: "Boogie"
139+
},
140+
{
141+
name: "Anthony Aguilar Rosales"
142+
},
143+
{
144+
name: "Ivan Kalastirsky"
145+
}
146+
124147
],
125148

126149
specialThanks: [

0 commit comments

Comments
 (0)