mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-19 06:24:20 +01:00
problem: product layour is shitty
This commit is contained in:
@@ -10,16 +10,47 @@
|
|||||||
export let event: NDKEvent;
|
export let event: NDKEvent;
|
||||||
//$page.url.searchParams.get("tab")
|
//$page.url.searchParams.get("tab")
|
||||||
|
|
||||||
|
function validate(event: NDKEvent): boolean {
|
||||||
|
let test = 0;
|
||||||
|
if (
|
||||||
|
event.getMatchingTags('name') &&
|
||||||
|
event.getMatchingTags('name')[0] &&
|
||||||
|
event.getMatchingTags('name')[0][1]
|
||||||
|
) {
|
||||||
|
test++;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
event.getMatchingTags('description') &&
|
||||||
|
event.getMatchingTags('description')[0] &&
|
||||||
|
event.getMatchingTags('description')[0][1]
|
||||||
|
) {
|
||||||
|
test++;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
event.getMatchingTags('cover') &&
|
||||||
|
event.getMatchingTags('cover')[0] &&
|
||||||
|
event.getMatchingTags('cover')[0][1]
|
||||||
|
) {
|
||||||
|
test++;
|
||||||
|
}
|
||||||
|
return test == 3;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card.Root class="w-[350px]">
|
{#if validate(event)}
|
||||||
|
<Card.Root class="w-[350px] m-2">
|
||||||
<Card.Header>
|
<Card.Header>
|
||||||
<Card.Title>{event.getMatchingTags('name')[0][1]}</Card.Title>
|
<Card.Title>{event.getMatchingTags('name')[0][1]}</Card.Title>
|
||||||
<Card.Description>{getMission(event)}</Card.Description>
|
<Card.Description>{event.getMatchingTags('description')[0][1]}</Card.Description>
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
|
<img src={event.getMatchingTags('cover')[0][1]} />
|
||||||
<Card.Content></Card.Content>
|
<Card.Content></Card.Content>
|
||||||
<Card.Footer class="flex justify-between">
|
<Card.Footer class="flex justify-between">
|
||||||
<Button on:click={()=>{console.log(event.rawEvent())}} variant="outline">Print to Console</Button>
|
<Button
|
||||||
<Button on:click={()=>{goto(`${base}/rockets/${getRocketURL(event)}`)}}>View Full Rocket<ChevronRight class="h-4 w-4" /></Button>
|
on:click={() => {
|
||||||
|
goto(`${base}/rockets/${getRocketURL(event)}`);
|
||||||
|
}}>Make Available to Purchase<ChevronRight class="h-4 w-4" /></Button
|
||||||
|
>
|
||||||
</Card.Footer>
|
</Card.Footer>
|
||||||
</Card.Root>
|
</Card.Root>
|
||||||
|
{/if}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
{#if candidateProducts && $candidateProducts}
|
{#if candidateProducts && $candidateProducts}
|
||||||
<Subheading title="Products" />
|
<Subheading title="Product Candidates" />
|
||||||
<CreateNewProduct rocketEvent={$latestRocketEvent} />
|
<CreateNewProduct rocketEvent={$latestRocketEvent} />
|
||||||
{#each $candidateProducts as r}<ProductCard event={r} />{/each}
|
{#each $candidateProducts as r}<ProductCard event={r} />{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user