-
Notifications
You must be signed in to change notification settings - Fork 7
Use the shared formatStroops and formatNumber helpers on the stats page #67
Copy link
Copy link
Open
Labels
GRANTFOX OSSGrantFox open-source campaign taskGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignMay be rewarded under the GrantFox campaignOFFICIAL CAMPAIGNOfficial GrantFox campaign issueOfficial GrantFox campaign issuearea:formattingformattingformattingpriority:lowLow priorityLow prioritystack:nextjsNext.jsNext.jsstack:reactReactReactstack:typescriptTypeScriptTypeScripttype:refactorRefactor without behavior changeRefactor without behavior change
Description
Metadata
Metadata
Assignees
Labels
GRANTFOX OSSGrantFox open-source campaign taskGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignMay be rewarded under the GrantFox campaignOFFICIAL CAMPAIGNOfficial GrantFox campaign issueOfficial GrantFox campaign issuearea:formattingformattingformattingpriority:lowLow priorityLow prioritystack:nextjsNext.jsNext.jsstack:reactReactReactstack:typescriptTypeScriptTypeScripttype:refactorRefactor without behavior changeRefactor without behavior change
Type
Fields
Give feedbackNo fields configured for Feature.
Wire the unused format helpers into the stats display
Description
src/lib/format.tsexportsformatStroops,formatNumber, andformatTime, with unit tests insrc/lib/__tests__/format.test.ts— but no page imports them. Meanwhilesrc/app/stats/page.tsxrenders{stats.totalPairs}as a raw number with no thousands separators. This issue puts the shared formatters to use so large counts and any stroop amounts read correctly.Requirements and context
stats.totalPairsthroughformatNumberso counts get locale thousands separators.formatStroops; otherwise document the helper as ready for that field.src/components/StatTile.tsxfor the tiles (currently the page hand-rollsdl/divmarkup) so formatting and layout are centralized.Statstype semantics or the fetch endpoint.Suggested execution
git checkout -b refactor/formatting-10-stats-formatterssrc/app/stats/page.tsximporting fromsrc/lib/format.tsand usingsrc/components/StatTile.tsx.src/app/stats/page.test.tsxasserting formatted output.README.md.format.test.tsexpectations.Test and commit
npm run lint,npm test, andnpm run build.npm testoutput in the PR description.Example commit message
refactor: render stats through shared format helpers and StatTileGuidelines
Community & contribution rewards