feat: multiple guest account support
This commit is contained in:
1 parent
e90d484755
commit
c172327923
7 files changed
+192
-90
No files matched your search
@@ -5,6 +5,7 @@
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Icon, QuestionMarkCircle } from 'svelte-hero-icons'
|
||||
|
||||
export let prof: Profile
|
||||
export let index: number
|
||||
@@ -46,8 +47,9 @@
|
||||
slot="icon"
|
||||
/>
|
||||
<span
|
||||
class="flex flex-col gap-0 {$profile?.id == prof.id ? 'font-semibold' : ''}"
|
||||
slot="label"
|
||||
class="inline-flex flex-col gap-0 {$profile?.id == prof.id
|
||||
? 'font-semibold'
|
||||
: ''}"
|
||||
>
|
||||
{prof.username ?? prof.user?.local_user_view.person.name}
|
||||
{#if !guest}
|
||||
@@ -56,4 +58,7 @@
|
||||
</span>
|
||||
{/if}
|
||||
</span>
|
||||
{#if !prof.jwt}
|
||||
<Icon src={QuestionMarkCircle} size="14" micro class="ml-auto opacity-50" />
|
||||
{/if}
|
||||
</SidebarButton>
|
||||
@@ -77,15 +77,6 @@
|
||||
<ProfileButton {index} {prof} />
|
||||
</div>
|
||||
{/each}
|
||||
<ProfileButton
|
||||
index={0}
|
||||
prof={{
|
||||
id: -1,
|
||||
instance: $profileData?.defaultInstance ?? DEFAULT_INSTANCE_URL,
|
||||
username: 'Guest',
|
||||
}}
|
||||
guest
|
||||
/>
|
||||
<SidebarButton href="/accounts" icon={UserGroup}>
|
||||
<span slot="label">Accounts</span>
|
||||
</SidebarButton>
|
||||
|
||||
Reference in new issue
Block a user