feat: Add photo upload component for user and child profiles
- 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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user