-
Notifications
You must be signed in to change notification settings - Fork 27
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
Improve staking form user experience #643
Conversation
Added validation if user wallet is empty, simplified and made validation error messages more descriptive, improved readability of validation function, disabled form if wallet is not connected.
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.
Left some comments to look at before the merge
Renamed variables: defaultLessThanMsg -> defaultStakingLessThanMessage defaultGreaterThanMsg -> defaultStakingGreaterThanMessage defaultValidationOptions -> defaultStakingValidationOptions ValidationMsg -> AmountValidationMessage ValidationOptions -> AmountValidationOptions
Applied refinemets, added getAmountInRangeValidationMessage function
1 similar comment
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.
Left two comments to look at before the merge.
Also let's sync it with the main branch
In 42bd970 we've changed the default messages in a way that they are related to Token staking. This is bad because now such messages were displayed in tbtc section (for example). This commit changes the default error message back to where it was before this commit.
The property name change is not needed because we usually use default `active` property from `useWeb3React` hook anyway.
The previosu commit introduces `shouldDisableButton` property which might get a little confusing, because when it's set to true someone might expect that the button is disabled no matter what, when in reality it relies on `isDisabled` property also. Instead of this, I've added `isDisabled` property for `Connect Wallet` button in SubmitTxButton component and set it to false. This overrides the `isDisabled` property from `...buttonProp`, because in this case we don't want ot have this button disabled anyway. This means that we can use `isDisabled` to disable token amount form if the account is not connected but keep the `Connect Wallet` button active.
…x-improvements-fixes Feature/staking form ux improvements fixes
1 similar comment
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 🔥
Ref: #634
Added validation if user wallet is empty, simplified and made validation error messages more descriptive, improved readability of validation function, disabled form if wallet is not connected.
Some of the issues were also addressed in #666, which was merged into this PR.