@@ -45,8 +45,6 @@ export default function EditUserForm() {
4545 } ,
4646 } ) ;
4747
48-
49-
5048 const onSubmit = async ( formData : UpdateUserInput ) => {
5149 const { data, error } = await updateUserProfile (
5250 supabase ,
@@ -74,11 +72,10 @@ export default function EditUserForm() {
7472 }
7573
7674 if ( data && ! error ) {
77- toast . success ( 'Profile updated successfully' ) ,
78- {
79- position : 'top-center' ,
75+ toast . success ( 'Profile updated successfully' , {
76+ position : 'top-right' ,
8077 autoClose : 3000 ,
81- } ;
78+ } ) ;
8279 }
8380 setUserImage ( null ) ;
8481 } ;
@@ -89,72 +86,72 @@ export default function EditUserForm() {
8986 ) => {
9087 if ( userString === null || userString . length === 0 ) {
9188 return emptyMessage ;
92- }
93- else if ( userString . length >= 25 ) {
89+ } else if ( userString . length >= 25 ) {
9490 return `${ userString . slice ( 0 , 25 ) } ...` ;
9591 }
9692 return userString ;
9793 } ;
9894
9995 return (
100- < div className = ' flex flex-row ml-5 overflow-y-scroll' >
101- < div className = ' flex flex-col w-12' >
102- < div className = ' flex flex-row' >
103- < h1 className = ' text-2xl font-semibold' > User Profile</ h1 >
96+ < div className = " flex flex-row ml-5 overflow-y-scroll" >
97+ < div className = " flex flex-col w-12" >
98+ < div className = " flex flex-row" >
99+ < h1 className = " text-2xl font-semibold" > User Profile</ h1 >
104100 </ div >
105- < div className = ' border-t-2 my-1 border-grey-700' > </ div >
106- < form className = ' h-[17.5rem] ' onSubmit = { handleSubmit ( onSubmit ) } >
107- < div className = ' flex flex-row justify-center items-center mb-2 ' >
108- < div className = ' flex flex-col' >
109- < label className = ' font-semibold text-xl mb-1 mx-auto' >
101+ < div className = " border-t-2 my-1 border-grey-700" > </ div >
102+ < form className = " h-[17.5rem] " onSubmit = { handleSubmit ( onSubmit ) } >
103+ < div className = " flex flex-row justify-center items-center mb-2 " >
104+ < div className = " flex flex-col" >
105+ < label className = " font-semibold text-xl mb-1 mx-auto" >
110106 Avatar
111107 </ label >
112- < div className = ' flex flex-col items-center' >
108+ < div className = " flex flex-col items-center" >
113109 < div
114110 className = { `${
115111 userImage
116112 ? 'p-4'
117113 : 'w-8 py-4 px-6 border-dashed border-2 border-grey-600'
118114 } flex items-center rounded-lg justify-center relative hover:cursor-pointer`}
119- onClick = { ( ) => imageRef ?. current ?. click ( ) } >
120- < div className = 'flex flex-col justify-center items-center' >
115+ onClick = { ( ) => imageRef ?. current ?. click ( ) }
116+ >
117+ < div className = "flex flex-col justify-center items-center" >
121118 { userImage ? (
122119 < Image
123- alt = ' userIcon'
120+ alt = " userIcon"
124121 src = { previewImage }
125122 width = { 40 }
126123 height = { 2 }
127124 />
128125 ) : (
129126 < >
130127 < CameraIcon width = { 5 } />
131- < span className = ' absolute -top-3 -right-3' >
132- < PlusIcon color = ' #4abfe8' />
128+ < span className = " absolute -top-3 -right-3" >
129+ < PlusIcon color = " #4abfe8" />
133130 </ span >
134131 </ >
135132 ) }
136133 </ div >
137134 </ div >
138- < span className = ' text-xs font-semibold text-center tracking-wider mt-2' >
135+ < span className = " text-xs font-semibold text-center tracking-wider mt-2" >
139136 UPLOAD IMAGE
140137 </ span >
141138 </ div >
142139 < input
143- type = ' file'
140+ type = " file"
144141 ref = { imageRef }
145142 onChange = { handleFileChange }
146- className = ' hidden'
147- accept = ' image/*'
143+ className = " hidden"
144+ accept = " image/*"
148145 />
149146 </ div >
150147 </ div >
151- < div className = ' flex flex-row justify-between items-center mb-2' >
152- < div className = ' flex flex-col justify-start ' >
153- < label className = ' font-semibold text-xl mb-1' > Name</ label >
148+ < div className = " flex flex-row justify-between items-center mb-2" >
149+ < div className = " flex flex-col justify-start " >
150+ < label className = " font-semibold text-xl mb-1" > Name</ label >
154151 { user && (
155152 < input
156153 defaultValue = { user . full_name ! }
157- className = ' w-12 text-grey-300 text-medium bg-grey-800 rounded-lg focus:bg-slate-600 focus:text-white focus:outline-grey-100 py-1 pl-2'
154+ className = " w-12 text-grey-300 text-medium bg-grey-800 rounded-lg focus:bg-slate-600 focus:text-white focus:outline-grey-100 py-1 pl-2"
158155 placeholder = { handleStringDisplay (
159156 user . full_name ,
160157 'Add your name to your profile'
@@ -164,13 +161,13 @@ export default function EditUserForm() {
164161 ) }
165162 </ div >
166163 </ div >
167- < div className = ' flex flex-row justify-between items-center mb-2' >
168- < div className = ' flex flex-col justify-start' >
169- < label className = ' font-semibold text-xl mb-1' > Website</ label >
164+ < div className = " flex flex-row justify-between items-center mb-2" >
165+ < div className = " flex flex-col justify-start" >
166+ < label className = " font-semibold text-xl mb-1" > Website</ label >
170167 { user && (
171168 < input
172169 defaultValue = { user . website ! }
173- className = ' w-12 text-medium text-grey-300 bg-grey-800 rounded-lg focus:bg-slate-600 focus:text-white focus:outline-grey-100 py-1 pl-2'
170+ className = " w-12 text-medium text-grey-300 bg-grey-800 rounded-lg focus:bg-slate-600 focus:text-white focus:outline-grey-100 py-1 pl-2"
174171 placeholder = { handleStringDisplay (
175172 user . website ,
176173 'Add your website to your profile'
@@ -180,11 +177,12 @@ export default function EditUserForm() {
180177 ) }
181178 </ div >
182179 </ div >
183- < div className = ' flex flex-row justify-end items-center' >
184- < div className = ' flex flex-row' >
180+ < div className = " flex flex-row justify-end items-center" >
181+ < div className = " flex flex-row" >
185182 < button
186- className = ' hover:text-frost-500 px-2 py-1 rounded-lg'
187- type = 'submit' >
183+ className = " hover:text-frost-500 px-2 py-1 rounded-lg"
184+ type = "submit"
185+ >
188186 Submit
189187 </ button >
190188 </ div >
0 commit comments