Skip to content

Commit

Permalink
fix: Skip top-level redirects in main nav (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker authored Oct 27, 2024
1 parent 106b38d commit 8ff044b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-geese-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"namesake": patch
---

Skip top-level redirects in main nav
6 changes: 3 additions & 3 deletions src/components/AppHeader/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export const AppHeader = () => {

return (
<div className="flex shrink-0 gap-4 bg-gray-app items-center w-screen h-14 px-4 border-b border-gray-dim sticky top-0 z-20">
<Link href={{ to: "/" }}>
<Link href={{ to: "/quests" }}>
<Logo className="h-[1.25rem]" />
</Link>
<Authenticated>
{isAdmin && <Link href={{ to: "/admin" }}>Admin</Link>}
{isAdmin && <Link href={{ to: "/admin/quests" }}>Admin</Link>}
<div className="ml-auto">
<MenuTrigger>
<Button
Expand All @@ -33,7 +33,7 @@ export const AppHeader = () => {
icon={RiAccountCircleFill}
/>
<Menu>
<MenuItem href={{ to: "/settings" }}>Settings</MenuItem>
<MenuItem href={{ to: "/settings/overview" }}>Settings</MenuItem>
<MenuItem
href="https://namesake.fyi/chat"
target="_blank"
Expand Down
57 changes: 30 additions & 27 deletions src/routes/_authenticated/quests/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,34 +195,37 @@ function IndexRoute() {
valueLabel={`${completedQuests} of ${totalQuests}`}
className="mr-4"
/>
<MenuTrigger>
<Button icon={RiMoreFill} variant="icon" />
<Menu>
<MenuItem
onAction={() => setSortBy("newest")}
isDisabled={sortBy === "newest"}
>
Sort by newest
</MenuItem>
<MenuItem
onAction={() => setSortBy("oldest")}
isDisabled={sortBy === "oldest"}
>
Sort by oldest
</MenuItem>
<TooltipTrigger>
<MenuTrigger>
<Button icon={RiMoreFill} variant="icon" />
<Menu>
<MenuItem
onAction={() => setSortBy("newest")}
isDisabled={sortBy === "newest"}
>
Sort by newest
</MenuItem>
<MenuItem
onAction={() => setSortBy("oldest")}
isDisabled={sortBy === "oldest"}
>
Sort by oldest
</MenuItem>

{typeof completedQuests === "number" && completedQuests > 0 && (
<>
<MenuSeparator />
<MenuItem onAction={toggleShowCompleted}>
{showCompleted
? `Hide ${completedQuests} completed ${completedQuests > 1 ? "quests" : "quest"}`
: `Show ${completedQuests} completed ${completedQuests > 1 ? "quests" : "quest"}`}
</MenuItem>
</>
)}
</Menu>
</MenuTrigger>
{typeof completedQuests === "number" && completedQuests > 0 && (
<>
<MenuSeparator />
<MenuItem onAction={toggleShowCompleted}>
{showCompleted
? `Hide ${completedQuests} completed ${completedQuests > 1 ? "quests" : "quest"}`
: `Show ${completedQuests} completed ${completedQuests > 1 ? "quests" : "quest"}`}
</MenuItem>
</>
)}
</Menu>
</MenuTrigger>
<Tooltip>Sort and filter</Tooltip>
</TooltipTrigger>
<TooltipTrigger>
<Button
aria-label="Add quest"
Expand Down

0 comments on commit 8ff044b

Please sign in to comment.