-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-7276] feat: hide points estimation #555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request introduces several enhancements to the components related to claims and links. Key modifications include improved error handling for cashout limits in the Changes
Possibly related PRs
Suggested reviewers
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
src/components/Request/Pay/Views/Initial.view.tsx (1)
Line range hint
441-458
: LGTM! Consider cleanup of unused props.The points estimation section is properly commented out as per the task requirements. However, since the points display is being hidden, consider cleaning up unused props and state variables like
estimatedPoints
andsetEstimatedPoints
in a follow-up PR.src/components/Claim/Link/Initial.view.tsx (1)
Line range hint
536-549
: LGTM! Consider cleanup of points calculation logic.The points estimation display is properly commented out. However, there's still an active useEffect hook that calculates points using the
estimatePoints
function. Consider also commenting out or removing the points calculation logic to fully implement the points hiding feature.- useEffect(() => { - let isMounted = true - if (recipient?.address && isValidRecipient) { - const amountUSD = Number(claimLinkData.tokenAmount) * (tokenPrice ?? 0) - estimatePoints({ - address: recipient.address, - chainId: claimLinkData.chainId, - amountUSD, - actionType: ActionType.CLAIM, - }).then((points) => { - if (isMounted) { - setEstimatedPoints(points) - } - }) - } - return () => { - isMounted = false - } - }, [recipient.address, isValidRecipient, claimLinkData.tokenAmount, claimLinkData.chainId, tokenPrice])
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
src/components/Claim/Link/Initial.view.tsx
(2 hunks)src/components/Claim/Link/Onchain/Confirm.view.tsx
(2 hunks)src/components/Create/Link/Confirm.view.tsx
(2 hunks)src/components/Request/Pay/Views/Initial.view.tsx
(2 hunks)
✅ Files skipped from review due to trivial changes (2)
- src/components/Claim/Link/Onchain/Confirm.view.tsx
- src/components/Create/Link/Confirm.view.tsx
🧰 Additional context used
📓 Learnings (1)
src/components/Request/Pay/Views/Initial.view.tsx (3)
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#422
File: src/components/Request/Pay/Views/Initial.view.tsx:76-78
Timestamp: 2024-11-12T09:39:20.720Z
Learning: In `src/components/Request/Pay/Views/Initial.view.tsx`, both `txFee` and `utils.formatTokenAmount(estimatedGasCost, 3)` return strings, ensuring consistent return types for `calculatedFee`.
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#410
File: src/components/Request/Pay/Views/Initial.view.tsx:87-93
Timestamp: 2024-11-12T09:39:20.720Z
Learning: When refactoring to eliminate code duplication, prioritize readability and consider whether the change significantly improves the code. If it doesn't enhance readability or maintainability, it's acceptable to keep the existing code structure.
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#422
File: src/components/Request/Pay/Views/Initial.view.tsx:76-78
Timestamp: 2024-11-12T09:39:20.720Z
Learning: In `src/components/Request/Pay/Views/Initial.view.tsx`, both `txFee` and `utils.formatTokenAmount(...)` return strings, ensuring that `calculatedFee` consistently returns a string without the need for additional type conversion.
@jjramirezn lgtm Nit: I think slightly better practice to just hide div instead of commenting out. |
Summary by CodeRabbit
New Features
Bug Fixes
Documentation