impr: rewrite Tabs selection detection
This commit is contained in:
14 files changed
+106
-73
No files matched your search
@@ -6,7 +6,9 @@
|
||||
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
||||
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { site } from '$lib/lemmy.svelte.js'
|
||||
@@ -57,6 +59,15 @@
|
||||
{/snippet}
|
||||
</Header>
|
||||
|
||||
<!-- <EndPlaceholder size="md">
|
||||
{$t('cards.community.activeDay')}
|
||||
{#snippet action()}
|
||||
<span class="text-primary-900 dark:text-primary-100">
|
||||
{site.data?.site_view.counts.users_active_day.toString()}
|
||||
</span>
|
||||
{/snippet}
|
||||
</EndPlaceholder> -->
|
||||
|
||||
<FeedComponent
|
||||
bind:posts={data.feed.value.posts.posts}
|
||||
bind:feedData={() => data.feed.value, v => (postFeeds.value.main.data = v)}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
{$t('nav.create.label')}
|
||||
</Header>
|
||||
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
<Tabs
|
||||
style="subpage"
|
||||
routes={[
|
||||
@@ -24,6 +23,5 @@
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
|
||||
{@render children?.()}
|
||||
@@ -73,8 +73,6 @@
|
||||
</div>
|
||||
</Header>
|
||||
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
|
||||
<div class="mb-3 sm:mb-6">
|
||||
<Select
|
||||
class=" w-max items-center"
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
{@render startChat?.()}
|
||||
</Placeholder>
|
||||
{/if}
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
<CommonList items={previews}>
|
||||
{#snippet item(preview)}
|
||||
<a href="/inbox/messages/{preview.user.id}" class="flex flex-row gap-2">
|
||||
|
||||
@@ -15,5 +15,4 @@
|
||||
{ href: '/instances/blocked', name: 'Blocked' },
|
||||
]}
|
||||
></Tabs>
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
{@render children?.()}
|
||||
@@ -61,8 +61,6 @@
|
||||
{/snippet}
|
||||
</Header>
|
||||
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
|
||||
{#if !data.data || (data.data?.length ?? 0) == 0}
|
||||
<Placeholder
|
||||
icon={Bookmark}
|
||||
|
||||
@@ -54,44 +54,52 @@
|
||||
|
||||
<Header pageHeader>
|
||||
{$t('routes.search.title')}
|
||||
{#snippet extended()}
|
||||
<form
|
||||
method="get"
|
||||
action="/search"
|
||||
class="flex flex-col gap-4"
|
||||
bind:this={form}
|
||||
>
|
||||
<SearchBar bind:query={data.filters.value.query} />
|
||||
<div class="flex flex-row flex-wrap items-center gap-4">
|
||||
<Select
|
||||
name="type"
|
||||
bind:value={data.filters.value.type}
|
||||
onchange={() => form?.requestSubmit()}
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
<span class="flex items-center gap-1">
|
||||
<Icon src={AdjustmentsHorizontal} mini size="15" />
|
||||
{$t('filter.type')}
|
||||
</span>
|
||||
{/snippet}
|
||||
<Option value="All">{$t('content.all')}</Option>
|
||||
<Option value="Posts">{$t('content.posts')}</Option>
|
||||
<Option value="Comments">{$t('content.comments')}</Option>
|
||||
<Option value="Communities">{$t('content.communities')}</Option>
|
||||
<Option value="Users">{$t('content.users')}</Option>
|
||||
<Option value="Url">{$t('content.url')}</Option>
|
||||
</Select>
|
||||
<Sort
|
||||
name="sort"
|
||||
bind:selected={data.filters.value.sort}
|
||||
onchange={() => form?.requestSubmit()}
|
||||
/>
|
||||
<Button
|
||||
size="custom"
|
||||
rounding="xl"
|
||||
class="self-end justify-self-center h-8.5 w-8.5"
|
||||
onclick={() => (moreOptions = !moreOptions)}
|
||||
aria-label={$t('post.actions.more.label')}
|
||||
>
|
||||
<Icon src={ChevronDoubleDown} size="20" mini />
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
{/snippet}
|
||||
</Header>
|
||||
<form method="get" action="/search" class="contents" bind:this={form}>
|
||||
<SearchBar bind:query={data.filters.value.query} />
|
||||
<div class="flex flex-row flex-wrap items-center gap-4 my-4 sm:my-6">
|
||||
<Select
|
||||
name="type"
|
||||
bind:value={data.filters.value.type}
|
||||
onchange={() => form?.requestSubmit()}
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
<span class="flex items-center gap-1">
|
||||
<Icon src={AdjustmentsHorizontal} mini size="15" />
|
||||
{$t('filter.type')}
|
||||
</span>
|
||||
{/snippet}
|
||||
<Option value="All">{$t('content.all')}</Option>
|
||||
<Option value="Posts">{$t('content.posts')}</Option>
|
||||
<Option value="Comments">{$t('content.comments')}</Option>
|
||||
<Option value="Communities">{$t('content.communities')}</Option>
|
||||
<Option value="Users">{$t('content.users')}</Option>
|
||||
<Option value="Url">{$t('content.url')}</Option>
|
||||
</Select>
|
||||
<Sort
|
||||
name="sort"
|
||||
bind:selected={data.filters.value.sort}
|
||||
onchange={() => form?.requestSubmit()}
|
||||
/>
|
||||
<Button
|
||||
size="custom"
|
||||
rounding="xl"
|
||||
class="self-end justify-self-center h-8.5 w-8.5"
|
||||
onclick={() => (moreOptions = !moreOptions)}
|
||||
aria-label={$t('post.actions.more.label')}
|
||||
>
|
||||
<Icon src={ChevronDoubleDown} size="20" mini />
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{#if moreOptions}
|
||||
<div
|
||||
transition:slide={{ axis: 'y', easing: expoOut, duration: 500 }}
|
||||
|
||||
@@ -96,8 +96,6 @@
|
||||
{/snippet}
|
||||
</Header>
|
||||
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
|
||||
<Tabs
|
||||
routes={[
|
||||
{
|
||||
@@ -122,8 +120,6 @@
|
||||
},
|
||||
]}
|
||||
style="subpage"
|
||||
></Tabs>
|
||||
|
||||
<div class="h-3 sm:h-6"></div>
|
||||
/>
|
||||
|
||||
{@render children?.()}
|
||||
Reference in new issue
Block a user