Skip to content

Disable empty login issue 75#102

Merged
7riumph merged 2 commits into
rubyforpeace:mainfrom
graceeilori:disable-empty-login-issue-75
Feb 28, 2025
Merged

Disable empty login issue 75#102
7riumph merged 2 commits into
rubyforpeace:mainfrom
graceeilori:disable-empty-login-issue-75

Conversation

@graceeilori
Copy link
Copy Markdown

@graceeilori graceeilori commented Feb 28, 2025

Resolves #75

What was done?

Users who have not filled in both their email and password cannot submit an authentication request using the sign in button

What was edited, added, and or created?

  • Added a disabled state to the Sign In button
  • The Sign In button remains inactive until both input fields are filled

Screenshot/Video 📷

screen-20250227-205227.2.mp4

<Button
buttonStyle={tw`flex bg-[#ea5a4e] rounded-3xl w-40 h-10 flex justify-center items-center`}
buttonStyle={tw`flex bg-[#ea5a4e] rounded-3xl w-40 h-10 flex justify-center items-center
${!email || !password ? 'bg-gray-400' : 'bg-[#ea5a4e]'}` }
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.

Awesome

Comment thread src/components/Button.tsx
<TouchableOpacity style={buttonStyle} onPress={onPress}>
<Text style={textStyle} onPress={onPress}>
<TouchableOpacity style={buttonStyle} onPress={onPress} disabled = {disabled}>
<Text style={textStyle} onPress={disabled ? undefined : onPress} disabled = {disabled}>
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.

👍

Copy link
Copy Markdown
Collaborator

@7riumph 7riumph left a comment

Choose a reason for hiding this comment

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

Fantastic work on this, graying out the sign-in button is a great idea :)

@7riumph
Copy link
Copy Markdown
Collaborator

7riumph commented Feb 28, 2025

@graceeilori Also your corresponding api task is here for rate limiting sign-in on the /api/v1/users/sign_in endpoint.

Let me know whenever you've forked CASA/finished their Ruby on Rails setup, and if there are any issues!

@7riumph 7riumph merged commit f7e6ee7 into rubyforpeace:main Feb 28, 2025
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.

Ensure Sign-In button does not hit endpoint when LoginScreens auth form has no entry

2 participants