diff options
| author | secondl1ght <[email protected]> | 2022-09-13 19:48:48 -0600 |
|---|---|---|
| committer | secondl1ght <[email protected]> | 2022-09-13 19:48:48 -0600 |
| commit | ae3ef68f5ad8eceddb2db88b41021fadbf4cb919 (patch) | |
| tree | 7e82ccf87efeef611249a933fde23a7d8ed5d62e /src/components/AppHeader.svelte | |
| parent | 59ea4191e841ad96afebed992243c7cc0e9968d5 (diff) | |
| download | coinos-ui-ae3ef68f5ad8eceddb2db88b41021fadbf4cb919.tar.gz coinos-ui-ae3ef68f5ad8eceddb2db88b41021fadbf4cb919.zip | |
banner and avatar upload refactoring
Diffstat (limited to 'src/components/AppHeader.svelte')
| -rw-r--r-- | src/components/AppHeader.svelte | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 35e6f250..8b10f19e 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -1,6 +1,6 @@ <script> import OutClick from 'svelte-outclick'; - import { user, newPayment, colorTheme } from '$lib/store'; + import { user, newPayment, colorTheme, tempProfileFiles } from '$lib/store'; import { goto } from '$app/navigation'; import { Icon } from '$comp'; import { t } from '$lib/translations'; @@ -25,7 +25,7 @@ } }; - $: background = $user?.banner ? `url(/api/public/${$user.username}-banner.png)` : undefined; + $: background = $tempProfileFiles && $tempProfileFiles.banner ? `url(${$tempProfileFiles.banner})` : $user?.banner ? `url(/api/public/${$user.username}-banner.png)` : undefined; </script> <header class="bg-gradient-to-r {$colorTheme} h-[175px] w-full relative" style:background> @@ -94,7 +94,7 @@ {#if $user.profile} <div class="absolute top-[calc(175px-48px)] {avatarPosition} rounded-full overflow-hidden text-center w-24 h-24 my-auto"> <img - src={`/api/public/${$user.username}-profile.png`} + src={$tempProfileFiles && $tempProfileFiles.profile ? $tempProfileFiles.profile : `/api/public/${$user.username}-profile.png`} class="absolute w-full h-full object-cover object-center visible overflow-hidden" /> </div> |
