-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathSponsorLogo.astro
More file actions
66 lines (57 loc) · 1.67 KB
/
SponsorLogo.astro
File metadata and controls
66 lines (57 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
import { getEntry } from "astro:content";
import { Image } from "astro:assets";
import { sponsorLogos } from "@data/sponsorLogos";
const { sponsor: sponsorId, special_event=false } = Astro.props;
const sponsor = await getEntry("sponsors", sponsorId);
if (!sponsor) {
throw new Error(`Sponsor with ID "${sponsorId}" not found`);
}
const {
name: title,
url: website,
tier,
event_name,
logo_padding = false,
} = sponsor.data;
const logo = sponsorLogos[sponsor.id];
const slug = tier==="Partners"? `/community-partners#sponsor-${sponsorId}`
/*: tier==="Platinum" ? `/sponsor/${sponsorId}` */
: tier==="Media Partners" ? `/media-partners#sponsor-${sponsorId}` : tier==="Startups" ? `/startups#sponsor-${sponsorId}` : `/sponsors#sponsor-${sponsorId}`
---
<div
class="lg:max-w-[400px] flex flex-col p-6 bg-white"
>
<div class="w-full grid text-center justify-center items-center md:items-center">
{
website && slug ? (
<a href={slug} aria-label={`Link to ${title}`}
>
<Image
src={logo}
alt={`${title} Logo`}
style={{
minWidth: "140px",
maxHeight: "120px",
objectFit: "contain",
padding: logo_padding ? logo_padding : undefined,
}}
/>
</a>
):
<Image
src={logo}
alt={`${title} Logo`}
style={{
minWidth: "140px",
maxHeight: "120px",
objectFit: "contain",
padding: logo_padding ? logo_padding : undefined,
}}
/>
}
{ special_event && event_name &&
<span class="">{event_name}</span>
}
</div>
</div>