@@ -10,6 +10,10 @@ import axiosInstance from '@web/lib/axios';
1010import { getTokenLocal } from '@web/lib/axios/token.utils' ;
1111import { type SocialLinks } from '@web/modules/auth/types/User' ;
1212import { ProfileBioMarkdown } from '@web/modules/shared/components/ProfileBioMarkdown' ;
13+ import { Button } from '@web/modules/shared/components/ui/button' ;
14+ import { Input } from '@web/modules/shared/components/ui/input' ;
15+ import { Label } from '@web/modules/shared/components/ui/label' ;
16+ import { Textarea } from '@web/modules/shared/components/ui/textarea' ;
1317
1418import { socialKeys , SOCIAL_LINK_ICONS } from './socialKeys' ;
1519
@@ -42,6 +46,9 @@ function cleanSocialLinks(links: SocialLinks): SocialLinks {
4246 return out ;
4347}
4448
49+ const fieldInputClass =
50+ 'border-zinc-600 bg-zinc-900 text-zinc-100 placeholder:text-zinc-500' ;
51+
4552export function ProfileBioEditor ( { profile, isOwner } : ProfileBioEditorProps ) {
4653 const router = useRouter ( ) ;
4754 const [ isEditing , setIsEditing ] = useState ( false ) ;
@@ -99,34 +106,40 @@ export function ProfileBioEditor({ profile, isOwner }: ProfileBioEditorProps) {
99106 < div className = 'flex items-start justify-between gap-2' >
100107 < h2 className = 'text-lg font-semibold text-zinc-200' > About</ h2 >
101108 { isOwner && ! isEditing && (
102- < button
109+ < Button
103110 type = 'button'
111+ variant = 'ghost'
112+ size = 'icon'
104113 onClick = { ( ) => setIsEditing ( true ) }
105- className = 'text-zinc-500 hover:text-zinc-300 p-1 rounded '
114+ className = 'text-zinc-500 hover:bg-transparent hover: text-zinc-300'
106115 aria-label = 'Edit profile'
107116 >
108- < Pencil className = 'w -5 h -5' />
109- </ button >
117+ < Pencil className = 'h -5 w -5' />
118+ </ Button >
110119 ) }
111120 { isOwner && isEditing && (
112121 < div className = 'flex gap-1' >
113- < button
122+ < Button
114123 type = 'button'
124+ variant = 'ghost'
125+ size = 'icon'
115126 onClick = { cancel }
116- className = 'text-zinc-500 hover:text-zinc-300 p-1 rounded '
127+ className = 'text-zinc-500 hover:bg-transparent hover: text-zinc-300'
117128 aria-label = 'Cancel'
118129 >
119- < X className = 'w -5 h -5' />
120- </ button >
121- < button
130+ < X className = 'h -5 w -5' />
131+ </ Button >
132+ < Button
122133 type = 'button'
134+ variant = 'ghost'
135+ size = 'icon'
123136 onClick = { ( ) => void save ( ) }
124137 disabled = { saving }
125- className = 'text-zinc-500 hover:text-zinc-300 p-1 rounded disabled:opacity-50'
138+ className = 'text-zinc-500 hover:bg-transparent hover: text-zinc-300 disabled:opacity-50'
126139 aria-label = 'Save'
127140 >
128- < Check className = 'w -5 h -5' />
129- </ button >
141+ < Check className = 'h -5 w -5' />
142+ </ Button >
130143 </ div >
131144 ) }
132145 </ div >
@@ -135,25 +148,30 @@ export function ProfileBioEditor({ profile, isOwner }: ProfileBioEditorProps) {
135148
136149 { isEditing ? (
137150 < div className = 'mt-3 flex flex-col gap-4' >
138- < textarea
151+ < Textarea
139152 value = { description }
140153 onChange = { ( e ) => setDescription ( e . target . value ) }
141154 rows = { 12 }
142- className = 'w-full rounded-lg border border-zinc-600 bg-zinc-950 p-3 text-zinc-100 font-mono text-sm'
155+ className = { ` font-mono text-sm min-h-48 ${ fieldInputClass } ` }
143156 />
144157 < div className = 'grid grid-cols-1 sm:grid-cols-2 gap-3' >
145158 { socialKeys . map ( ( key ) => {
146159 const Icon = SOCIAL_LINK_ICONS [ key ] ;
160+ const id = `profile-social-${ key } ` ;
147161 return (
148- < label key = { key } className = 'flex flex-col gap-1 text-sm' >
149- < span className = 'text-zinc-400 flex items-center gap-2 capitalize' >
162+ < div key = { key } className = 'flex flex-col gap-1 text-sm' >
163+ < Label
164+ htmlFor = { id }
165+ className = 'text-zinc-400 flex items-center gap-2 capitalize font-normal'
166+ >
150167 < Icon
151168 className = 'w-4 h-4 shrink-0 text-zinc-500'
152169 aria-hidden
153170 />
154171 { key }
155- </ span >
156- < input
172+ </ Label >
173+ < Input
174+ id = { id }
157175 type = 'url'
158176 value = { socialLinks [ key ] ?? '' }
159177 onChange = { ( e ) =>
@@ -162,10 +180,10 @@ export function ProfileBioEditor({ profile, isOwner }: ProfileBioEditorProps) {
162180 [ key ] : e . target . value ,
163181 } ) )
164182 }
165- className = 'rounded border border-zinc-600 bg-zinc-900 px-2 py-1 text-zinc-100'
183+ className = { `h-8 px-2 py-1 text-sm ${ fieldInputClass } ` }
166184 placeholder = 'https://'
167185 />
168- </ label >
186+ </ div >
169187 ) ;
170188 } ) }
171189 </ div >
0 commit comments