mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-12 23:36:00 +00:00
avatar-widget showing external image (#330)
This commit is contained in:
parent
2baabe7940
commit
fbe1eb9e0f
@ -10,14 +10,16 @@ import UserSVG from '#assets/user.svg'
|
||||
import { useAppState } from '#components/AppShell/hooks/useAppState'
|
||||
import DialogModal from '#components/Templates/DialogModal'
|
||||
|
||||
import type { Item } from '#types/Item'
|
||||
import type { Crop } from 'react-image-crop'
|
||||
|
||||
interface AvatarWidgetProps {
|
||||
avatar?: string
|
||||
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 [image, setImage] = useState<string>('')
|
||||
const [cropModalOpen, setCropModalOpen] = useState<boolean>(false)
|
||||
@ -181,7 +183,7 @@ export const AvatarWidget: React.FC<AvatarWidgetProps> = ({ avatar, setAvatar })
|
||||
</div>
|
||||
) : (
|
||||
<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>
|
||||
)}
|
||||
</label>
|
||||
|
||||
@ -26,6 +26,7 @@ export const FormHeader = ({ item, state, setState }: Props) => {
|
||||
image: i,
|
||||
}))
|
||||
}
|
||||
item={item}
|
||||
/>
|
||||
<ColorPicker
|
||||
color={state.color}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user