summaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAlberto Duarte Delgado <alberto@albertoduarte.com>2026-04-01 02:58:40 +0100
committerAlberto Duarte Delgado <alberto@albertoduarte.com>2026-04-01 02:58:40 +0100
commitc927739f8f221feabb6e19af2c2667eda905a2eb (patch)
treedba3f467fda857e1ac697ee35f45d4229d829137 /src/features
parentbd4a70dab890153617cad4e0be1364941993d51d (diff)
foto de perfil por url
firestore requiere pago por eso no se hace con imagen subida de galeria.
Diffstat (limited to 'src/features')
-rw-r--r--src/features/profile/hooks/useUpdateProfile.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/features/profile/hooks/useUpdateProfile.ts b/src/features/profile/hooks/useUpdateProfile.ts
index 505bfbb..bc069dc 100644
--- a/src/features/profile/hooks/useUpdateProfile.ts
+++ b/src/features/profile/hooks/useUpdateProfile.ts
@@ -4,10 +4,11 @@ import { useState } from 'react';
import { profileService } from '@/features/profile/services/profileService';
import { useAuthSession } from '@/providers/AuthProvider';
-export function useUpdateProfile(initialDisplayName = '') {
+export function useUpdateProfile(initialDisplayName = '', initialPhotoURL = '') {
const { user } = useAuthSession();
const [displayName, setDisplayName] = useState(initialDisplayName);
+ const [photoURL, setPhotoURL] = useState(initialPhotoURL);
const [isSubmitting, setIsSubmitting] = useState(false);
const [error, setError] = useState<string | null>(null);
const [successMessage, setSuccessMessage] = useState<string | null>(null);
@@ -31,8 +32,10 @@ export function useUpdateProfile(initialDisplayName = '') {
await profileService.updateMyProfile({
uid: user.uid,
displayName: displayName.trim(),
+ photoURL: photoURL.trim(),
});
+ setPhotoURL(photoURL.trim());
setSuccessMessage('Perfil actualizado correctamente');
} catch (err: any) {
setError(err?.message ?? 'No se pudo actualizar el perfil');
@@ -43,7 +46,9 @@ export function useUpdateProfile(initialDisplayName = '') {
return {
displayName,
+ photoURL,
setDisplayName,
+ setPhotoURL,
isSubmitting,
error,
successMessage,