Merge pull request #385 from sevonj/feat-feed-end-indicator2

feat: feed end indicator (2)
This commit is contained in:
Xylight authored and GitHub committed 2024-08-02 13:33:44 -07:00
commit aef0236bb1
3 files changed
+22 -5

No files matched your search

@@ -11,6 +11,7 @@
import { Badge, Button } from 'mono-svelte'
import {
ArchiveBox,
ChevronDoubleUp,
ExclamationTriangle,
Icon,
Minus,
@@ -36,6 +37,7 @@
import { t } from '$lib/translations'
import InfiniteScroll from 'svelte-infinite-scroll'
import type { Readable } from 'svelte/motion'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
export let posts: PostView[]
export let community: boolean = false
@@ -222,7 +224,7 @@
bind:this={virtualItemEls[index]}
data-index={row.index}
class="relative post-container"
in:fly={{ y: -16, easing: expoOut, duration: 500, opacity: 0 }}
in:fly={{ y: -16, easing: expoOut, duration: 500, opacity: 0 }}
>
{#if posts[row.index]}
<Post
@@ -274,6 +276,19 @@
<div class="w-24 h-8"></div>
</div>
</div>
{:else}
<div style="border-top-width: 0">
<EndPlaceholder>
{$t('routes.frontpage.endFeed', {
// @ts-ignore
community_name: feedData.community_name ?? 'undefined',
})}
<Button slot="action" color="tertiary">
<Icon src={ChevronDoubleUp} size="16" micro slot="prefix" />
{$t('routes.post.scrollToTop')}
</Button>
</EndPlaceholder>
</div>
{/if}
<InfiniteScroll window threshold={1000} on:loadMore={loadMore} />
{/if}
+4 -3
View File
@@ -1,9 +1,10 @@
<div
class="flex flex-row items-center text-sm text-slate-600 dark:text-zinc-400 gap-2"
class="flex flex-col sm:flex-row items-center
text-sm text-slate-600 dark:text-zinc-400 gap-2"
>
<span class="font-medium">
<span class="font-medium text-center sm:text-left">
<slot />
</span>
<hr class="border-slate-200 flex-1 dark:border-zinc-800" />
<hr class="border-slate-200 sm:flex-1 w-full dark:border-zinc-800" />
<slot name="action" />
</div>