mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
#97 make package detail link work
This commit is contained in:
parent
e68a7a627a
commit
71c74a870f
2 changed files with 9 additions and 8 deletions
|
@ -17,13 +17,7 @@
|
|||
<ul class="grid grid-cols-3 border border-r-0 border-gray bg-black">
|
||||
{#each category.packages as pkg}
|
||||
<div class="border border-t-0 border-l-0 border-gray p-4">
|
||||
<MiniPackageCard
|
||||
{pkg}
|
||||
ctaLabel="DETAILS"
|
||||
onClickCTA={async () => {
|
||||
console.log('do something with:', pkg.full_name);
|
||||
}}
|
||||
/>
|
||||
<MiniPackageCard {pkg} ctaLabel="DETAILS" link={`/packages/${pkg.slug}`} />
|
||||
</div>
|
||||
{/each}
|
||||
</ul>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
export let pkg: Package;
|
||||
export let ctaLabel: string;
|
||||
export let link = '';
|
||||
|
||||
export let onClickCTA = () => {
|
||||
console.log('do nothing');
|
||||
|
@ -37,7 +38,13 @@
|
|||
>
|
||||
</p>
|
||||
</div>
|
||||
{#if link}
|
||||
<a href={link}>
|
||||
<button class="h-6 w-full font-machina text-xs">{ctaLabel}</button>
|
||||
</a>
|
||||
{:else}
|
||||
<button class="h-6 w-full font-machina text-xs" on:click={onClickCTA}>{ctaLabel}</button>
|
||||
{/if}
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
|
|
Loading…
Reference in a new issue