This commit is contained in:
Tomas Dvorak
2025-11-02 01:04:02 +01:00
parent ac886502e0
commit b9cea0cd77
153 changed files with 43713 additions and 1700 deletions
@@ -8,6 +8,7 @@ interface Sponsor {
logo: string;
url?: string;
tier?: string;
display_order?: number;
}
interface SponsorsSectionProps {
@@ -52,6 +53,7 @@ const SponsorsSection: React.FC<SponsorsSectionProps> = ({
logo: assetUrl(s.logo_url) || '/images/sponsors/placeholder.png',
url: s.website_url || undefined,
tier: s.tier,
display_order: typeof s.display_order === 'number' ? s.display_order : undefined,
}));
setSponsors(mapped);
setLoading(false);
@@ -72,9 +74,10 @@ const SponsorsSection: React.FC<SponsorsSectionProps> = ({
sponsorsData.map((s: any, i: number) => ({
id: s.id ?? i + 1,
name: s.name || 'Sponsor',
logo: s.logo_url || s.logoUrl || s.logo || '/images/sponsors/placeholder.png',
logo: assetUrl(s.logo_url || s.logoUrl || s.logo) || '/images/sponsors/placeholder.png',
url: s.url || s.website || s.link || '#',
tier: s.tier,
display_order: typeof s.display_order === 'number' ? s.display_order : undefined,
}))
);
}
@@ -95,8 +98,17 @@ const SponsorsSection: React.FC<SponsorsSectionProps> = ({
return null;
}
const title = sponsors.find((s: any) => s.tier === 'title') || sponsors[0];
const others = sponsors.filter((s) => s !== title);
const sorted = [...sponsors].sort((a: any, b: any) => {
const at = a.tier === 'general' ? 0 : 1;
const bt = b.tier === 'general' ? 0 : 1;
if (at !== bt) return at - bt;
const ao = (a as any).display_order ?? 9999;
const bo = (b as any).display_order ?? 9999;
if (ao !== bo) return ao - bo;
return String(a.name || '').localeCompare(String(b.name || ''));
});
const title = sorted.find((s: any) => s.tier === 'general') || sorted[0];
const others = sorted.filter((s) => s !== title);
return (
<section