@@ -80,6 +80,7 @@ export default function Signup({ navigation }: NavProp) {
8080 } )
8181
8282 useEffect ( ( ) => {
83+ if ( ! username ) return setStatus ( NameStatus . Initial )
8384 setStatus ( NameStatus . Checking )
8485 const timer = setTimeout ( ( ) => {
8586 const { error, data } = usernameStatusZodValidator . safeParse ( { username } )
@@ -93,7 +94,7 @@ export default function Signup({ navigation }: NavProp) {
9394 return ( ) => clearTimeout ( timer )
9495 } , [ checkUsername , username ] )
9596
96- function handelSubmit ( ) {
97+ function handleSubmit ( ) {
9798 const { error, data } = signupZodValidator . safeParse ( { username, password, email, name } )
9899 console . log ( error )
99100 if ( error ) {
@@ -114,15 +115,17 @@ export default function Signup({ navigation }: NavProp) {
114115 < SettGroup title = 'Full Name' >
115116 < Input
116117 Icon = { < RoundedIcon Icon = { TextFontSolidIcon } className = 'bg-blue-500' /> }
117- placeholder = 'Full Name'
118+ placeholder = 'Your Full Name'
119+ autoComplete = 'name'
118120 value = { name }
119121 onChangeText = { setName }
120122 />
121123 </ SettGroup >
122124 < SettGroup title = 'Email' >
123125 < Input
124126 Icon = { < RoundedIcon Icon = { Mail02SolidIcon } className = 'bg-rose-500' /> }
125- placeholder = 'Email'
127+ placeholder = 'Your Email'
128+ autoComplete = 'email'
126129 value = { email }
127130 keyboardType = 'email-address'
128131 onChangeText = { setEmail }
@@ -131,7 +134,8 @@ export default function Signup({ navigation }: NavProp) {
131134 < SettGroup title = 'Username' >
132135 < Input
133136 Icon = { < RoundedIcon Icon = { StarSolidIcon } className = 'bg-amber-500' /> }
134- placeholder = 'Username'
137+ placeholder = 'Select a Username'
138+ autoComplete = 'username'
135139 value = { username }
136140 onChangeText = { setUsername }
137141 Right = { < UsernameStatus isAvail = { status } /> }
@@ -142,7 +146,8 @@ export default function Signup({ navigation }: NavProp) {
142146 < Input
143147 value = { password }
144148 onChangeText = { setPassword }
145- placeholder = 'Password'
149+ placeholder = 'Enter Password'
150+ autoComplete = 'password'
146151 secureTextEntry = { ! isVisible }
147152 Icon = { < RoundedIcon Icon = { LockPasswordSolidIcon } className = 'bg-slate-500' /> }
148153 Right = { < PasswordEye isVisible = { isVisible } setIsVisible = { setIsVisible } /> }
@@ -158,7 +163,7 @@ export default function Signup({ navigation }: NavProp) {
158163 title = { isPending ? 'Signing up...' : 'Signup' }
159164 className = 'w-full'
160165 disabled = { isPending }
161- onPress = { handelSubmit }
166+ onPress = { handleSubmit }
162167 />
163168 </ View >
164169 < SettGroup title = 'More Options' className = 'mt-5' >
@@ -189,8 +194,8 @@ function UsernameStatus({ isAvail }: { isAvail: NameStatus }) {
189194 return (
190195 < >
191196 { 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 ] } /> }
194199 </ >
195200 )
196201}
0 commit comments