-
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
Feature/staking form ux improvements fixes #666
Feature/staking form ux improvements fixes #666
Conversation
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.
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 one comment. If you don't feel let's just let it go. Only small suggestion on the table.
requiredMessage: "The stake amount is required.", | ||
greaterThanValidationMessage: defaultGreaterThanMessage, | ||
lessThanValidationMessage: defaultLessThanMessage, | ||
requiredMessage: "Required.", |
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 don't like this line. Full sentence will be more informative and simply elegant.
Something like "The value is required.". What do you think?
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 agree, but from what I see we use such message in other places too. I think it would be best to change it across the whole app.
@SorinQ What do you think? Maybe you could look into the dApp and let me know fi some validation messages could be improved?
39d49e8
into
feature/staking-form-ux-improvements
…x-improvements Improve staking form user experience 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.
Addresses the review comments in #643.
Main changes:
isWalletConnected
property (see Improve staking form user experience #643 (comment))