mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-20 09:42:26 +03:00
fix: fallback to defaultIcon when value is undefined (#7294)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Dakshesh Jain <dakshesh.jain14@gmail.com>
This commit is contained in:
parent
c100f427f3
commit
6b3ec81f63
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import { ComponentType } from 'svelte'
|
import { ComponentType } from 'svelte'
|
||||||
|
|
||||||
export let value: IconProps
|
export let value: IconProps | undefined
|
||||||
export let size: IconSize
|
export let size: IconSize
|
||||||
export let iconWithEmoji: AnySvelteComponent | Asset | ComponentType | undefined = view.ids.IconWithEmoji
|
export let iconWithEmoji: AnySvelteComponent | Asset | ComponentType | undefined = view.ids.IconWithEmoji
|
||||||
export let defaultIcon: AnySvelteComponent | Asset | ComponentType = document.icon.Document
|
export let defaultIcon: AnySvelteComponent | Asset | ComponentType = document.icon.Document
|
||||||
@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
<Icon
|
<Icon
|
||||||
{size}
|
{size}
|
||||||
icon={value.icon === iconWithEmoji && iconWithEmoji ? IconWithEmoji : value.icon ?? defaultIcon}
|
icon={value?.icon === iconWithEmoji && iconWithEmoji ? IconWithEmoji : value?.icon ?? defaultIcon}
|
||||||
iconProps={value.icon === iconWithEmoji && iconWithEmoji
|
iconProps={value?.icon === iconWithEmoji && iconWithEmoji
|
||||||
? { icon: value.color }
|
? { icon: value?.color }
|
||||||
: {
|
: {
|
||||||
fill: value.color !== undefined ? getPlatformColorDef(value.color, $themeStore.dark).icon : 'currentColor'
|
fill: value?.color !== undefined ? getPlatformColorDef(value?.color, $themeStore.dark).icon : 'currentColor'
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user