Skip to content

Commit

Permalink
feat: reuse creative prize table on esport
Browse files Browse the repository at this point in the history
  • Loading branch information
niccofyren committed Oct 21, 2024
1 parent fb76b6f commit b587d66
Showing 1 changed file with 32 additions and 19 deletions.
51 changes: 32 additions & 19 deletions src/components/competitions/SportsBox.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,43 @@ const formattedPrizes = prizes.map((prize) =>
);
---

<section class={classNames}>
{
hasPills && (
<div class="flex flex-row justify-end gap-2 mb-4">
{byoc && <Pill text="Egen maskin" color="orange" />}
{requiresTicket && <Pill text="I skipet" color="blue" />}
</div>
)
}
<H2 text={title} color="" class="mt-4" />
<slot />
<section class={`flex flex-col ${classNames}`}>
<div>
{
hasPills && (
<div class="flex flex-row justify-end gap-2 mb-4">
{byoc && <Pill text="Egen maskin" color="orange" />}
{requiresTicket && <Pill text="I skipet" color="blue" />}
</div>
)
}
<H2 text={title} color="" class="mt-4" />
<slot />
</div>
{
formattedPrizes.length ? (
<>
<H3 class="mt-4" color="">
<div class="mt-4 last:mt-auto">
<H3 class="mt-0 text-lg" color="">
Premipotten
</H3>
<ol>
{formattedPrizes.map((p) => (
<li>{p}</li>
<dl class="divide-y divide-black/50 not-prose">
{formattedPrizes.map((prize, index) => (
<div class="px-2 py-1 grid grid-cols-3 sm:gap-2 sm:px-0">
<dt class="text-sm font-bold leading-4">
{`${index + 1}. plass`}
</dt>
<dd class="mt-1 text-sm leading-4 col-span-2 sm:mt-0">{prize}</dd>
</div>
))}
</ol>
</>
</dl>
</div>
) : null
}
{url && <button class={buttonClassNames}>Les mer</button>}
{
url && (
<div class="last:pt-4 last:mt-auto w-full">
<button class={buttonClassNames}>Les mer</button>
</div>
)
}
</section>

0 comments on commit b587d66

Please sign in to comment.