misc: add a scroll to top button
This commit is contained in:
1 parent
f56167099d
commit
4f52f2cc11
2 files changed
+10
-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,7 +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';
|
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
|
||||||
@@ -282,6 +283,10 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
community_name: feedData.community_name ?? 'undefined',
|
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>
|
</EndPlaceholder>
|
||||||
</div>
|
</div>
|
||||||
{/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>
|
||||||
Reference in new issue
Block a user