-
Notifications
You must be signed in to change notification settings - Fork 51
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
realm trade (#2539) #2540
realm trade (#2539) #2540
Conversation
* realm trade * component work * ad * updates * checkbox * check * Handle multicall * fix dyn amount * donk * donk * Add loading state * transfer info * donkeys * transfer * Styling + UX improvements --------- Co-authored-by: Bob <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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.
The PR adds a new realm transfer feature with good UI components and state management. Some suggestions for improvement:
- Error handling and user feedback could be enhanced
- Some complex logic could be extracted into utility functions
- Input validation could be more robust
- Documentation could be added for key functions and components
- Accessibility features could be improved
Overall, the code is well-structured and makes good use of React hooks and memoization for performance.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
|
||
useEffect(() => { | ||
const resources = calls.map((call) => { | ||
return { |
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.
Consider extracting this mapping logic into a separate utility function for better reusability and testing
const handleTransfer = useCallback(() => { | ||
setIsLoading(true); | ||
const cleanedCalls = calls.map(({ sender_entity_id, recipient_entity_id, resources }) => ({ | ||
sender_entity_id, |
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.
Consider adding error handling for failed transactions and user feedback
return ( | ||
<div className="flex flex-col gap-2 border-b-2 mt-2 border-gold/20"> | ||
<div className="flex flex-row gap-4"> | ||
<div className="self-center w-1/2"> |
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.
The input validation could be improved by adding a check for the maximum transferable amount based on available donkeys
neededDonkeys > getDonkeyBalance() || getDonkeyBalance() === 0 ? "text-red" : "text-green" | ||
}`} | ||
> | ||
{neededDonkeys.toLocaleString()} 🔥🫏 [{getDonkeyBalance().toLocaleString()}] |
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.
Consider adding a tooltip to explain the donkey requirements more clearly
Failed to generate code suggestions for PR |
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.
LGTM
realm trade
component work
ad
updates
checkbox
check
Handle multicall
fix dyn amount
donk
donk
Add loading state
transfer info
donkeys
transfer
Styling + UX improvements