Description
In MilestonesList.tsx the statusColors map conveys Pending, Completed, Paid, and Disputed primarily through background color. Refactor these into a shared status badge token that pairs each status with an icon and consistent label so meaning does not rely on color alone. This badge can then be reused in ContractSummary.tsx.
Requirements and context
- Scoped to TalentTrust
Talenttrust-Frontend (Next.js App Router + TS + Tailwind). Align with milestone/contract/reputation flows and the backend API.
- Centralize status styling into a single
StatusBadge component consumed by lists and summaries.
- Verify contrast of every status variant meets AA against its background.
- Must be accessible (WCAG 2.1 AA), responsive, tested, and documented. Concrete acceptance criteria: each badge includes a non-color indicator.
Suggested execution
- Fork the repo and create a branch:
git checkout -b enhancement/status-badge-token
- Implement changes:
src/components/StatusBadge.tsx (real or new)
- Tests:
src/components/__tests__/StatusBadge.test.tsx (Jest + React Testing Library)
- Docs:
docs/components/StatusBadge.md
- Ensure keyboard nav, focus states, ARIA, color-contrast, and responsive breakpoints
Test and commit
- Run:
npm test, npm run lint, npm run build
- Cover edge cases (loading, empty, error, no-wallet, slow network, small screens)
- Include screenshots/notes and a11y check results in the PR
Example commit message
feat(ui): add icon-and-label status badge token
Guidelines
- Accessible (WCAG 2.1 AA), responsive, keyboard-navigable
- Minimum 95% coverage on new/changed component logic
- Clear documentation
- Timeframe: 96 hours from assignment
Description
In
MilestonesList.tsxthestatusColorsmap conveysPending,Completed,Paid, andDisputedprimarily through background color. Refactor these into a shared status badge token that pairs each status with an icon and consistent label so meaning does not rely on color alone. This badge can then be reused inContractSummary.tsx.Requirements and context
Talenttrust-Frontend(Next.js App Router + TS + Tailwind). Align with milestone/contract/reputation flows and the backend API.StatusBadgecomponent consumed by lists and summaries.Suggested execution
git checkout -b enhancement/status-badge-tokensrc/components/StatusBadge.tsx(real or new)src/components/__tests__/StatusBadge.test.tsx(Jest + React Testing Library)docs/components/StatusBadge.mdTest and commit
npm test,npm run lint,npm run buildExample commit message
Guidelines