improved input field
This commit is contained in:
committed by
GitHub
parent
a50bb0d8b8
commit
8f0a66ba39
@@ -63,7 +63,7 @@ const SignIn = () => {
|
|||||||
<View className="p-5">
|
<View className="p-5">
|
||||||
<InputField
|
<InputField
|
||||||
label="Email"
|
label="Email"
|
||||||
placeholder="Enter your email"
|
placeholder="john.doe@email.com"
|
||||||
icon={icons.email}
|
icon={icons.email}
|
||||||
value={form.email}
|
value={form.email}
|
||||||
onChangeText={(value) =>
|
onChangeText={(value) =>
|
||||||
@@ -72,11 +72,12 @@ const SignIn = () => {
|
|||||||
email: value,
|
email: value,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
keyboardType="email-address"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputField
|
<InputField
|
||||||
label="Password"
|
label="Password"
|
||||||
placeholder="Enter your password"
|
placeholder="••••••••"
|
||||||
icon={icons.lock}
|
icon={icons.lock}
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
value={form.password}
|
value={form.password}
|
||||||
|
|||||||
+17
-5
@@ -8,6 +8,7 @@ import { CustomButton } from "@/components/custom-button";
|
|||||||
import { InputField } from "@/components/input-field";
|
import { InputField } from "@/components/input-field";
|
||||||
import { OAuth } from "@/components/oauth";
|
import { OAuth } from "@/components/oauth";
|
||||||
import { icons, images } from "@/constants";
|
import { icons, images } from "@/constants";
|
||||||
|
import { fetchAPI } from "@/lib/fetch";
|
||||||
|
|
||||||
const SignUp = () => {
|
const SignUp = () => {
|
||||||
const { isLoaded, signUp, setActive } = useSignUp();
|
const { isLoaded, signUp, setActive } = useSignUp();
|
||||||
@@ -62,7 +63,14 @@ const SignUp = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (completeSignUp.status === "complete") {
|
if (completeSignUp.status === "complete") {
|
||||||
// TODO: Create a database user
|
await fetchAPI("/(api)/user", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
name: form.name,
|
||||||
|
email: form.email,
|
||||||
|
clerkId: completeSignUp.createdUserId,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
await setActive({ session: completeSignUp.createdSessionId });
|
await setActive({ session: completeSignUp.createdSessionId });
|
||||||
setVerification((prevVerification) => ({
|
setVerification((prevVerification) => ({
|
||||||
@@ -104,7 +112,7 @@ const SignUp = () => {
|
|||||||
<View className="p-5">
|
<View className="p-5">
|
||||||
<InputField
|
<InputField
|
||||||
label="Name"
|
label="Name"
|
||||||
placeholder="Enter your name"
|
placeholder="John Doe"
|
||||||
icon={icons.person}
|
icon={icons.person}
|
||||||
value={form.name}
|
value={form.name}
|
||||||
onChangeText={(value) =>
|
onChangeText={(value) =>
|
||||||
@@ -113,11 +121,12 @@ const SignUp = () => {
|
|||||||
name: value,
|
name: value,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
autoCapitalize="sentences"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputField
|
<InputField
|
||||||
label="Email"
|
label="Email"
|
||||||
placeholder="Enter your email"
|
placeholder="john.doe@email.com"
|
||||||
icon={icons.email}
|
icon={icons.email}
|
||||||
value={form.email}
|
value={form.email}
|
||||||
onChangeText={(value) =>
|
onChangeText={(value) =>
|
||||||
@@ -126,11 +135,12 @@ const SignUp = () => {
|
|||||||
email: value,
|
email: value,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
keyboardType="email-address"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputField
|
<InputField
|
||||||
label="Password"
|
label="Password"
|
||||||
placeholder="Enter your password"
|
placeholder="••••••••"
|
||||||
icon={icons.lock}
|
icon={icons.lock}
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
value={form.password}
|
value={form.password}
|
||||||
@@ -180,8 +190,10 @@ const SignUp = () => {
|
|||||||
<InputField
|
<InputField
|
||||||
label="Code"
|
label="Code"
|
||||||
icon={icons.lock}
|
icon={icons.lock}
|
||||||
placeholder="12345"
|
placeholder="••••••"
|
||||||
value={verification.code}
|
value={verification.code}
|
||||||
|
maxLength={6}
|
||||||
|
secureTextEntry
|
||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
onChangeText={(code) =>
|
onChangeText={(code) =>
|
||||||
setVerification((prevVerification) => ({
|
setVerification((prevVerification) => ({
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ export const InputField = ({
|
|||||||
<TextInput
|
<TextInput
|
||||||
className={`rounded-full p-4 font-JakartaSemiBold text-[15px] flex-1 text-left ${inputStyles}`}
|
className={`rounded-full p-4 font-JakartaSemiBold text-[15px] flex-1 text-left ${inputStyles}`}
|
||||||
secureTextEntry={secureTextEntry}
|
secureTextEntry={secureTextEntry}
|
||||||
|
autoCapitalize="none"
|
||||||
|
autoComplete="off"
|
||||||
selectionColor="#0286ff"
|
selectionColor="#0286ff"
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user