feat: show number of unread messages in inbox
This commit is contained in:
1 parent
c1abaa386a
commit
5c3ba8e298
2 files changed
+22
-30
No files matched your search
@@ -214,14 +214,15 @@
|
||||
<Icon src={UserCircle} mini width={16} /> Profile
|
||||
</MenuButton>
|
||||
<MenuButton link href="/inbox">
|
||||
<div class="relative">
|
||||
{#if $profile.user.unreads > 0}
|
||||
<div
|
||||
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
|
||||
/>
|
||||
{/if}<Icon src={Inbox} mini width={16} />
|
||||
</div>
|
||||
<Icon src={Inbox} mini width={16} />
|
||||
Inbox
|
||||
{#if $profile.user.unreads > 0}
|
||||
<div
|
||||
class="rounded-full w-auto flex items-center px-2 h-5 justify-center font-bold bg-red-500 ml-auto"
|
||||
>
|
||||
{$profile.user.unreads}
|
||||
</div>
|
||||
{/if}
|
||||
</MenuButton>
|
||||
<MenuButton link href="/saved">
|
||||
<Icon src={Bookmark} mini width={16} /> Saved
|
||||
|
||||
@@ -6,20 +6,13 @@
|
||||
GlobeAlt,
|
||||
Home,
|
||||
Icon,
|
||||
Plus,
|
||||
UserCircle,
|
||||
UserGroup,
|
||||
} from 'svelte-hero-icons'
|
||||
import Button from '../../input/Button.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { profile, profileData, setUserID } from '$lib/auth.js'
|
||||
import { profile, profileData } from '$lib/auth.js'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
import { slide } from 'svelte/transition'
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import CommunityList from '$lib/components/ui/sidebar/CommunityList.svelte'
|
||||
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
|
||||
import ProfileButton from '$lib/components/ui/sidebar/ProfileButton.svelte'
|
||||
import { flip } from 'svelte/animate'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
@@ -49,11 +42,11 @@
|
||||
/>
|
||||
</Button>
|
||||
<SidebarButton href="/" expanded={$userSettings.expandSidebar}>
|
||||
<Icon src={Home} solid size="20" title="Frontpage" />
|
||||
<Icon src={Home} mini size="18" title="Frontpage" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Frontpage</span>
|
||||
</SidebarButton>
|
||||
<SidebarButton href="/settings" expanded={$userSettings.expandSidebar}>
|
||||
<Icon src={Cog6Tooth} solid size="20" title="Settings" />
|
||||
<Icon src={Cog6Tooth} mini size="18" title="Settings" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Settings</span>
|
||||
</SidebarButton>
|
||||
{#if $profileData.profiles.length >= 1}
|
||||
@@ -64,7 +57,7 @@
|
||||
</div>
|
||||
{/each}
|
||||
<SidebarButton href="/accounts" expanded={$userSettings.expandSidebar}>
|
||||
<Icon src={UserGroup} mini size="20" />
|
||||
<Icon src={UserGroup} mini size="18" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Accounts</span>
|
||||
</SidebarButton>
|
||||
{/if}
|
||||
@@ -82,17 +75,15 @@
|
||||
expanded={$userSettings.expandSidebar}
|
||||
items={$profile.user.follows.map((i) => i.community)}
|
||||
/>
|
||||
{#if $profile.user.follows.length == 0}
|
||||
<Button
|
||||
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}"
|
||||
href="/communities"
|
||||
color="tertiary"
|
||||
alignment="left"
|
||||
>
|
||||
<Icon src={GlobeAlt} size="20" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Communities</span>
|
||||
</Button>
|
||||
{/if}
|
||||
<Button
|
||||
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}"
|
||||
href="/communities"
|
||||
color="tertiary"
|
||||
alignment="left"
|
||||
>
|
||||
<Icon mini src={GlobeAlt} size="18" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Communities</span>
|
||||
</Button>
|
||||
{:else}
|
||||
<Button
|
||||
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}"
|
||||
@@ -100,7 +91,7 @@
|
||||
color="tertiary"
|
||||
alignment="left"
|
||||
>
|
||||
<Icon src={ArrowLeftOnRectangle} solid size="20" />
|
||||
<Icon mini src={ArrowLeftOnRectangle} size="18" />
|
||||
<span class:hidden={!$userSettings.expandSidebar}>Log in</span>
|
||||
</Button>
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user