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
+21 -4

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
@@ -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}
+4 -3
View File
@@ -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>
+2 -1
View File
@@ -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",