-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feat: Ether deposit validation on change and display balance #294
Conversation
…efactoring on how ether-form is exported.
… a new test helper for transaction success lifecycle.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -54,22 +56,27 @@ export const EtherDepositForm: FC<EtherDepositFormProps> = (props) => { | |||
} = props; | |||
const [advanced, { toggle: toggleAdvanced }] = useDisclosure(false); | |||
const { chain } = useAccount(); | |||
const balance = useFormattedBalance(); |
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.
It seems that we won't be needing useFormattedBalance
hook. If this is true, please delete it and the related unit test suite.
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.
Removed on c9c0c7f
<Flex c={"dark.2"} gap="3"> | ||
<Text fz="xs">Balance: {accountBalance.formatted}</Text> | ||
{accountBalance.value > 0 && ( | ||
<UnstyledButton |
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.
Can we switch to using the standard Button
component instead?
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.
Hey! I started with the <Button>
, but I needed to unstyle it (no pun intended) to reach the same result, i.e. adding variant: transparent, height: auto and padding 0
besides the required one for the inner text. Hence, the reason to use the <UnstyledButton />
.
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.
I left a couple of comments.
Summary
Code changes to improve feedback in the ether deposit form. Also, I refactored the test file for the ether-deposit form before adding the new test cases (separated commits).
Changes:
max
button is available to click.