feat: replace settings with a full page

This commit is contained in:
Zoe
2026-10-08 08:06:06 -05:00
parent 2b9f8d64d7
commit ff33e9c573
21 changed files with 503 additions and 245 deletions
+24
View File
@@ -8,6 +8,7 @@ export enum AuthError {
SignInFailed = 'SIGN_IN_FAILED',
SignUpFailed = 'SIGN_UP_FAILED',
SignOutFailed = 'SIGN_OUT_FAILED',
UpdateFailed = 'UPDATE_FAILED',
NetworkError = 'NETWORK_ERROR',
}
@@ -166,6 +167,28 @@ export const useAuth = () => {
}
};
const updateProfile = async (
updates: { name?: string; image?: string | null }
): Promise<Result<void, AuthError>> => {
try {
const { error } = await authClient.updateUser(updates);
if (error) {
console.error('Profile update failed:', error);
return Err(AuthError.UpdateFailed);
}
if (user.value) {
user.value = { ...user.value, ...updates };
}
return Ok(undefined);
} catch (err) {
console.error('Profile update error:', err);
return Err(AuthError.NetworkError);
}
};
return {
client: authClient,
session,
@@ -174,6 +197,7 @@ export const useAuth = () => {
signIn,
signUp,
signOut,
updateProfile,
fetchSession,
};
};