Refactor: Make Avatar in UserItem customisable

This commit is contained in:
Donatas Kirda 2024-05-14 00:29:48 +03:00
parent b296c0fa02
commit 41b6220160
Signed by: bloodwiing
GPG Key ID: 63020D8D3F4A164F

View File

@ -1,22 +1,21 @@
<script> <script>
import Avatar from "./avatar.svelte";
import Mention from "./mention.svelte"; import Mention from "./mention.svelte";
/** /**
* @type {import("$types/base").User | undefined | null} * @type {import("$types/base").User | undefined | null}
*/ */
export let user; export let user;
/**
* @type {number}
*/
export let iconSize = 16;
</script> </script>
<style> <style>
.icon {
width: 16px;
height: 16px;
border-radius: 100%;
}
</style> </style>
<Mention user={user}> <Mention user={user}>
<svg class="icon" viewBox="0 0 100 100"> <Avatar size={iconSize}></Avatar>
<use href="/avatar.svg#avatar"></use>
</svg>
</Mention> </Mention>