mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-04-26 07:47:48 +00:00
Merge branch 'main' into directus-sync-files
This commit is contained in:
commit
2135915256
@ -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>
|
||||||
|
|||||||
@ -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}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user