Skip to content

Commit

Permalink
Fix issues in AddOnsNavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Apr 22, 2024
1 parent 89b1b81 commit 9153405
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/lib/components/addons/AddOnsNavigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@
<SidebarItem
active={active === "all"}
href="/app/add-ons"
--hover="var(--blue-2)"
--hover-background="var(--blue-2)"
>
<Infinity16 fill="var(--blue-3)" />
All
</SidebarItem>
<SidebarItem
active={active === "active"}
href="/app/add-ons?active=true"
--hover="var(--orange-light)"
--hover-background="var(--orange-light)"
>
<Pin --fill="var(--orange)" />
Pinned
</SidebarItem>
<SidebarItem
active={active === "featured"}
href="/app/add-ons?featured=true"
--hover="var(--yellow-light)"
--hover-background="var(--yellow-light)"
>
<StarFill16 fill="var(--yellow)" />
Featured
</SidebarItem>
<SidebarItem
active={active === "premium"}
href="/app/add-ons?premium=true"
--hover="var(--green-light)"
--hover-background="var(--green-light)"
>
<Premium --fill="var(--green)" />
Premium
Expand All @@ -54,7 +54,10 @@
<Flex direction="column">
<SidebarItem small --color="var(--gray-4)">Collections</SidebarItem>
{#each CATEGORIES as [key, label]}
<SidebarItem href={`/app/add-ons?category=${key}`}>
<SidebarItem
href={`/app/add-ons?category=${key}`}
active={active === key}
>
<!-- <Hash16 fill="var(--gray-4)" /> -->
{label}
</SidebarItem>
Expand Down
4 changes: 3 additions & 1 deletion src/routes/app/add-ons/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
$: active =
Array.from(($page.url as URL).searchParams.entries()).find(
([_, value]) => value === "true",
)?.[0] ?? "all";
)?.[0] ??
($page.url as URL).searchParams.get("category") ??
"all";
$: showTip = ["active", "featured", "premium"].includes(active);
$: query = ($page.url as URL).searchParams.get("query") ?? "";
Expand Down

0 comments on commit 9153405

Please sign in to comment.