mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Created Avatar component
This commit is contained in:
1 parent
a35faf7095
commit
4f138b480c
3 files changed
+11
-7
No files matched your search
@@ -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="" />
|
||||
@@ -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';
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user