feat: take 0.25% peanut fee in account for cashout#659
feat: take 0.25% peanut fee in account for cashout#659kushagrasarathe merged 2 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request updates fee-related components by enhancing how fee information is calculated and displayed. The Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant O as OfframpConfirmView
participant F as calculateBankingFee
participant D as FeeDisplay (FeeDescription/InfoRow)
U->>O: Initiate fee estimation
O->>F: Calculate fee based on account type & promo
F-->>O: Return computed fee
O->>D: Pass fee for display (with additional "Peanut fees" info)
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/Global/FeeDescription/index.tsx (1)
144-147: LGTM! Consider extracting fee constants.The fee description is clear and informative. However, consider extracting the fee percentages and amounts into constants to improve maintainability.
Apply this diff to extract the fee constants:
+const PEANUT_FEE_PERCENTAGE = 0.25 +const SEPA_FEE = 1 +const ACH_FEE = 0.5 + moreInfoText={ isPromoApplied ? 'Fees waived with promo code!' : (accountType === 'iban' ? `For SEPA transactions a fee of $${SEPA_FEE} is charged. For ACH transactions a fee of $${ACH_FEE} is charged.` : `For ACH transactions a fee of $${ACH_FEE} is charged. For SEPA transactions a fee of $${SEPA_FEE} is charged.`) + ` Peanut fees are ${PEANUT_FEE_PERCENTAGE}% of the cashout amount.` }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/components/Global/FeeDescription/index.tsx(1 hunks)src/components/Offramp/Confirm.view.tsx(4 hunks)src/components/Request/Pay/Views/Initial.view.tsx(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/components/Request/Pay/Views/Initial.view.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
src/components/Offramp/Confirm.view.tsx
[error] 712-712: Avoid redundant double-negation.
It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation
(lint/complexity/noExtraBooleanCast)
🔇 Additional comments (1)
src/components/Offramp/Confirm.view.tsx (1)
736-742: LGTM! Fee calculation updates are consistent.The fee calculation updates consistently use the new
calculateBankingFeefunction across all components. The function is properly memoized withuseCallbackfor performance optimization.Also applies to: 879-880, 908-912, 923-928
fixes TASK-8571
Summary by CodeRabbit
New Features
Refactor