feat: Hide photo URL field and improve avatar display
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

UI improvements for photo upload feature:
1. Hidden the photo URL text field completely (users don't need to see base64)
2. Added key prop to Avatar to force re-render when photoUrl changes
3. Added error handling for avatar image loading
4. Changed value display to hide base64 strings in hidden field

The camera icon is now the primary way to upload photos, with the URL field
completely hidden from view for a cleaner UX.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-04 09:15:28 +00:00
parent 5c69375d7a
commit 31f710df1f
2 changed files with 14 additions and 9 deletions

View File

@@ -116,13 +116,20 @@ export const AppShell = ({ children }: AppShellProps) => {
}}
>
<Avatar
src={user?.photoUrl}
src={user?.photoUrl || undefined}
key={user?.photoUrl || 'no-photo'} // Force re-render when photoUrl changes
sx={{
width: 36,
height: 36,
bgcolor: 'primary.main',
fontSize: '0.875rem',
}}
imgProps={{
onError: (e: any) => {
console.error('Avatar image failed to load:', user?.photoUrl?.substring(0, 50));
e.target.style.display = 'none'; // Hide broken image, show fallback
}
}}
>
{user?.name?.charAt(0).toUpperCase() || 'U'}
</Avatar>