impr: add view select to community page

This commit is contained in:
James Xylight committed 2025-07-11 11:20:06 -07:00
1 parent 3b00845806
commit 020b0080a5
1 file changed
+14 -12
+14 -12
View File
@@ -5,6 +5,7 @@
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import CommunityHeader from '$lib/components/lemmy/community/CommunityHeader.svelte'
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
@@ -61,8 +62,7 @@
</Modal>
{/if}
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<Header pageHeader>
<Header pageHeader>
<div class="flex flex-col w-full">
<CommunityHeader
bind:community={data.community.value.community_view.community}
@@ -74,11 +74,14 @@
/>
</div>
{#snippet extended()}
<div class="flex flex-row gap-2">
<Sort selected={data.sort} />
<ViewSelect showLabel />
</div>
{/snippet}
</Header>
</Header>
{#if profile.data.user}
{#if profile.data.user}
{#if !data.community.value.discussion_languages.every( l => profile.data.user?.discussion_languages.includes(l), ) && profile.data.user.discussion_languages.length > 0}
{@const missing = data.community.value.discussion_languages.filter(
i => !profile.data.user?.discussion_languages.includes(i),
@@ -112,9 +115,9 @@
{/if}
</div>
{/if}
{/if}
{/if}
{#if data.community.value.community_view.blocked}
{#if data.community.value.community_view.blocked}
<Placeholder
icon={XMark}
title="Blocked"
@@ -127,7 +130,7 @@
Blocked Communities
</Button>
</Placeholder>
{:else}
{:else}
{@const SvelteComponent = browser ? VirtualFeed : PostFeed}
<SvelteComponent
posts={data.posts.posts}
@@ -135,12 +138,12 @@
feedId="community"
community
/>
{/if}
{/if}
<svelte:element
<svelte:element
this={settings.infiniteScroll ? 'noscript' : 'div'}
class="mt-auto"
>
>
<Pageination
page={data.page}
cursor={{ next: data.cursor.next }}
@@ -154,8 +157,7 @@
})}
</span>
</Pageination>
</svelte:element>
</div>
</svelte:element>
<style>
</style>