Skip to content

Commit

Permalink
Styling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Apr 19, 2024
1 parent 5e1c3ee commit 71d326e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 28 deletions.
2 changes: 2 additions & 0 deletions src/lib/components/ContentLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
width: 100%;
position: sticky;
top: 0;
z-index: 2;
padding: 0.625rem;
}
main {
Expand All @@ -44,6 +45,7 @@
width: 100%;
position: sticky;
bottom: 0;
z-index: 2;
padding: 0.625rem;
}
</style>
66 changes: 38 additions & 28 deletions src/routes/app/add-ons/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
Array.from(($page.url as URL).searchParams.entries()).find(
([_, value]) => value === "true",
)?.[0] ?? "all";
$: showTip = ["active", "featured", "premium"].includes(active);
$: query = ($page.url as URL).searchParams.get("query") ?? "";
</script>
Expand All @@ -61,34 +62,37 @@
<PageToolbar slot="header">
<Search name="query" {query} on:submit={search} slot="center" />
</PageToolbar>

{#if active === "active"}
<Tip
--background-color="var(--orange-light)"
--border-color="var(--orange)"
--fill="var(--orange-dark)"
>
<Pin size={1.75} slot="icon" />
{$_("addonBrowserDialog.pinnedTip")}
</Tip>
{:else if active === "featured"}
<Tip
--background-color="var(--yellow-light)"
--border-color="var(--yellow)"
--fill="var(--yellow-dark)"
>
<Star size={1.75} slot="icon" />
{$_("addonBrowserDialog.featuredTip")}
</Tip>
{:else if active === "premium"}
<Tip
--background-color="var(--green-light)"
--border-color="var(--green)"
--fill="var(--green-dark)"
>
<Premium size={1.75} slot="icon" />
{$_("addonBrowserDialog.premiumTip")}
</Tip>
{#if showTip}
<div class="tip">
{#if active === "active"}
<Tip
--background-color="var(--orange-light)"
--border-color="var(--orange)"
--fill="var(--orange-dark)"
>
<Pin size={1.75} slot="icon" />
{$_("addonBrowserDialog.pinnedTip")}
</Tip>
{:else if active === "featured"}
<Tip
--background-color="var(--yellow-light)"
--border-color="var(--yellow)"
--fill="var(--yellow-dark)"
>
<Star size={1.75} slot="icon" />
{$_("addonBrowserDialog.featuredTip")}
</Tip>
{:else if active === "premium"}
<Tip
--background-color="var(--green-light)"
--border-color="var(--green)"
--fill="var(--green-dark)"
>
<Premium size={1.75} slot="icon" />
{$_("addonBrowserDialog.premiumTip")}
</Tip>
{/if}
</div>
{/if}
{#await data.addons}
<Empty icon={Hourglass24}>Loading…</Empty>
Expand Down Expand Up @@ -119,3 +123,9 @@
</ContentLayout>
</svelte:fragment>
</MainLayout>

<style>
.tip {
margin: 1rem;
}
</style>

0 comments on commit 71d326e

Please sign in to comment.