swarmcity / SwarmCityDapp

Swarm City dApp FrontEnd
MIT License
28 stars 10 forks source link

disable next button in sending SWT #642

Closed kikipluche closed 6 years ago

kikipluche commented 6 years ago

Location

/my-wallet

Expected behavior

The next button on sending SWT is disabled if i enter more than 5 digits (longer than the shortcode). When only entering 1, 2, 3, 4 digits I am able to proceed, and will get the error message.

Actual behavior

The next button is enabled all the time, i can enter a wrong shortcode or wrong address and can proceed, only when entering i get the error message.

Steps to reproduce the problem

my wallet > enter wrong shortcode > enter

xardass commented 6 years ago

Currently the input does check for shortcode and public key lenght. Any input of 5 digits or length of public key will be accepted.

Other lengths were ignored when I tested it.

I can not verify if shortcode/public key is correct

kikipluche commented 6 years ago

@xardass it's about disabling the next button. We are going to change the inputfield again, so we will only be able to use the shortcode, no longer the public key, so we will set the next button to disabled as long as the user hasn't put in 5 digits or puts in more digits. We'll discuss this issue in daily

kikipluche commented 6 years ago

These are the steps we need to do for now: Since we are changing to only shortcode (no public key), the next button should behave as follows:

BvL13 commented 6 years ago

@kikipluche @xardass why is this issue open but the epic closed?

kikipluche commented 6 years ago

@BvL13 just edited the last comment made by me, and will add it to the epic of shortcode.

xardass commented 6 years ago

So if I understand this issue, it's not about functionality (button on-tap event is disabled), but we want it to be 'greyed-out'? It's a visual issue? @faffydee

kingflurkel commented 6 years ago

@kikipluche The shortcode no longer accepts an address, only the shortcode. This means we can simplify the validation of the fields: if the amount is lower than the balance, but higher or equal than 0 or null, that field is valid. If the shortcode field has exactly 5 digits, that field is valid. When both are valid, we can enable the button, which removes class disabled and functionally enables the button.