Skip to content

Commit

Permalink
feat: Add CTA support for event cards (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharamveergit authored Jan 27, 2025
1 parent fd941d6 commit 8472bff
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/components/community-pages/event-card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ interface Props {
description: string;
link: string;
tbd: boolean;
cta?: {
text: string;
link: string;
}[];
};
}
Expand Down Expand Up @@ -50,15 +54,19 @@ const { card } = Astro.props;
>
{card.description}{" "}
</p>

<ButtonLink
variant="secondary"
size="xs"
link={card.link}
className="mt-10"
>
<ArrowUpCircle className="w-4 rotate-45 text-para" />
Read More
</ButtonLink>
<div class="mt-10 flex items-center gap-2">
<ButtonLink variant="secondary" size="xs" link={card.link}>
<ArrowUpCircle className="w-4 rotate-45 text-para" />
Read More
</ButtonLink>
{
card?.cta?.map((cta) => (
<ButtonLink variant="secondary" size="xs" link={cta.link}>
<ArrowUpCircle className="w-4 rotate-45 text-para" />
{cta.text}
</ButtonLink>
))
}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ eventDate: "2025-02-27"
location: Denver
link: "https://www.ethdenver.com/"
description: "ETHDenver is an annual conference focused on blockchain technology, Ethereum development, and decentralized innovation. It brings together developers, entrepreneurs, and thought leaders to collaborate, learn, and shape the future of the decentralized web."
cta:
- text: "Akash Side Event"
link: "https://lu.ma/akashethdenver2025"
---
8 changes: 8 additions & 0 deletions src/utils/schema/communityContributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export const communityEventSchema = defineCollection({
location: z.string(),
description: z.string(),
tags: z.array(z.string()).optional(),
cta: z
.array(
z.object({
text: z.string(),
link: z.string(),
}),
)
.optional(),
});
},
});

0 comments on commit 8472bff

Please sign in to comment.