Skip to content

Commit

Permalink
chore(app): pre commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Swepool committed Aug 8, 2024
1 parent 009d318 commit 243c441
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion app/src/lib/components/search/cmdk.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Badge from "$lib/components/ui/badge/badge.svelte"
import * as Command from "$lib/components/ui/command/index.ts"
import DollarSignIcon from "virtual:icons/lucide/badge-dollar-sign"
import UnionIcon from "$lib/components/union-icons/index.svelte"
import { mode } from "mode-watcher";
import { mode } from "mode-watcher"
let searchInput = writable("")
searchInput.update($searchInput => $searchInput.replaceAll(" ", ""))
Expand Down
49 changes: 24 additions & 25 deletions app/src/lib/components/union-icons/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,25 @@ import MonoInverseHubbleStatus from "$lib/components/union-icons/mono-inverse/ic
import MonoInverseSearchK from "$lib/components/union-icons/mono-inverse/icon-searchk-mono-inverse.svelte"
type IconName =
| "blocks"
| "channel"
| "connection"
| "explorer"
| "faucet"
| "index"
| "queue"
| "search"
| "transfers"
| "usertransfers"
| "wallet"
| "packet"
| "home"
| "settings"
| "alltransfers"
| "ibcconnections"
| "ibcchannels"
| "hubblestatus"
| "searchk"
| "blocks"
| "channel"
| "connection"
| "explorer"
| "faucet"
| "index"
| "queue"
| "search"
| "transfers"
| "usertransfers"
| "wallet"
| "packet"
| "home"
| "settings"
| "alltransfers"
| "ibcconnections"
| "ibcchannels"
| "hubblestatus"
| "searchk"
type IconVariant = "color" | "mono" | "inverse" | "monoInverse"
Expand Down Expand Up @@ -249,16 +249,15 @@ export let name: IconName | undefined
export { className as class }
function isValidIconThemeCombination(name: IconName | undefined, theme: IconVariant): boolean {
return !!name && !!icons[name]?.variants[theme]
function getIconComponent(name: IconName | undefined, theme: IconVariant): any | undefined {
return name && icons[name]?.variants[theme]
}
$: isValid = isValidIconThemeCombination(name, theme)
$: display = isValid ? icons[name!].variants[theme] : null
$: component = getIconComponent(name, theme)
</script>

{#if isValid && display}
<svelte:component this={display} class={className}/>
{#if component}
<svelte:component this={component} class={className} />
{:else}
<p>Icon not found or not available in this variant.</p>
{/if}

0 comments on commit 243c441

Please sign in to comment.