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

Change stake modal to text input #6807

Merged
merged 6 commits into from
Feb 22, 2024
Merged

Conversation

ianrowan
Copy link
Contributor

@ianrowan ianrowan commented Feb 20, 2024

Link to Issue

Closes: #6766

Description of Changes

https://www.loom.com/share/61e1cc9e926f44228becc4195b310bb2

  • Converts stake amound from text to input
  • updates style for text input
  • adds dynamic character size for input

-bonus: includes an optimization for suggested gas in txs + add base as a network fix

Test Plan

  • Click buy stake, input amount via input
  • test + and -
  • attempt again on sell flow

Other Considerations

  • supports max characters of 8, this is far beyond any likely affordable eth amount

Copy link
Contributor

@mhagel mhagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested. looks good

Copy link
Contributor

@masvelio masvelio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I bought one stake and I am getting 4e-8 ETH. Not sure if this issue is because of this PR or not, but it worked fine earlier.

VOTE WEIGHT

  1. I am concerned about this idea in general as it has a lot of potential issues that are already visible, both on technical and visual sides. I would say it needs better thought and maybe input from design team. I am listing some pitfalls I run into
  • I am able to delete value from the input and a. it becomes without value on blur and b. it gives me 2 console errors because fundamental rules of react inputs are violated
Kapture.2024-02-21.at.13.52.47.mp4
  • I can type non numeric values
    image

  • I can type very long numbers which breaks both design and functionality
    image
    image
    image

  • it looks bad on mobile in such cases (layout was not prepared for such a big numbers)
    image
    image

In my opinion, it cannot get in with this shape. I think we should

  • use number input
  • add proper validation for max number values
  • figure out better UI for mobile or/and big numbers

Copy link
Contributor

@masvelio masvelio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some css tweaks in latest commit

@ianrowan ianrowan merged commit 786188b into master Feb 22, 2024
6 of 7 checks passed
@ianrowan ianrowan deleted the 6766-enter-quantity-directly branch February 22, 2024 16:56
ilijabojanovic pushed a commit that referenced this pull request Feb 22, 2024
* input + gas optimization

* use loose equality

* block alphabetic input

* set max value that fits on mobile + fix characters

* convert to new designs

* css tweaks

---------

Co-authored-by: Marcin <[email protected]>
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.

Stake buy/sell modal - enter quantity directly
3 participants