feat: Hide photo URL field and improve avatar display
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user