mirror of
https://github.com/Blah-IM/Weblah.git
synced 2025-04-30 16:21:09 +00:00
refactor: ProfilePicture to use Identity instead of Account
This commit is contained in:
parent
308eef1cff
commit
055f7240df
1 changed files with 8 additions and 8 deletions
|
@ -1,25 +1,25 @@
|
|||
<script lang="ts">
|
||||
import type { Account } from '$lib/accounts/accountStore';
|
||||
import type { BlahIdentityDescription } from '@blah-im/core/identity';
|
||||
import { AvatarBeam } from 'svelte-boring-avatars';
|
||||
|
||||
interface Props {
|
||||
account: Account | undefined;
|
||||
identity: BlahIdentityDescription | undefined;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
let { account, size = 32 }: Props = $props();
|
||||
let { identity, size = 32 }: Props = $props();
|
||||
</script>
|
||||
|
||||
{#if account}
|
||||
{#key account.id_key}
|
||||
<AvatarBeam {size} name={account.id_key} />
|
||||
{#if identity}
|
||||
{#key identity.id_key}
|
||||
<AvatarBeam {size} name={identity.id_key} />
|
||||
{/key}
|
||||
<span class="sr-only">{account.profile.signee.payload.name}</span>
|
||||
<span class="sr-only">{identity.profile.signee.payload.name}</span>
|
||||
{:else}
|
||||
<div
|
||||
class="border-ss-primary box-border size-(--weblah-profile-pic-size) rounded-full border-2 border-dashed"
|
||||
style:--weblah-profile-pic-size={`${size}px`}
|
||||
aria-hidden="true"
|
||||
></div>
|
||||
<span class="sr-only">Account Unavailable</span>
|
||||
<span class="sr-only">Identity Unavailable</span>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Reference in a new issue