@@ -80,6 +80,7 @@ export default function Signup({ navigation }: NavProp) {
80
80
} )
81
81
82
82
useEffect ( ( ) => {
83
+ if ( ! username ) return setStatus ( NameStatus . Initial )
83
84
setStatus ( NameStatus . Checking )
84
85
const timer = setTimeout ( ( ) => {
85
86
const { error, data } = usernameStatusZodValidator . safeParse ( { username } )
@@ -93,7 +94,7 @@ export default function Signup({ navigation }: NavProp) {
93
94
return ( ) => clearTimeout ( timer )
94
95
} , [ checkUsername , username ] )
95
96
96
- function handelSubmit ( ) {
97
+ function handleSubmit ( ) {
97
98
const { error, data } = signupZodValidator . safeParse ( { username, password, email, name } )
98
99
console . log ( error )
99
100
if ( error ) {
@@ -114,15 +115,17 @@ export default function Signup({ navigation }: NavProp) {
114
115
< SettGroup title = 'Full Name' >
115
116
< Input
116
117
Icon = { < RoundedIcon Icon = { TextFontSolidIcon } className = 'bg-blue-500' /> }
117
- placeholder = 'Full Name'
118
+ placeholder = 'Your Full Name'
119
+ autoComplete = 'name'
118
120
value = { name }
119
121
onChangeText = { setName }
120
122
/>
121
123
</ SettGroup >
122
124
< SettGroup title = 'Email' >
123
125
< Input
124
126
Icon = { < RoundedIcon Icon = { Mail02SolidIcon } className = 'bg-rose-500' /> }
125
- placeholder = 'Email'
127
+ placeholder = 'Your Email'
128
+ autoComplete = 'email'
126
129
value = { email }
127
130
keyboardType = 'email-address'
128
131
onChangeText = { setEmail }
@@ -131,7 +134,8 @@ export default function Signup({ navigation }: NavProp) {
131
134
< SettGroup title = 'Username' >
132
135
< Input
133
136
Icon = { < RoundedIcon Icon = { StarSolidIcon } className = 'bg-amber-500' /> }
134
- placeholder = 'Username'
137
+ placeholder = 'Select a Username'
138
+ autoComplete = 'username'
135
139
value = { username }
136
140
onChangeText = { setUsername }
137
141
Right = { < UsernameStatus isAvail = { status } /> }
@@ -142,7 +146,8 @@ export default function Signup({ navigation }: NavProp) {
142
146
< Input
143
147
value = { password }
144
148
onChangeText = { setPassword }
145
- placeholder = 'Password'
149
+ placeholder = 'Enter Password'
150
+ autoComplete = 'password'
146
151
secureTextEntry = { ! isVisible }
147
152
Icon = { < RoundedIcon Icon = { LockPasswordSolidIcon } className = 'bg-slate-500' /> }
148
153
Right = { < PasswordEye isVisible = { isVisible } setIsVisible = { setIsVisible } /> }
@@ -158,7 +163,7 @@ export default function Signup({ navigation }: NavProp) {
158
163
title = { isPending ? 'Signing up...' : 'Signup' }
159
164
className = 'w-full'
160
165
disabled = { isPending }
161
- onPress = { handelSubmit }
166
+ onPress = { handleSubmit }
162
167
/>
163
168
</ View >
164
169
< SettGroup title = 'More Options' className = 'mt-5' >
@@ -189,8 +194,8 @@ function UsernameStatus({ isAvail }: { isAvail: NameStatus }) {
189
194
return (
190
195
< >
191
196
{ isAvail === NameStatus . Checking && < ActivityIndicator size = { 23 } color = { Colors . accent } /> }
192
- { isAvail === NameStatus . Available && < Tick01Icon className = 'text-green-500' height = { 22 } width = { 22 } /> }
193
- { isAvail === NameStatus . Unavailable && < Cancel01SolidIcon className = 'text-red-500' width = { 20 } height = { 20 } /> }
197
+ { isAvail === NameStatus . Available && < Tick01Icon height = { 22 } width = { 22 } color = { Colors . green [ 500 ] } /> }
198
+ { isAvail === NameStatus . Unavailable && < Cancel01SolidIcon width = { 20 } height = { 20 } color = { Colors . red [ 500 ] } /> }
194
199
</ >
195
200
)
196
201
}
0 commit comments