Skip to content

Commit

Permalink
feat: add external link url to buy ticket button
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshenrik committed Nov 27, 2024
1 parent 7c5b3f0 commit 1b0751a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/BuyTicketsButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
export interface Props {
class?: string;
isFree?: boolean;
externalTicketUrl?: string;
}
const { class: extraClasses = "", isFree } = Astro.props;
const { class: extraClasses = "", isFree, externalTicketUrl } = Astro.props;
---

<a
class={`block py-4 px-4 text-center bg-red text-beige rounded-lg text-sm md:text-xl duration-500 font-display
transition-all shadow-solid -translate-y-1 hover:translate-x-1 hover:-translate-y-2 hover:shadow-solid-hover ${extraClasses}`}
href="https://tikkio.com/tickets/52576-mandaljazz-2025"
href={externalTicketUrl ?? "https://tikkio.com/tickets/52576-mandaljazz-2025"}
rel="noopener nofollow"
target="_blank">{isFree ? "Reserver gratisbillett" : "Kjøp billetter"}</a
>
4 changes: 3 additions & 1 deletion src/layouts/ArtistLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const {
sponsoredByBergesenstiftelsen,
isFree,
requiresFreeTicket,
externalTicketUrl,
},
} = Astro.props;
Expand All @@ -57,6 +58,7 @@ export type ArtistProps = {
isFree?: boolean;
isPlaceholder?: boolean;
requiresFreeTicket?: boolean;
externalTicketUrl?: string;
order?: string;
};
};
Expand Down Expand Up @@ -197,7 +199,7 @@ const image = imageType ? `${id}.${imageType}` : `${id}.jpg`;
)
}
<div class="flex flex-row justify-between">
{!isFree && <BuyTicketsButton class="flex-0 h-fit w-fit" />}
{!isFree && <BuyTicketsButton class="flex-0 h-fit w-fit" externalTicketUrl={externalTicketUrl} />}
{
isFree && requiresFreeTicket && (
<BuyTicketsButton class="flex-0 h-fit w-fit" isFree />
Expand Down
1 change: 1 addition & 0 deletions src/pages/artist/maria-kannegaard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ hideFromProgram: true # true hvis den skal skjules fra programsiden, false hvis
hideFromArtistList: false # true hvis den skal skjules fra forsiden, false hvis den skal vises
isFree: false # true hvis den er gratis, false hvis ikke
requiresFreeTicket: false # true hvis konserten er gratis, men krever gratisbillett
externalTicketUrl: https://checkout.ebillett.no/202/events/86112/purchase/setup
isPlaceholder: false
order: 1 # Rekkefølgen på forsiden. Høyere er bedre.
---
Expand Down

0 comments on commit 1b0751a

Please sign in to comment.