Quality of life update & package migrations. Use Vercel as default adapter (#67)
* Update all packages * Manual migration to SkeletonUI v4.8.0. Event elements has breaking tabs underline highlight * Remove unused dependencies & Let Prettier clean everything * Minor misc styling update
This commit is contained in:
23
src/components/council/CouncilAvatar.svelte
Normal file
23
src/components/council/CouncilAvatar.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
// Reference: https://github.com/skeletonlabs/skeleton/tree/88844ffb67b7c9553c5245dd6d70146a3d6b8932/packages/skeleton-svelte/src/components/avatar
|
||||
import { Avatar } from '@skeletonlabs/skeleton-svelte';
|
||||
let { name, src }: { name: string; src: string } = $props();
|
||||
|
||||
function getInitials(name: string): string {
|
||||
const words = name.trim().split(/\s+/);
|
||||
return words
|
||||
.slice(0, 5)
|
||||
.map((word) => word.charAt(0).toUpperCase())
|
||||
.join('');
|
||||
}
|
||||
</script>
|
||||
|
||||
<Avatar class="size-26 md:size-32">
|
||||
<Avatar.Image {src} class="h-full w-full rounded-full object-cover" />
|
||||
|
||||
<Avatar.Fallback>
|
||||
<div class="bg-ecsess-400 flex h-full w-full items-center justify-center rounded-full">
|
||||
<span class="text-ecsess-black text-xl font-bold"> {getInitials(name)} </span>
|
||||
</div>
|
||||
</Avatar.Fallback>
|
||||
</Avatar>
|
||||
Reference in New Issue
Block a user