diff options
| author | Adam Soltys <[email protected]> | 2022-10-06 09:50:59 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-06 09:50:59 -0700 |
| commit | a592f4dff28577e9123a5bcca1e46335028f42c4 (patch) | |
| tree | be17460f34e421c8b627afdb387d6d9069927d9d /src/components/Avatar.svelte | |
| parent | 1b2e6b54f6ef394ab6b861ee30de8f36f583bff8 (diff) | |
| download | coinos-ui-a592f4dff28577e9123a5bcca1e46335028f42c4.tar.gz coinos-ui-a592f4dff28577e9123a5bcca1e46335028f42c4.zip | |
avatar component and bg cover
Diffstat (limited to 'src/components/Avatar.svelte')
| -rw-r--r-- | src/components/Avatar.svelte | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/Avatar.svelte b/src/components/Avatar.svelte new file mode 100644 index 00000000..9b9547da --- /dev/null +++ b/src/components/Avatar.svelte @@ -0,0 +1,25 @@ +<script> + import { colorTheme, tempProfileFiles } from '$lib/store'; + import { Icon } from '$comp'; + + export let avatarPosition; + export let user; +</script> + +<div + class="rounded-full border-4 border-white overflow-hidden w-32 h-32 bg-gradient-to-r {$colorTheme} flex justify-center items-center" +> + <a href={`/${user.username}`}> + {#if user?.profile} + <img + src={$tempProfileFiles && $tempProfileFiles.profile + ? $tempProfileFiles.profile + : `/api/public/${user.username}-profile.png`} + class="w-full h-full object-cover object-center overflow-hidden" + alt={user.username} + /> + {:else} + <Icon icon="logo-symbol-white" /> + {/if} + </a> +</div> |
