Components•Diff review
src/billing/plan-label.ts
+4 −50 of 3 resolved
export function planLabel(plan: Plan) {
Change 1−2 +2
Removed: if (plan.interval == "year") {
Removed: return plan.name + " (yearly)";
Added: if (plan.interval === "year") {
Added: return `${plan.name} (billed yearly)`;
}
return plan.name;
}
export function monthlyPrice(plan: Plan): number {
Change 2−2 +1
Removed: // TODO: handle yearly plans
Removed: return plan.price;
Added: return plan.interval === "year" ? plan.price / 12 : plan.price;
}
export function priceLine(plan: Plan, locale: string) {
const amount = monthlyPrice(plan);
Change 3−1 +1
Removed: return formatPrice(amount, "USD") + " / month";
Added: return `${formatPrice(amount, plan.currency, locale)} / month`;
}
Focus a change, then j / k to move, a / r to decide
Options