Conversation
- Updates to the style, which removes the brand color as it was diluted and made it look bad. - Added a monthly/yearly toggle to the builder, and this only shows in the builder
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds an optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Modal
participant Preview
participant Block
participant Calc
User->>Modal: Toggle billingPeriod (monthly/yearly)
Modal->>Modal: Update RHF form value (billingPeriod)
Modal->>Preview: Re-render with billingPeriod in block data
Preview->>Block: Pass block data (includes billingPeriod)
Block->>Calc: Determine isYearly from billingPeriod
Calc->>Calc: Compute monthlyEarnings (flat or percentage)
alt isYearly
Calc->>Calc: displayEarnings = monthlyEarnings * 12
else
Calc->>Calc: displayEarnings = monthlyEarnings
end
Calc->>Block: Return displayEarnings
Block->>User: Render earnings, slider, and period suffix (/mo or /yr)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx (1)
35-68:⚠️ Potential issue | 🟡 MinorYearly calculation is floored too early.
Flooring monthly before multiplying by 12 can undercount yearly totals when monthly has cents. Consider rounding after the period calculation.🔧 Proposed fix (round after period selection)
- const monthlyEarnings = Math.floor( - group.saleReward.type === "flat" - ? (value * rewardAmount) / 100 - : revenue * (rewardAmount / 100), - ); - - const displayEarnings = isYearly ? monthlyEarnings * 12 : monthlyEarnings; + const monthlyEarnings = + group.saleReward.type === "flat" + ? (value * rewardAmount) / 100 + : revenue * (rewardAmount / 100); + + const displayEarnings = isYearly ? monthlyEarnings * 12 : monthlyEarnings; + const roundedDisplayEarnings = Math.floor(displayEarnings);- <NumberFlow - value={displayEarnings} + <NumberFlow + value={roundedDisplayEarnings}
🤖 Fix all issues with AI agents
In `@apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx`:
- Around line 76-87: The range input lacks an accessible label; add an
associated label element (or an id on the existing descriptive element) and
reference it from the input via aria-labelledby so screen readers know what the
slider controls: give the descriptive paragraph (currently rendering <NumberFlow
value={value} /> customer sales) a stable id like `${id}-label` and set the
input (id `${id}-slider`) to include aria-labelledby={`${id}-label`}; keep the
existing onChange/setValue handling and SLIDER_MIN/SLIDER_MAX usage intact.
apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx
Outdated
Show resolved
Hide resolved
|
@coderabbitai full review please, any breaking changes |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 47216 🏁 Script executed: Length of output: 80 🏁 Script executed: Length of output: 87 🏁 Script executed: Length of output: 65 🏁 Script executed: Length of output: 3359 🏁 Script executed: Length of output: 3782 🏁 Script executed: Length of output: 699 🏁 Script executed: Length of output: 512 🏁 Script executed: Length of output: 774 🏁 Script executed: Length of output: 4029 🏁 Script executed: Length of output: 59 🏁 Script executed: Length of output: 72 🏁 Script executed: Length of output: 14781 🏁 Script executed: Length of output: 6732 🏁 Script executed: Length of output: 893 🏁 Script executed: Length of output: 302 🏁 Script executed: Length of output: 638 🏁 Script executed: Length of output: 136 🏁 Script executed: Length of output: 1579 🏁 Script executed: Length of output: 3014
|
CleanShot.2026-02-03.at.16.03.02.mp4
Summary by CodeRabbit
New Features
Style