-
Notifications
You must be signed in to change notification settings - Fork 2
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
[feat] create a textinput component + style auth flows #61
[feat] create a textinput component + style auth flows #61
Conversation
263d7b3
to
8e2f7e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great!! i made some changes and i'll merge!
toggleVisibility, | ||
error, | ||
}) => { | ||
const inputType = type === 'password' && isVisible ? 'text' : type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great handling!
components/TextInput/index.tsx
Outdated
error?: boolean; | ||
} | ||
|
||
const TextInput: React.FC<TextInputProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency in the codebase, we want to declare components using
export default function TextInput({
label,
id,
type,
onChange,
isVisible,
value,
toggleVisibility,
error,
}: TextInputProps) {
...
}
app/(auth)/signup/page.tsx
Outdated
if (result.error.message === 'Account already exists for this email') { | ||
setCheckEmailExistsError(result.error.message); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to catch all other possible errors too, so we don't need this conditional wrapper
app/(auth)/signup/page.tsx
Outdated
string | null | ||
>(null); | ||
const [passwordComplexity, setPasswordComplexity] = useState<boolean>(false); | ||
const [samePasswordCheck, setSamePasswordCheck] = useState(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this state can be inferred from password
and confirmPassword
states (i.e. just use password===confirmPassword
when needed). You can use a constant instead of creating a new state.
api/supabase/queries/users.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: i realized supabase login function already handles this error, so we might be able to remove this query later.
What's new in this PR 🧑🌾
Description
Screenshots
Sign Up
User Alr Registered Error
Invalid Email Error
Disabled SignUp (if password complexity not met, passwords don't match, or any fields blank)
Login
Invalid login credentials error
How to review
Next steps
Relevant links
Online sources
Related PRs
CC: @ccatherinetan