Small stuff
This commit is contained in:
@ -19,7 +19,16 @@ export const AvatarUpload = ({ onAvatarUploaded }: AvatarUploadProps) => {
|
||||
const file = e.target.files?.[0];
|
||||
if (!file) return;
|
||||
|
||||
const result = await uploadToStorage(file, 'avatars');
|
||||
const result = await uploadToStorage({
|
||||
file,
|
||||
bucket: 'avatars',
|
||||
resize: true,
|
||||
options: {
|
||||
maxWidth: 500,
|
||||
maxHeight: 500,
|
||||
quality: 0.8,
|
||||
}
|
||||
});
|
||||
if (result.success && result.path) {
|
||||
await onAvatarUploaded(result.path);
|
||||
}
|
||||
@ -41,9 +50,9 @@ export const AvatarUpload = ({ onAvatarUploaded }: AvatarUploadProps) => {
|
||||
>
|
||||
<Avatar className='h-32 w-32'>
|
||||
{avatarUrl ? (
|
||||
<AvatarImage src={avatarUrl} alt={profile?.full_name ?? 'User'} />
|
||||
<AvatarImage src={avatarUrl} alt={getInitials(profile?.full_name)} width={128} height={128} />
|
||||
) : (
|
||||
<AvatarFallback className='text-2xl'>
|
||||
<AvatarFallback className='text-4xl'>
|
||||
{profile?.full_name
|
||||
? getInitials(profile.full_name)
|
||||
: <User size={32} />}
|
||||
|
Reference in New Issue
Block a user