Skip to content

Commit 3f82ffd

Browse files
committed
feat(ui): add Devpost buttons to hackathon index and detail pages
1 parent e384ce2 commit 3f82ffd

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

src/pages/hackathons/[slug].astro

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,29 @@ const { Content } = allHackathonContent[matchingPath];
4343
<div class="columns is-centered">
4444
<div class="column is-two-thirds">
4545

46-
<!-- Registration CTA Box -->
47-
{hackathon.status === 'upcoming' && (
48-
<div class="notification is-warning is-light has-text-centered mb-6">
49-
<h3 class="title is-4">Registration Open!</h3>
50-
<p class="mb-4">Secure your spot via Rubric.</p>
51-
<a href={hackathon.rubricLink} target="_blank" class="button is-dark is-medium">
52-
<strong>Register Now</strong>
53-
<span class="icon ml-2"><i class="fa-solid fa-arrow-right"></i></span>
54-
</a>
46+
<!-- Action Buttons Box -->
47+
{(hackathon.status === 'upcoming' || hackathon.devpostLink) && (
48+
<div class="notification is-light has-text-centered mb-6">
49+
<h3 class="title is-4">Event Actions</h3>
50+
<div class="buttons is-centered">
51+
<!-- Rubric Registration (Only if upcoming) -->
52+
{hackathon.status === 'upcoming' && (
53+
<a href={hackathon.rubricLink} target="_blank" rel="noopener noreferrer" class="button is-warning is-medium">
54+
<strong>Register on Rubric</strong>
55+
<span class="icon ml-2"><i class="fa-solid fa-ticket"></i></span>
56+
</a>
57+
)}
58+
59+
<!-- Devpost Link (Always visible if link exists) -->
60+
{hackathon.devpostLink && (
61+
<a href={hackathon.devpostLink} target="_blank" rel="noopener noreferrer" class="button is-link is-medium">
62+
<strong>View on Devpost</strong>
63+
<span class="icon ml-2"><i class="fa-solid fa-code"></i></span>
64+
</a>
65+
)}
66+
</div>
5567
</div>
5668
)}
57-
5869
<!-- Main Markdown Content -->
5970
<div class="content is-medium">
6071
<Content />

src/pages/hackathons/index.astro

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
<div class="buttons"> ---
22
import Layout from '@layouts/Default.astro'
33
import data from '@data/hackathons.json'
44

@@ -44,19 +44,26 @@ const hackathons = data.hackathons
4444
</p>
4545
<p>{hackathon.summary}</p>
4646

47-
<div class="buttons">
47+
<div class="buttons">
4848
<a href={`/hackathons/${hackathon.slug}`} class="button is-primary">
4949
<span>Event Details</span>
5050
</a>
51+
52+
{/* NEW: Devpost Button */}
53+
{hackathon.devpostLink && (
54+
<a href={hackathon.devpostLink} class="button is-link is-outlined" target="_blank" rel="noopener noreferrer">
55+
<span>Devpost</span>
56+
<span class="icon is-small"><i class="fa-solid fa-code"></i></span>
57+
</a>
58+
)}
59+
5160
{hackathon.status === 'upcoming' && (
52-
<a href={hackathon.rubricLink} class="button is-warning" target="_blank">
61+
<a href={hackathon.rubricLink} class="button is-warning" target="_blank" rel="noopener noreferrer">
5362
<span>Register on Rubric</span>
5463
<span class="icon is-small"><i class="fa-solid fa-external-link-alt"></i></span>
5564
</a>
5665
)}
57-
</div>
58-
</div>
59-
</div>
66+
</div> </div>
6067
</article>
6168
</div>
6269
))}

0 commit comments

Comments
 (0)