cal.pub0.org/apps/web/pages/auth
Arun Kumar 7d7a1c5bbc
Fix login page CTA disabled state (#2832)
* fix(ui/login): better disabled state for login CTA

The fix involves tracking the form submission with a dedicated state `submitInProgress` with React.
`formState` from `react-hook-form` does not take time taken for the network call into account. For example,
if the api takes 5 seconds to complete, we would expect the `formState.isSubmitting` to be true for `5`
seconds. But, surprisingly this is not the case and `formState` from `react-hook-form` resolves
immediately after it makes a successful connection to the endpoint.

A dedicated state (with `useState`) is introduced that is enabled when the user clicks on the login CTA, and disabled when the api call is resolved, either successfully or with an error.

* Update login.tsx

* Update login.tsx

* Fixes isSubmitting state

Co-authored-by: zomars <zomars@me.com>
2022-05-23 17:20:35 +00:00
..
forgot-password Update all Yarn dependencies (2022-05-16) (#2769) 2022-05-17 19:31:49 +00:00
sso Fixes infinite loop 2022-05-17 11:10:57 -06:00
error.tsx Fixing ESLint warnings (#2723) 2022-05-14 13:49:39 +00:00
login.tsx Fix login page CTA disabled state (#2832) 2022-05-23 17:20:35 +00:00
logout.tsx Fixes infinite loop 2022-05-17 11:10:57 -06:00
new.tsx Feature: Verify login on signup with magic link. (#2122) 2022-04-21 14:32:25 -06:00
signup.tsx Feature: Verify login on signup with magic link. (#2122) 2022-04-21 14:32:25 -06:00