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
@@ -7,6 +7,7 @@
|
||||
import Card from '$lib/components/ui/StickyCard.svelte'
|
||||
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
||||
import Button from '$lib/components/input/Button.svelte'
|
||||
import { Color } from '$lib/ui/colors'
|
||||
|
||||
export let data
|
||||
</script>
|
||||
@@ -15,7 +16,22 @@
|
||||
<title>{data.posts.posts[0]?.community.name}</title>
|
||||
</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 sm:flex-row gap-4 max-w-full w-full">
|
||||
<MultiSelect
|
||||
@@ -52,38 +68,40 @@
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{#await data.streamed.community}
|
||||
<Card>
|
||||
<div
|
||||
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
||||
<div class="hidden md:block">
|
||||
{#await data.streamed.community}
|
||||
<Card>
|
||||
<div
|
||||
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
||||
dark:bg-zinc-700 animate-pulse"
|
||||
/>
|
||||
<div
|
||||
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
/>
|
||||
<div
|
||||
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
rounded-md"
|
||||
/>
|
||||
<div
|
||||
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
/>
|
||||
<div
|
||||
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
rounded-md"
|
||||
/>
|
||||
<div
|
||||
class="w-36 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
/>
|
||||
<div
|
||||
class="w-36 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
rounded-md"
|
||||
/>
|
||||
<div
|
||||
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
/>
|
||||
<div
|
||||
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
rounded-md"
|
||||
/>
|
||||
<div
|
||||
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
/>
|
||||
<div
|
||||
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
||||
rounded-md"
|
||||
/>
|
||||
</Card>
|
||||
{:then community}
|
||||
<CommunityCard community_view={community.community_view} />
|
||||
{:catch}
|
||||
<Card>
|
||||
<p>Failed to load community. This is likely an issue on Lemmy's end.</p>
|
||||
</Card>
|
||||
{/await}
|
||||
/>
|
||||
</Card>
|
||||
{:then community}
|
||||
<CommunityCard community_view={community.community_view} />
|
||||
{:catch}
|
||||
<Card>
|
||||
<p>Failed to load community. This is likely an issue on Lemmy's end.</p>
|
||||
</Card>
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user