Skip to content
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

Conversation

michalsmiarowski
Copy link
Contributor

@michalsmiarowski michalsmiarowski commented Nov 21, 2023

Addresses the review comments in #643.

Main changes:

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.
@michalsmiarowski michalsmiarowski added this to the v1.13.0 milestone Nov 21, 2023
@michalsmiarowski michalsmiarowski self-assigned this Nov 21, 2023
Copy link
Contributor

@kpyszkowski kpyszkowski left a 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.",
Copy link
Contributor

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?

Copy link
Contributor Author

@michalsmiarowski michalsmiarowski Nov 21, 2023

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?

@kpyszkowski kpyszkowski merged commit 39d49e8 into feature/staking-form-ux-improvements Nov 21, 2023
4 of 5 checks passed
@kpyszkowski kpyszkowski deleted the feature/staking-form-ux-improvements-fixes branch November 21, 2023 17:20
michalsmiarowski added a commit that referenced this pull request Nov 21, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants