feat: add community sidebar
This commit is contained in:
1 parent
c4e12b5b30
commit
86dd44adb7
2 files changed
+69
-24
No files matched your search
+41
-10
@@ -7,6 +7,10 @@
|
||||
import ToastContainer from '$lib/components/ui/toasts/ToastContainer.svelte'
|
||||
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import { user } from '$lib/lemmy.js'
|
||||
import Button from '$lib/components/input/Button.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { Home, Icon } from 'svelte-hero-icons'
|
||||
|
||||
nProgress.configure({
|
||||
minimum: 0.4,
|
||||
@@ -30,13 +34,40 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Navbar />
|
||||
<ToastContainer />
|
||||
<Moderation />
|
||||
<main
|
||||
class="flex-1 p-4 w-full mx-auto"
|
||||
class:max-w-full={$userSettings.fullWidthLayout}
|
||||
class:max-w-5xl={!$userSettings.fullWidthLayout}
|
||||
>
|
||||
<slot />
|
||||
</main>
|
||||
<div class="flex flex-col">
|
||||
<Navbar />
|
||||
<ToastContainer />
|
||||
<Moderation />
|
||||
<div
|
||||
class="flex flex-row w-full max-w-full gap-4 divide-x dark:divide-zinc-800 divide-slate-200 flex-1"
|
||||
>
|
||||
<nav
|
||||
class="hidden lg:flex flex-col p-4 overflow-auto sticky top-16 bottom-0 flex-1 gap-1 max-h-[calc(100vh-4rem)]"
|
||||
>
|
||||
<Button href="/" color="tertiary" alignment="left">
|
||||
<Icon src={Home} solid size="20" />
|
||||
Frontpage
|
||||
</Button>
|
||||
{#if $user}
|
||||
{#each $user.follows.map((f) => f.community) as follow}
|
||||
<Button
|
||||
color="tertiary"
|
||||
alignment="left"
|
||||
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
|
||||
>
|
||||
<Avatar
|
||||
url={follow.icon}
|
||||
alt={follow.name}
|
||||
width={20}
|
||||
slot="icon"
|
||||
/>
|
||||
{follow.title}
|
||||
</Button>
|
||||
{/each}
|
||||
{/if}
|
||||
</nav>
|
||||
<main class="p-4 mx-auto flex-[4]">
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user