Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ const Header = ({ color, hasBanner }) => {
<Banner
emoji={"🎉"}
description={`Join us for ${nextEvent.title}!`}
shortDescription={"Register now"}
shortDescription={nextEvent.title}
announcementLink={nextEvent.attend || ""}
cta="Register"
/>
</div>
)}
Expand Down
18 changes: 17 additions & 1 deletion src/components/ui/banner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Link } from "gatsby"
import * as React from "react"

const Banner = ({ description, shortDescription, emoji, announcementLink }) => {
const Banner = ({
description,
shortDescription,
emoji,
announcementLink,
cta,
}) => {
const isExternalLink =
announcementLink.indexOf("http://") === 0 ||
announcementLink.indexOf("https://") === 0
Expand Down Expand Up @@ -53,6 +59,16 @@ const Banner = ({ description, shortDescription, emoji, announcementLink }) => {
)}
</p>
</div>

{cta && announcementLink && (
<a
href={announcementLink}
target={isExternalLink ? "_blank" : undefined}
rel={isExternalLink ? "noopener noreferrer" : undefined}
className="ml-3 shrink-0 rounded-lg bg-night px-4 py-2 font-display font-bold uppercase tracking-wider text-sm text-white hover:bg-dark hover:text-white">
{cta}
</a>
)}
</div>
</div>
</div>
Expand Down
Loading