misc: Add empty subscribed feed message

This commit is contained in:
Xyphyn committed 2023-07-25 19:19:18 -07:00
1 parent 516d908cf7
commit d42f8bc8af
4 files changed
+34 -5

No files matched your search

+17 -5
View File
@@ -17,6 +17,7 @@
GlobeAlt,
Icon,
Inbox,
MagnifyingGlass,
PencilSquare,
Plus,
UserCircle,
@@ -39,13 +40,24 @@
<div class="flex flex-row gap-2 items-center mr-auto">
<a href="/" class="flex flex-row items-center gap-2">
<Logo width={40} />
<span class="opacity-30 text-xl">/</span>
<span class="text-sm font-bold">
{$instance}
</span>
<div class="flex flex-row items-center gap-2 max-[400px]:hidden">
<span class="opacity-30 text-xl">/</span>
<span class="text-sm font-bold">
{$instance}
</span>
</div>
</a>
</div>
<div class="flex flex-row gap-2 py-2 px-3">
<div class="flex flex-row gap-2 py-2 px-2">
<Button
href="/search"
label="Search"
class="max-sm:w-9 max-sm:h-8 max-sm:!p-0 items-center justify-center
dark:text-zinc-300 text-slate-700 hover:text-inherit"
>
<Icon src={MagnifyingGlass} mini width={16} slot="icon" />
<span class="hidden sm:inline">Search</span>
</Button>
<Button
href="/communities"
label="Communities"
+15
View File
@@ -10,6 +10,7 @@
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { authData } from '$lib/lemmy.js'
import { userSettings } from '$lib/settings.js'
import { ArchiveBox, Icon, Plus } from 'svelte-hero-icons'
export let data
</script>
@@ -55,6 +56,20 @@
/>
</div>
<section class="flex flex-col gap-4">
{#if data.posts.posts.length == 0}
{#if data.listingType == 'Subscribed'}
<div
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center"
>
<Icon src={ArchiveBox} size="32" solid />
<h1 class="font-bold text-2xl">No posts</h1>
<Button href="/communities" class="mt-4">
<Icon src={Plus} size="16" mini slot="icon" />
<span>Follow some communities</span>
</Button>
</div>
{/if}
{/if}
{#each data.posts.posts as post, index (post.post.id)}
<div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}>
<Post {post} />
+2
View File
@@ -16,6 +16,8 @@ export async function load({ url }) {
try {
return {
sort: sort,
listingType: listingType,
posts: await getClient().getPosts({
limit: 20,
page: page,
View File
Whitespace-only changes.