Skip to content

Commit 1de42a8

Browse files
committed
refactor sponsors page, add Total Phase sponsor
1 parent 7af017f commit 1de42a8

3 files changed

Lines changed: 123 additions & 126 deletions

File tree

10.1 KB
Loading

src/app/sponsors/SponsorCard.tsx

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,69 @@ import React, { useState } from "react";
44
import Image from "next/image";
55
import { colors } from "@/config/colors";
66

7+
export interface Sponsor {
8+
name: string;
9+
description?: string;
10+
logo?: string;
11+
website?: string;
12+
}
13+
714
export function SponsorCard({
815
sponsor,
9-
tier,
16+
width,
17+
height,
1018
}: {
11-
sponsor: any;
12-
tier: string;
19+
sponsor: Sponsor;
20+
width?: number;
21+
height?: number;
1322
}) {
1423
const [imgError, setImgError] = useState(false);
1524

1625
const hasLogo = !!sponsor?.logo;
1726

1827
return (
19-
<div className="p-6 rounded-lg shadow-lg flex flex-col items-center text-center transition-transform duration-200 hover:scale-105 bg-transparent">
28+
<div
29+
className="p-8 rounded-lg shadow-lg flex flex-col items-center text-center transition-transform duration-200 hover:scale-105"
30+
style={{ backgroundColor: colors.background.secondary }}
31+
>
2032
<div className="flex flex-col items-center w-full">
21-
<div className="flex items-center justify-center w-full h-32 mb-4">
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-
)}
44-
</div>
45-
</div>
46-
<div className="mt-2">
47-
{sponsor?.website && sponsor.website !== "#" && (
48-
<a
49-
href={sponsor.website}
50-
target="_blank"
51-
rel="noopener noreferrer"
52-
className="text-xs hover:underline mt-1 inline-block"
53-
style={{ color: colors.primary }}
54-
>
55-
Visit Website
56-
</a>
57-
)}
33+
<a
34+
href={sponsor.website}
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
>
38+
<div className="flex items-center justify-center w-full h-32 mb-4">
39+
{hasLogo && !imgError ? (
40+
<Image
41+
src={`/sponsors/${sponsor.logo}`}
42+
alt={`${sponsor.name ?? "Sponsor"} logo`}
43+
width={width ?? 180}
44+
height={height ?? 120}
45+
style={{
46+
width: '80%',
47+
height: 'auto',
48+
}}
49+
className="object-contain max-w-full max-h-full"
50+
onError={() => {
51+
console.warn("Image load failed:", sponsor.logo);
52+
setImgError(true);
53+
}}
54+
/>
55+
) : (
56+
<div className="w-full h-full flex items-center justify-center px-2">
57+
<span
58+
className="text-base sm:text-lg md:text-xl lg:text-2xl font-semibold"
59+
style={{
60+
color: "#ffffff",
61+
fontFamily: "'Scandia Bold Italic', sans-serif",
62+
}}
63+
>
64+
{sponsor?.name ?? "Sponsor"}
65+
</span>
66+
</div>
67+
)}
68+
</div>
69+
</a>
5870
</div>
5971
</div>
6072
);

0 commit comments

Comments
 (0)