@@ -68,6 +68,9 @@ export default function CompleteProfile() {
6868 if ( profile . first_name ) setFirstName ( profile . first_name ) ;
6969 if ( profile . last_name ) setLastName ( profile . last_name ) ;
7070 if ( profile . username ) setUsername ( profile . username ) ;
71+ } else {
72+ // Profile is null, which means there was an error but we can continue
73+ console . log ( 'Profile not found, continuing with form setup' ) ;
7174 }
7275 } catch ( profileError ) {
7376 console . error ( 'Error checking profile:' , profileError ) ;
@@ -283,29 +286,29 @@ export default function CompleteProfile() {
283286 < label className = "block text-sm font-semibold text-gray-700" >
284287 First Name *
285288 </ label >
286- < input
287- type = "text"
288- value = { firstName }
289- onChange = { ( e ) => setFirstName ( e . target . value ) }
290- className = "w-full border border-gray-200 rounded-xl px-4 py-3 text-sm bg-white/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all duration-200 placeholder:text-gray-400"
291- placeholder = "Enter your first name"
292- required
293- />
289+ < input
290+ type = "text"
291+ value = { firstName }
292+ onChange = { ( e ) => setFirstName ( e . target . value ) }
293+ className = "w-full border border-gray-200 rounded-xl px-4 py-3 text-sm bg-white/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all duration-200 placeholder:text-gray-400 text-gray-900 "
294+ placeholder = "Enter your first name"
295+ required
296+ />
294297 </ div >
295298
296299 { /* Last Name */ }
297300 < div className = "space-y-2" >
298301 < label className = "block text-sm font-semibold text-gray-700" >
299302 Last Name *
300303 </ label >
301- < input
302- type = "text"
303- value = { lastName }
304- onChange = { ( e ) => setLastName ( e . target . value ) }
305- className = "w-full border border-gray-200 rounded-xl px-4 py-3 text-sm bg-white/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all duration-200 placeholder:text-gray-400"
306- placeholder = "Enter your last name"
307- required
308- />
304+ < input
305+ type = "text"
306+ value = { lastName }
307+ onChange = { ( e ) => setLastName ( e . target . value ) }
308+ className = "w-full border border-gray-200 rounded-xl px-4 py-3 text-sm bg-white/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all duration-200 placeholder:text-gray-400 text-gray-900 "
309+ placeholder = "Enter your last name"
310+ required
311+ />
309312 </ div >
310313
311314 { /* Username Input */ }
@@ -315,23 +318,23 @@ export default function CompleteProfile() {
315318 </ label >
316319 < div className = "relative" >
317320 < div className = "relative" >
318- < input
319- type = "text"
320- value = { username }
321- onChange = { ( e ) => handleUsernameChange ( e . target . value ) }
322- className = { `w-full border rounded-xl px-4 py-3 pr-20 text-sm bg-white/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all duration-200 placeholder:text-gray-400 ${
323- usernameAvailable === true
324- ? 'border-green-300 bg-green-50/50'
325- : usernameAvailable === false || usernameError
326- ? 'border-red-300 bg-red-50/50'
327- : 'border-gray-200'
328- } `}
329- placeholder = "Enter your username"
330- minLength = { 3 }
331- maxLength = { 30 }
332- title = "Username can only contain letters, numbers, hyphens, and underscores"
333- required
334- />
321+ < input
322+ type = "text"
323+ value = { username }
324+ onChange = { ( e ) => handleUsernameChange ( e . target . value ) }
325+ className = { `w-full border rounded-xl px-4 py-3 pr-20 text-sm bg-white/50 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all duration-200 placeholder:text-gray-400 text-gray-900 ${
326+ usernameAvailable === true
327+ ? 'border-green-300 bg-green-50/50'
328+ : usernameAvailable === false || usernameError
329+ ? 'border-red-300 bg-red-50/50'
330+ : 'border-gray-200'
331+ } `}
332+ placeholder = "Enter your username"
333+ minLength = { 3 }
334+ maxLength = { 30 }
335+ title = "Username can only contain letters, numbers, hyphens, and underscores"
336+ required
337+ />
335338 < div className = "absolute right-3 top-1/2 transform -translate-y-1/2 flex items-center space-x-2" >
336339 { isCheckingUsername && (
337340 < Loader2 className = "h-4 w-4 animate-spin text-blue-500" />
0 commit comments