Problem
Campaign status values are inconsistent throughout the codebase — mixed case, different naming conventions, and redundant checks. This causes rendering bugs where some status-dependent UI doesn't show correctly.
Examples of Inconsistency
- ProjectSidebarActions: checks `'CAMPAIGNING'`, `'campaigning'`, `'LIVE'`, `'live'`, `'VOTING'`, `'Funding'`, `'Validation'`
- ProjectSidebarProgress: uses `'CAMPAIGNING'` and `'campaigning'`
- project-milestone/index.tsx: checks `'LIVE'`, `'FUNDED'`, `'EXECUTING'`, plus `trustlessWorkStatus === 'funded'`
- utils.ts: maps `'IDEA'` → Validation, `'LIVE'` → Live, lowercase variants too
- canCancel logic checks 6 different status strings
Expected Behavior
- Create a single `CampaignStatus` enum in `features/projects/types/`:
enum CampaignStatus {
IDEA = 'IDEA',
REVIEWING = 'REVIEWING',
VOTING = 'VOTING',
CAMPAIGNING = 'CAMPAIGNING',
FUNDED = 'FUNDED',
EXECUTING = 'EXECUTING',
LIVE = 'LIVE',
COMPLETED = 'COMPLETED',
FAILED = 'FAILED',
CANCELLED = 'CANCELLED',
}
- Add a normalizer function that maps API response values to the enum
- Replace all hardcoded string comparisons with enum references
- Update status mapping utils to use the enum
Acceptance Criteria
Priority
High — This is causing subtle rendering bugs today.
Labels
crowdfunding, tech-debt, bug
Problem
Campaign status values are inconsistent throughout the codebase — mixed case, different naming conventions, and redundant checks. This causes rendering bugs where some status-dependent UI doesn't show correctly.
Examples of Inconsistency
Expected Behavior
Acceptance Criteria
Priority
High — This is causing subtle rendering bugs today.
Labels
crowdfunding,tech-debt,bug