Skip to content

Commit

Permalink
fix(frontend): default variant for Alert component
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <jordanshatford@live.com>
  • Loading branch information
jordanshatford committed Aug 13, 2023
1 parent e1d4915 commit 2eb15b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/lib/components/ui/Alert.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
} from 'svelte-feather-icons';
import { Variant } from '$lib/utils/types';
export let variant: Variant;
export let variant: Variant = Variant.DEFAULT;
export let title: string;
export let message: string | null = null;
Expand All @@ -27,6 +27,10 @@
[Variant.INFO]: {
icon: InfoIcon,
class: 'text-blue-800 bg-blue-200'
},
[Variant.DEFAULT]: {
icon: undefined,
class: 'bg-zinc-400 text-zinc-800'
}
};
</script>
Expand All @@ -37,7 +41,9 @@
>
<div class="sm:flex items-center">
<div class="flex items-end">
<svelte:component this={themes[variant].icon} size="1.5x" class={themes[variant].class} />
{#if themes[variant].icon}
<svelte:component this={themes[variant].icon} size="1.5x" class={themes[variant].class} />
{/if}
<p class="mx-2 font-bold {themes[variant].class}">{title}</p>
</div>
{#if message}
Expand Down

1 comment on commit 2eb15b0

@vercel
Copy link

@vercel vercel bot commented on 2eb15b0 Aug 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.