Update dependencies
This commit is contained in:
1 parent
7b674a610d
commit
b42289125e
12 files changed
+762
-1193
No files matched your search
@@ -1,36 +1,57 @@
|
||||
<script lang="ts">
|
||||
import { playletStateStore } from "lib/Stores";
|
||||
export let profile = null;
|
||||
export let navbar = false;
|
||||
export let selected = false;
|
||||
import UserIcon from "assets/user.svg.svelte";
|
||||
import { playletStateStore } from "lib/Stores";
|
||||
|
||||
let currentProfile;
|
||||
let currentProfile = profile;
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
let profiles = value?.profiles?.profiles ?? [];
|
||||
currentProfile = profiles.find(
|
||||
(p) => p.id === value?.profiles?.currentProfile
|
||||
);
|
||||
});
|
||||
if (!profile) {
|
||||
playletStateStore.subscribe((value) => {
|
||||
let profiles = value?.profiles?.profiles ?? [];
|
||||
currentProfile = profiles.find(
|
||||
(p) => p.id === value?.profiles?.currentProfile
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{#if currentProfile && currentProfile.username}
|
||||
<div class="avatar placeholder m-1.5">
|
||||
<div
|
||||
class="rounded-full w-8 ring ring-offset-base-100 ring-offset-2"
|
||||
style="background-color: {currentProfile.color}"
|
||||
>
|
||||
{#if currentProfile.type === "youtube" && currentProfile.thumbnail}
|
||||
<img src={currentProfile.thumbnail} alt="Avatar" />
|
||||
{:else}
|
||||
<span class="text-xl font-medium text-gray-200"
|
||||
>{currentProfile.username.substring(0, 1).toUpperCase()}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
{#if currentProfile && currentProfile.username}
|
||||
<div class={`avatar ${navbar ? "w-8 h-8 m-1" : "w-12 h-12"}`}>
|
||||
<div
|
||||
class={`rounded-full flex items-center justify-center w-full h-full
|
||||
${
|
||||
navbar
|
||||
? "border-2 border-primary"
|
||||
: selected
|
||||
? "ring ring-primary ring-offset-base-100 ring-offset-2"
|
||||
: "ring ring-offset-base-100 ring-offset-2"
|
||||
}
|
||||
`}
|
||||
style="background-color: {currentProfile.color};"
|
||||
>
|
||||
{#if currentProfile.type === "youtube" && currentProfile.thumbnail}
|
||||
<img
|
||||
src={currentProfile.thumbnail}
|
||||
alt="Avatar"
|
||||
class="object-cover w-full h-full rounded-full"
|
||||
/>
|
||||
{:else}
|
||||
<span
|
||||
class="text-lg font-medium text-gray-200 flex items-center justify-center w-full h-full"
|
||||
>
|
||||
{currentProfile.username.substring(0, 1).toUpperCase()}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="w-8 rounded-full">
|
||||
</div>
|
||||
{:else}
|
||||
<div class={`avatar ${navbar ? "w-8 h-8 m-1" : "w-12 h-12"}`}>
|
||||
<div
|
||||
class="rounded-full bg-base-300 w-full h-full flex items-center justify-center"
|
||||
>
|
||||
<UserIcon />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
Reference in new issue
Block a user