From 9010e1118220ad419a516caad28f81737b55d0d1 Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Thu, 14 Mar 2024 15:52:38 +1100 Subject: [PATCH] fix(ui): ability to remove icon from badge Signed-off-by: Jordan Shatford --- .changeset/rare-cherries-fix.md | 5 +++++ apps/extension/src/lib/components/PopupMain.svelte | 10 +++++----- packages/ui/src/lib/components/Badge.svelte | 8 +++++++- 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 .changeset/rare-cherries-fix.md diff --git a/.changeset/rare-cherries-fix.md b/.changeset/rare-cherries-fix.md new file mode 100644 index 00000000..6a8c1cd0 --- /dev/null +++ b/.changeset/rare-cherries-fix.md @@ -0,0 +1,5 @@ +--- +"@yd/ui": patch +--- + +fix: ability to remove icon from badge diff --git a/apps/extension/src/lib/components/PopupMain.svelte b/apps/extension/src/lib/components/PopupMain.svelte index fa5afcf1..a4531a29 100644 --- a/apps/extension/src/lib/components/PopupMain.svelte +++ b/apps/extension/src/lib/components/PopupMain.svelte @@ -38,11 +38,11 @@
- {options.format.toUpperCase()} - {options.quality.toUpperCase()} - Metadata - Thumbnail - Subtitles + {options.format.toUpperCase()} + {options.quality.toUpperCase()} + Metadata + Thumbnail + Subtitles
{#if $store.currentDownload} diff --git a/packages/ui/src/lib/components/Badge.svelte b/packages/ui/src/lib/components/Badge.svelte index 5eaeba25..3801a88c 100644 --- a/packages/ui/src/lib/components/Badge.svelte +++ b/packages/ui/src/lib/components/Badge.svelte @@ -69,7 +69,13 @@ export let icon: boolean | IconSource = false; export let loading: boolean = false; - const _icon = typeof icon === 'object' ? icon : toIcon(variant, { loading }); + let _icon: IconSource | undefined = undefined; + // User specified icon + if (typeof icon === 'object') { + _icon = icon; + } else if (icon) { + _icon = toIcon(variant, { loading }); + } const { spanClass, iconWrapperClass, iconClass, textClass, buttonClass } = badgeClasses({ variant,