fix(display): cadence-aware contribution suffix across UI + admin dashboard
Add formatContribution helper in app/config/contributions.js and route all member-facing and admin contribution displays through cadence-aware expressions so annual members see /yr instead of /mo. Normalize annual amounts to monthly equivalents in the admin dashboard revenue aggregate now that contributionAmount is stored in cadence units.
This commit is contained in:
parent
5023fb14ad
commit
0dd68ff1aa
6 changed files with 29 additions and 12 deletions
|
|
@ -20,3 +20,12 @@ export const getGuidanceLabel = (amount) => {
|
|||
const match = CONTRIBUTION_PRESETS.findLast(p => p.amount <= n)
|
||||
return match?.label ?? null
|
||||
}
|
||||
|
||||
// Format a contribution amount with cadence-aware suffix.
|
||||
// amount is interpreted in cadence units (e.g. 180 + 'annual' → "$180/yr").
|
||||
export const formatContribution = (amount, cadence) => {
|
||||
const n = Number(amount) || 0
|
||||
if (n === 0) return '$0'
|
||||
const suffix = cadence === 'annual' ? '/yr' : '/mo'
|
||||
return `$${n}${suffix}`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue