Created Avatar component

This commit is contained in:
Arman committed 2022-04-08 16:15:49 +02:00
1 parent a35faf7095
commit 4f138b480c
3 files changed
+11 -7

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
<script lang="ts">
export let size: string;
export let src: string;
</script>
<img width={size} height={size} class="avatar" style="--size: {size}px" {src} alt="" />
+1
View File
@@ -13,3 +13,4 @@ export { default as DropList } from './dropList.svelte';
export { default as DropListItem } from './dropListItem.svelte';
export { default as DropListLink } from './dropListLink.svelte';
export { default as Collapsible } from './collapsible.svelte';
export { default as Avatar } from './avatar.svelte';
+4 -7
View File
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
import { DropList, DropListItem, DropListLink } from '$lib/components';
import { DropList, DropListItem, DropListLink, Avatar } from '$lib/components';
import { app } from '$lib/stores/app';
import { sdkForConsole } from '$lib/stores/sdk';
import { user } from '$lib/stores/user';
@@ -46,12 +46,9 @@
<DropList bind:show={showDropdown} position="bottom" horizontal="left">
<button class="transparent-button" on:click={() => (showDropdown = !showDropdown)}>
<span class="is-only-desktop">{$user.name}</span>
<img
width="40"
height="40"
class="user-image"
src={sdkForConsole.avatars.getInitials($user.name, 40, 40).toString()}
alt="" />
<Avatar
size="50"
src={sdkForConsole.avatars.getInitials($user.name, 50, 50).toString()} />
</button>
<svelte:fragment slot="list">
<DropListLink href="/console/@me" icon="user">Your Account</DropListLink>