feat: Add photo upload component for user and child profiles
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

- Created reusable PhotoUpload component with avatar preview
- Added photo upload to child create/edit dialog
- Added profile photo upload to settings page
- Show photo preview with fallback icon
- Display camera button for future file upload integration
- Support URL paste for immediate photo display
- Updated API types to support photoUrl field

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-04 08:11:38 +00:00
parent 426b5a309e
commit ac59e6fe82
5 changed files with 132 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import {
} from '@mui/material';
import { Child, CreateChildData } from '@/lib/api/children';
import { useTranslation } from '@/hooks/useTranslation';
import { PhotoUpload } from '@/components/common/PhotoUpload';
interface ChildDialogProps {
open: boolean;
@@ -146,13 +147,12 @@ export function ChildDialog({ open, onClose, onSubmit, child, isLoading = false
<MenuItem value="other">{t('gender.other')}</MenuItem>
</TextField>
<TextField
<PhotoUpload
label={t('dialog.photoUrl')}
value={formData.photoUrl}
onChange={handleChange('photoUrl')}
fullWidth
placeholder={t('dialog.photoPlaceholder')}
value={formData.photoUrl || ''}
onChange={(url) => setFormData({ ...formData, photoUrl: url })}
disabled={isLoading}
size={80}
/>
</Box>
</DialogContent>