Conversation
Signed-off-by: rmeena840 <rmeena840@gmail.com>
Reviewer's GuideRefactors the BuyNBTC component to adopt React 19 form actions via useActionState, removes react-hook-form integration, replaces FormNumericInput with NumericInput, centralizes transaction validation, and streamlines form reset and the YouReceive component. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @rmeena840 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| return { isValid: true }; | ||
| }; | ||
|
|
||
| const handleTransaction = async (_: unknown, formData: FormData) => { |
There was a problem hiding this comment.
suggestion: Unused formData parameter in handler
Please remove the unused formData parameter or update the function to use formData.get('suiAmount') instead of reading from state.
| const handleTransaction = async (_: unknown, formData: FormData) => { | ||
| const mistAmount = parseSUI(suiAmount); | ||
| const { isValid } = validateTransaction(mistAmount); | ||
| if (!isValid) return; |
There was a problem hiding this comment.
suggestion (code-quality): Use block braces for ifs, whiles, etc. (use-braces)
| if (!isValid) return; | |
| if (!isValid) { |
Explanation
It is recommended to always use braces and create explicit statement blocks.Using the allowed syntax to just write a single statement can lead to very confusing
situations, especially where subsequently a developer might add another statement
while forgetting to add the braces (meaning that this wouldn't be included in the condition).
Description
Closes: #80
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues._
I have...
!to the type prefix if API or client breaking changeSummary by Sourcery
Migrate the Buy nBTC form to React 19 form actions by removing react-hook-form and adopting native form submission with useActionState, custom validation, and NumericInput components
Enhancements: