Merge branch 'main' into directus-sync-files

This commit is contained in:
Ulf Gebhardt 2025-08-25 14:02:32 +01:00 committed by GitHub
commit 2135915256
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -10,14 +10,16 @@ import UserSVG from '#assets/user.svg'
import { useAppState } from '#components/AppShell/hooks/useAppState' import { useAppState } from '#components/AppShell/hooks/useAppState'
import DialogModal from '#components/Templates/DialogModal' import DialogModal from '#components/Templates/DialogModal'
import type { Item } from '#types/Item'
import type { Crop } from 'react-image-crop' import type { Crop } from 'react-image-crop'
interface AvatarWidgetProps { interface AvatarWidgetProps {
avatar?: string avatar?: string
setAvatar: React.Dispatch<React.SetStateAction<any>> setAvatar: React.Dispatch<React.SetStateAction<any>>
item?: Item
} }
export const AvatarWidget: React.FC<AvatarWidgetProps> = ({ avatar, setAvatar }) => { export const AvatarWidget: React.FC<AvatarWidgetProps> = ({ avatar, setAvatar, item }) => {
const [crop, setCrop] = useState<Crop>() const [crop, setCrop] = useState<Crop>()
const [image, setImage] = useState<string>('') const [image, setImage] = useState<string>('')
const [cropModalOpen, setCropModalOpen] = useState<boolean>(false) const [cropModalOpen, setCropModalOpen] = useState<boolean>(false)
@ -181,7 +183,7 @@ export const AvatarWidget: React.FC<AvatarWidgetProps> = ({ avatar, setAvatar })
</div> </div>
) : ( ) : (
<div className='tw:h-20 tw:w-20'> <div className='tw:h-20 tw:w-20'>
<img src={UserSVG} className='tw:rounded-full'></img> <img src={item?.image_external ?? UserSVG} className='tw:rounded-full'></img>
</div> </div>
)} )}
</label> </label>

View File

@ -26,6 +26,7 @@ export const FormHeader = ({ item, state, setState }: Props) => {
image: i, image: i,
})) }))
} }
item={item}
/> />
<ColorPicker <ColorPicker
color={state.color} color={state.color}