feat: Add community sidebar in mobile view
This commit is contained in:
1 parent
1a872152d4
commit
46ad2fe72b
4 files changed
+79
-58
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
|
import Card from '$lib/components/ui/Card.svelte'
|
||||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
||||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div
|
<div
|
||||||
class="sticky top-20 border bg-white shadow-md border-slate-100
|
class="sticky top-20 border bg-white shadow-md border-slate-100
|
||||||
dark:border-zinc-800 dark:bg-zinc-900 break-words hidden lg:flex
|
dark:border-zinc-800 dark:bg-zinc-900 break-words flex
|
||||||
flex-col gap-4 p-8 max-w-[20rem] w-full flex-shrink-0 rounded-md h-max max-h-[calc(100vh-6rem)]
|
flex-col gap-4 p-8 max-w-[20rem] w-full flex-shrink-0 rounded-md h-max max-h-[calc(100vh-6rem)]
|
||||||
overflow-auto"
|
overflow-auto"
|
||||||
>
|
>
|
||||||
|
|||||||
+30
-28
@@ -65,38 +65,40 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#await data.streamed.site}
|
<div class="hidden md:block">
|
||||||
<StickyCard>
|
{#await data.streamed.site}
|
||||||
<div
|
<StickyCard>
|
||||||
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
<div
|
||||||
|
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
||||||
dark:bg-zinc-700 animate-pulse"
|
dark:bg-zinc-700 animate-pulse"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-36 mt-4 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-36 mt-4 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
</StickyCard>
|
</StickyCard>
|
||||||
{:then site}
|
{:then site}
|
||||||
<SiteCard site={site.site_view} />
|
<SiteCard site={site.site_view} />
|
||||||
{:catch}
|
{:catch}
|
||||||
<StickyCard>
|
<StickyCard>
|
||||||
<h1 class="font-bold text-lg">Failed to load</h1>
|
<h1 class="font-bold text-lg">Failed to load</h1>
|
||||||
</StickyCard>
|
</StickyCard>
|
||||||
{/await}
|
{/await}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
import Card from '$lib/components/ui/StickyCard.svelte'
|
import Card from '$lib/components/ui/StickyCard.svelte'
|
||||||
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
||||||
import Button from '$lib/components/input/Button.svelte'
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
|
import { Color } from '$lib/ui/colors'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
</script>
|
</script>
|
||||||
@@ -15,7 +16,22 @@
|
|||||||
<title>{data.posts.posts[0]?.community.name}</title>
|
<title>{data.posts.posts[0]?.community.name}</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-row gap-4 w-full">
|
<div class="flex flex-col md:flex-row gap-4 w-full">
|
||||||
|
<div class="md:hidden">
|
||||||
|
{#await data.streamed.community then community}
|
||||||
|
<details>
|
||||||
|
<summary class="flex flex-row">
|
||||||
|
<div
|
||||||
|
class="{Color.secondary} px-3 py-1 transition-colors text-sm
|
||||||
|
rounded-md cursor-pointer mb-1"
|
||||||
|
>
|
||||||
|
Sidebar
|
||||||
|
</div>
|
||||||
|
</summary>
|
||||||
|
<CommunityCard community_view={community.community_view} />
|
||||||
|
</details>
|
||||||
|
{/await}
|
||||||
|
</div>
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
@@ -52,38 +68,40 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#await data.streamed.community}
|
<div class="hidden md:block">
|
||||||
<Card>
|
{#await data.streamed.community}
|
||||||
<div
|
<Card>
|
||||||
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
<div
|
||||||
|
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
||||||
dark:bg-zinc-700 animate-pulse"
|
dark:bg-zinc-700 animate-pulse"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-36 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-36 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||||
rounded-md"
|
rounded-md"
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
{:then community}
|
{:then community}
|
||||||
<CommunityCard community_view={community.community_view} />
|
<CommunityCard community_view={community.community_view} />
|
||||||
{:catch}
|
{:catch}
|
||||||
<Card>
|
<Card>
|
||||||
<p>Failed to load community. This is likely an issue on Lemmy's end.</p>
|
<p>Failed to load community. This is likely an issue on Lemmy's end.</p>
|
||||||
</Card>
|
</Card>
|
||||||
{/await}
|
{/await}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user