From a0d001c459b5a70bbdb12b4709fc173b47e81ed7 Mon Sep 17 00:00:00 2001 From: waterWang Date: Tue, 28 Jul 2026 18:50:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20improve=20color=20contrast=20to=20meet?= =?UTF-8?q?=20WCAG=20AA=20standards=20(text-slate-500=E2=86=92text-slate-6?= =?UTF-8?q?00=20on=20bg-slate-50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/bounties/[id]/BountyDetailClient.tsx | 6 ++-- apps/frontend/app/bounties/new/page.tsx | 2 +- .../app/components/BountyListClient.tsx | 2 +- .../app/components/SavedBountiesList.tsx | 6 ++-- apps/frontend/app/dashboard/page.tsx | 6 ++-- apps/frontend/app/error.tsx | 2 +- apps/frontend/app/not-found.tsx | 2 +- apps/frontend/app/page.tsx | 2 +- apps/frontend/components/StatusBadge.spec.tsx | 36 +++++++++++++++++++ 9 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 apps/frontend/components/StatusBadge.spec.tsx diff --git a/apps/frontend/app/bounties/[id]/BountyDetailClient.tsx b/apps/frontend/app/bounties/[id]/BountyDetailClient.tsx index 23642028..d1ddd8da 100644 --- a/apps/frontend/app/bounties/[id]/BountyDetailClient.tsx +++ b/apps/frontend/app/bounties/[id]/BountyDetailClient.tsx @@ -98,17 +98,17 @@ export default function BountyDetailClient({ bounty }: { bounty: Bounty }) {
-
Owner
+
Owner
{truncateAddress(bounty.ownerAddress)}
-
Reward
+
Reward
{bounty.reward}
-
Status
+
Status
{bounty.status}
diff --git a/apps/frontend/app/bounties/new/page.tsx b/apps/frontend/app/bounties/new/page.tsx index 1f38a003..56821298 100644 --- a/apps/frontend/app/bounties/new/page.tsx +++ b/apps/frontend/app/bounties/new/page.tsx @@ -231,7 +231,7 @@ export default function CreateBountyPage() { {description ? ( ) : ( -

Nothing to preview yet...

+

Nothing to preview yet...

)}
)} diff --git a/apps/frontend/app/components/BountyListClient.tsx b/apps/frontend/app/components/BountyListClient.tsx index cbd1c61e..91bb9469 100644 --- a/apps/frontend/app/components/BountyListClient.tsx +++ b/apps/frontend/app/components/BountyListClient.tsx @@ -105,7 +105,7 @@ export default function BountyListClient({ )} {cursor === null && bounties.length > 0 && ( -

+

You've reached the end — {bounties.length} of {initialTotal} bounties loaded.

)} diff --git a/apps/frontend/app/components/SavedBountiesList.tsx b/apps/frontend/app/components/SavedBountiesList.tsx index c5496f96..83acae9b 100644 --- a/apps/frontend/app/components/SavedBountiesList.tsx +++ b/apps/frontend/app/components/SavedBountiesList.tsx @@ -71,15 +71,15 @@ export default function SavedBountiesList() { ); if (loading) { - return

Loading saved bounties...

; + return

Loading saved bounties...

; } if (!publicKey) { - return

Connect your wallet to see saved bounties.

; + return

Connect your wallet to see saved bounties.

; } if (saved.length === 0) { - return

No saved bounties yet.

; + return

No saved bounties yet.

; } return ( diff --git a/apps/frontend/app/dashboard/page.tsx b/apps/frontend/app/dashboard/page.tsx index 872fcede..e224bff4 100644 --- a/apps/frontend/app/dashboard/page.tsx +++ b/apps/frontend/app/dashboard/page.tsx @@ -26,7 +26,7 @@ type Bounty = { function EmptyState({ message }: { message: string }) { return ( -
{message}
+
{message}
); } @@ -105,7 +105,7 @@ export default function DashboardPage() { ) : (
- + @@ -133,7 +133,7 @@ export default function DashboardPage() { ) : (
Bounty Submitted
- + diff --git a/apps/frontend/app/error.tsx b/apps/frontend/app/error.tsx index 6b5864b9..5e28ba6d 100644 --- a/apps/frontend/app/error.tsx +++ b/apps/frontend/app/error.tsx @@ -17,7 +17,7 @@ export default function ErrorPage({ error, reset }: ErrorPageProps) {

500

Something went wrong

-

+

{error.message || "An unexpected error occurred. Please try again."}

{error.digest && ( diff --git a/apps/frontend/app/not-found.tsx b/apps/frontend/app/not-found.tsx index 8262690e..f0a667e4 100644 --- a/apps/frontend/app/not-found.tsx +++ b/apps/frontend/app/not-found.tsx @@ -5,7 +5,7 @@ export default function NotFound() {

404

Page not found

-

+

The page you are looking for doesn't exist or has been moved.

{bounties.length} of{" "} {total} bounties

-

Scroll down to load more bounties automatically.

+

Scroll down to load more bounties automatically.

diff --git a/apps/frontend/components/StatusBadge.spec.tsx b/apps/frontend/components/StatusBadge.spec.tsx new file mode 100644 index 00000000..0d0c057e --- /dev/null +++ b/apps/frontend/components/StatusBadge.spec.tsx @@ -0,0 +1,36 @@ +import { render, screen } from "@testing-library/react"; +import { StatusBadge } from "./StatusBadge"; + +describe("StatusBadge", () => { + it("renders pending status", () => { + render(); + expect(screen.getByText("pending")).toBeInTheDocument(); + }); + + it("renders approved status", () => { + render(); + expect(screen.getByText("approved")).toBeInTheDocument(); + }); + + it("renders open status", () => { + render(); + expect(screen.getByText("open")).toBeInTheDocument(); + }); + + it("renders cancelled status with theme-aware classes", () => { + const { container } = render(); + const badge = container.firstChild; + expect(badge).toHaveClass("bg-slate-100"); + expect(badge).toHaveClass("text-slate-700"); + }); + + it("renders in_progress status with underscores replaced by spaces", () => { + render(); + expect(screen.getByText("in progress")).toBeInTheDocument(); + }); + + it("applies custom className", () => { + render(); + expect(screen.getByText("open")).toHaveClass("extra-class"); + }); +}); \ No newline at end of file
Title Reward