Merge pull request #385 from sevonj/feat-feed-end-indicator2
feat: feed end indicator (2)
This commit is contained in:
3 files changed
+22
-5
No files matched your search
@@ -11,6 +11,7 @@
|
|||||||
import { Badge, Button } from 'mono-svelte'
|
import { Badge, Button } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArchiveBox,
|
ArchiveBox,
|
||||||
|
ChevronDoubleUp,
|
||||||
ExclamationTriangle,
|
ExclamationTriangle,
|
||||||
Icon,
|
Icon,
|
||||||
Minus,
|
Minus,
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import InfiniteScroll from 'svelte-infinite-scroll'
|
import InfiniteScroll from 'svelte-infinite-scroll'
|
||||||
import type { Readable } from 'svelte/motion'
|
import type { Readable } from 'svelte/motion'
|
||||||
|
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||||
|
|
||||||
export let posts: PostView[]
|
export let posts: PostView[]
|
||||||
export let community: boolean = false
|
export let community: boolean = false
|
||||||
@@ -222,7 +224,7 @@
|
|||||||
bind:this={virtualItemEls[index]}
|
bind:this={virtualItemEls[index]}
|
||||||
data-index={row.index}
|
data-index={row.index}
|
||||||
class="relative post-container"
|
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]}
|
{#if posts[row.index]}
|
||||||
<Post
|
<Post
|
||||||
@@ -274,6 +276,19 @@
|
|||||||
<div class="w-24 h-8"></div>
|
<div class="w-24 h-8"></div>
|
||||||
</div>
|
</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}
|
{/if}
|
||||||
<InfiniteScroll window threshold={1000} on:loadMore={loadMore} />
|
<InfiniteScroll window threshold={1000} on:loadMore={loadMore} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<div
|
<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 />
|
<slot />
|
||||||
</span>
|
</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" />
|
<slot name="action" />
|
||||||
</div>
|
</div>
|
||||||
@@ -183,7 +183,8 @@
|
|||||||
"routes": {
|
"routes": {
|
||||||
"frontpage": {
|
"frontpage": {
|
||||||
"title": "Frontpage",
|
"title": "Frontpage",
|
||||||
"footer": "{{users:number}} active {{users; 1:user; default:users;}}"
|
"footer": "{{users:number}} active {{users; 1:user; default:users;}}",
|
||||||
|
"endFeed": "You have reached the end of {{community_name; undefined:the feed.; default:{{community_name}}.}}"
|
||||||
},
|
},
|
||||||
"modlog": "Modlog",
|
"modlog": "Modlog",
|
||||||
"instances": "Instances",
|
"instances": "Instances",
|
||||||
|
|||||||
Reference in new issue
Block a user