From 277f6f0fe8cc42dd3fd4730c9147b1457bfdc293 Mon Sep 17 00:00:00 2001 From: ryzen-xp Date: Sat, 27 Jun 2026 11:44:01 +0530 Subject: [PATCH 1/3] fix(navbar): wire MobileNavMenu onClose --- .../reputation/__tests__/my-claims.test.ts | 77 ++++++++++++------- components/ui/resizable-navbar.tsx | 21 +++-- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/components/reputation/__tests__/my-claims.test.ts b/components/reputation/__tests__/my-claims.test.ts index 92d60223..945d90f7 100644 --- a/components/reputation/__tests__/my-claims.test.ts +++ b/components/reputation/__tests__/my-claims.test.ts @@ -1,37 +1,58 @@ -import { CLAIM_SECTIONS, getClaimsBySection, normalizeStatus, type MyClaim } from "@/components/reputation/my-claims"; -import { describe, expect, it } from "@jest/globals"; +import { + CLAIM_SECTIONS, + getClaimsBySection, + normalizeStatus, + type MyClaim, +} from "@/components/reputation/my-claims"; describe("My Claims helpers", () => { - it("normalizes status values consistently", () => { - expect(normalizeStatus(" In Review ")).toBe("in-review"); - expect(normalizeStatus("UNDER_REVIEW")).toBe("under-review"); - expect(normalizeStatus("in_review")).toBe("in-review"); - }); + it("normalizes status values consistently", () => { + expect(normalizeStatus(" In Review ")).toBe("in-review"); + expect(normalizeStatus("UNDER_REVIEW")).toBe("under-review"); + expect(normalizeStatus("in_review")).toBe("in-review"); + }); - it("groups claims into Active Claims, In Review, and Completed by status", () => { - const claims: MyClaim[] = [ - { bountyId: "1", title: "Active A", status: "active" }, - { bountyId: "2", title: "Active B", status: "claimed" }, - { bountyId: "3", title: "Review A", status: "in review" }, - { bountyId: "4", title: "Review B", status: "UNDER_REVIEW" }, - { bountyId: "5", title: "Completed A", status: "completed" }, - { bountyId: "6", title: "Completed B", status: "closed" }, - { bountyId: "7", title: "Unknown", status: "queued" }, - ]; + it("groups claims into Active Claims, In Review, and Completed by status", () => { + const claims: MyClaim[] = [ + { bountyId: "1", title: "Active A", status: "active" }, + { bountyId: "2", title: "Active B", status: "claimed" }, + { bountyId: "3", title: "Review A", status: "in review" }, + { bountyId: "4", title: "Review B", status: "UNDER_REVIEW" }, + { bountyId: "5", title: "Completed A", status: "completed" }, + { bountyId: "6", title: "Completed B", status: "closed" }, + { bountyId: "7", title: "Unknown", status: "queued" }, + ]; - const groups = getClaimsBySection(claims); + const groups = getClaimsBySection(claims); - expect(groups).toHaveLength(CLAIM_SECTIONS.length); + expect(groups).toHaveLength(CLAIM_SECTIONS.length); - const activeGroup = groups.find((group) => group.section.title === "Active Claims"); - const reviewGroup = groups.find((group) => group.section.title === "In Review"); - const completedGroup = groups.find((group) => group.section.title === "Completed"); + const activeGroup = groups.find( + (group) => group.section.title === "Active Claims", + ); + const reviewGroup = groups.find( + (group) => group.section.title === "In Review", + ); + const completedGroup = groups.find( + (group) => group.section.title === "Completed", + ); - expect(activeGroup?.claims.map((claim) => claim.bountyId)).toEqual(["1", "2"]); - expect(reviewGroup?.claims.map((claim) => claim.bountyId)).toEqual(["3", "4"]); - expect(completedGroup?.claims.map((claim) => claim.bountyId)).toEqual(["5", "6"]); + expect(activeGroup?.claims.map((claim) => claim.bountyId)).toEqual([ + "1", + "2", + ]); + expect(reviewGroup?.claims.map((claim) => claim.bountyId)).toEqual([ + "3", + "4", + ]); + expect(completedGroup?.claims.map((claim) => claim.bountyId)).toEqual([ + "5", + "6", + ]); - const groupedIds = new Set(groups.flatMap((group) => group.claims.map((claim) => claim.bountyId))); - expect(groupedIds.has("7")).toBe(false); - }); + const groupedIds = new Set( + groups.flatMap((group) => group.claims.map((claim) => claim.bountyId)), + ); + expect(groupedIds.has("7")).toBe(false); + }); }); diff --git a/components/ui/resizable-navbar.tsx b/components/ui/resizable-navbar.tsx index 90775341..6f5cbe10 100644 --- a/components/ui/resizable-navbar.tsx +++ b/components/ui/resizable-navbar.tsx @@ -75,9 +75,9 @@ export const Navbar = ({ children, className }: NavbarProps) => { {React.Children.map(children, (child) => React.isValidElement(child) ? React.cloneElement( - child as React.ReactElement<{ visible?: boolean }>, - { visible }, - ) + child as React.ReactElement<{ visible?: boolean }>, + { visible }, + ) : child, )} @@ -196,7 +196,6 @@ export const MobileNavMenu = ({ children, className, isOpen, - // eslint-disable-next-line @typescript-eslint/no-unused-vars onClose, }: MobileNavMenuProps) => { return ( @@ -211,6 +210,14 @@ export const MobileNavMenu = ({ className, )} > + {children} )} @@ -263,9 +270,9 @@ export const NavbarButton = ({ className?: string; variant?: "primary" | "secondary" | "dark" | "gradient"; } & ( - | React.ComponentPropsWithoutRef<"a"> - | React.ComponentPropsWithoutRef<"button"> - )) => { + | React.ComponentPropsWithoutRef<"a"> + | React.ComponentPropsWithoutRef<"button"> +)) => { const baseStyles = "px-4 py-2 rounded-md bg-white button bg-white text-black text-sm font-bold relative cursor-pointer hover:-translate-y-0.5 transition duration-200 inline-block text-center"; From 7bb0f07175a4e4c6fe615719d16c4ab4f818fcb2 Mon Sep 17 00:00:00 2001 From: ryzen-xp Date: Sun, 28 Jun 2026 10:56:09 +0530 Subject: [PATCH 2/3] fix: resizable nacbar css --- components/ui/resizable-navbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ui/resizable-navbar.tsx b/components/ui/resizable-navbar.tsx index 6f5cbe10..c9e6e506 100644 --- a/components/ui/resizable-navbar.tsx +++ b/components/ui/resizable-navbar.tsx @@ -214,7 +214,7 @@ export const MobileNavMenu = ({ type="button" aria-label="Close mobile menu" onClick={onClose} - className="ml-auto inline-flex h-9 w-9 items-center justify-center rounded-full text-black transition hover:bg-gray-100 dark:text-white dark:hover:bg-neutral-800" + className="self-end inline-flex h-9 w-9 items-center justify-center rounded-full text-black transition hover:bg-gray-100 dark:text-white dark:hover:bg-neutral-800" > From b68f941b71ceb1d72dc0c0077a1acd9dc677f41d Mon Sep 17 00:00:00 2001 From: Benjtalkshow Date: Sun, 28 Jun 2026 13:15:49 +0100 Subject: [PATCH 3/3] chore: drop unrelated reformatting from this PR Revert the 4-space to 2-space reformatting in my-claims.test.ts and the Navbar/NavbarButton indentation changes in resizable-navbar.tsx. Only the close button wiring and the eslint-disable removal belong in this PR. --- components/reputation/__tests__/my-claims.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/reputation/__tests__/my-claims.test.ts b/components/reputation/__tests__/my-claims.test.ts index 3609f309..945d90f7 100644 --- a/components/reputation/__tests__/my-claims.test.ts +++ b/components/reputation/__tests__/my-claims.test.ts @@ -1,4 +1,9 @@ -import { CLAIM_SECTIONS, getClaimsBySection, normalizeStatus, type MyClaim } from "@/components/reputation/my-claims"; +import { + CLAIM_SECTIONS, + getClaimsBySection, + normalizeStatus, + type MyClaim, +} from "@/components/reputation/my-claims"; describe("My Claims helpers", () => { it("normalizes status values consistently", () => {