Skip to content

fix: disable login submit button until email is valid (#27) - #47

Merged
FrankezeCode merged 2 commits into
BetterDevOrg:mainfrom
MsadafK:fix/disable-login-submit
Aug 1, 2026
Merged

fix: disable login submit button until email is valid (#27)#47
FrankezeCode merged 2 commits into
BetterDevOrg:mainfrom
MsadafK:fix/disable-login-submit

Conversation

@MsadafK

@MsadafK MsadafK commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Derived isEmailValid state from email input in src/app/login/page.tsx (checks if email is non-empty and contains @).
  • Disabled "Send login code" submit button when email is empty or invalid.
  • Added keyboard submit protection to prevent form submission on invalid email.
  • Added subtle helper text when typing an invalid email address.

Related issue

Fixes #27

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Other (describe below)

How to test

  1. Navigate to /login.
  2. Observe that the "Send login code" button is disabled initially.
  3. Type test (without @) → Button remains disabled and helper text appears.
  4. Type test@example.com → Button becomes enabled.
  5. Press Enter key on an invalid email to confirm no submission/API call happens.

Checklist

  • I ran npm run build (and npm run contracts:test if contracts changed)
  • I did not commit secrets or .env.local
  • I read CONTRIBUTING.md

@FrankezeCode FrankezeCode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is awesome , thanks 👍

@FrankezeCode
FrankezeCode merged commit a1b8681 into BetterDevOrg:main Aug 1, 2026
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.

[Good first issue]: Disable login submit until email looks valid

2 participants