Skip to content

Add amount token formatter component#1032

Open
220nightmore-spec wants to merge 1 commit into
FinesseStudioLab:mainfrom
220nightmore-spec:feature/amount-formatter-977
Open

Add amount token formatter component#1032
220nightmore-spec wants to merge 1 commit into
FinesseStudioLab:mainfrom
220nightmore-spec:feature/amount-formatter-977

Conversation

@220nightmore-spec

Copy link
Copy Markdown

Summary

  • add a reusable AmountFormatter design-system component
  • support locale-aware number formatting, token symbols, raw token scaling, compact notation, signed values, empty-value fallbacks, and tone classes
  • wire CampaignCard reward display through the formatter
  • add Vitest coverage and Storybook stories for the component

Validation

  • node node_modules/vitest/vitest.mjs run src/components/AmountFormatter.test.jsx --config vitest.no-setup.config.mjs (temporary no-setup config; 6 tests passed)
  • node node_modules/eslint/bin/eslint.js src/components/AmountFormatter.jsx src/components/AmountFormatter.test.jsx src/components/CampaignCard.jsx src/stories/AmountFormatter.stories.jsx src/lib/amountFormatter.js
  • git diff --check

Notes

The repository's default frontend Vitest setup currently imports @testing-library/jest-dom, but that package is not declared in frontend/package.json. The main Vite/Storybook builds are also blocked by existing dependency/build configuration issues (workbox-window / PWA plugin resolution). This PR keeps the component scope focused and does not change unrelated dependencies.

Closes #977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design system: Amount / token formatter component

1 participant