mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
feat(lib): add support for external images in items (#291)
* feat: add support for external images in items Add image_external field to Item type and update HeaderView to prefer external images over internal ones when available. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: prettier formatting for external image feature --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7e0d44dac8
commit
945e5b066a
@ -57,7 +57,9 @@ export function HeaderView({
|
|||||||
|
|
||||||
const [imageLoaded, setImageLoaded] = useState(false)
|
const [imageLoaded, setImageLoaded] = useState(false)
|
||||||
|
|
||||||
const avatar = item.image && appState.assetsApi.url + item.image + '?width=160&heigth=160'
|
const avatar =
|
||||||
|
item.image_external ||
|
||||||
|
(item.image && appState.assetsApi.url + item.image + '?width=160&heigth=160')
|
||||||
const title = item.name
|
const title = item.name
|
||||||
const subtitle = item.subname
|
const subtitle = item.subname
|
||||||
|
|
||||||
|
|||||||
1
lib/src/types/Item.d.ts
vendored
1
lib/src/types/Item.d.ts
vendored
@ -46,6 +46,7 @@ export interface Item {
|
|||||||
slug?: string
|
slug?: string
|
||||||
user_created?: UserItem
|
user_created?: UserItem
|
||||||
image?: string
|
image?: string
|
||||||
|
image_external?: string
|
||||||
group_type?: string
|
group_type?: string
|
||||||
offers?: TagIds
|
offers?: TagIds
|
||||||
needs?: TagIds
|
needs?: TagIds
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user