misc: Add empty search to community search
This commit is contained in:
1 parent
d42f8bc8af
commit
2f1257fffa
1 file changed
+29
-16
@@ -6,6 +6,7 @@
|
|||||||
ChatBubbleOvalLeftEllipsis,
|
ChatBubbleOvalLeftEllipsis,
|
||||||
Icon,
|
Icon,
|
||||||
PencilSquare,
|
PencilSquare,
|
||||||
|
QuestionMarkCircle,
|
||||||
UserGroup,
|
UserGroup,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
||||||
@@ -60,6 +61,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="flex flex-col">
|
<ul class="flex flex-col">
|
||||||
|
{#if data.communities.length == 0}
|
||||||
|
<div
|
||||||
|
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center py-8"
|
||||||
|
>
|
||||||
|
<Icon src={QuestionMarkCircle} size="32" solid />
|
||||||
|
<h1 class="font-bold text-2xl">No communities</h1>
|
||||||
|
<p class="mt-2 text-center">
|
||||||
|
There are no communities with that name. Try refining your search.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{#each data.communities as community}
|
{#each data.communities as community}
|
||||||
<li>
|
<li>
|
||||||
<div
|
<div
|
||||||
@@ -131,20 +143,21 @@
|
|||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
{#if data.communities.length > 0}
|
||||||
|
<div class="mt-2 w-full">
|
||||||
|
<Button
|
||||||
|
on:click={() => {
|
||||||
|
$page.url.searchParams.set(
|
||||||
|
'page',
|
||||||
|
((Number($page.url.searchParams.get('page')) || 1) + 1).toString()
|
||||||
|
)
|
||||||
|
|
||||||
<div class="mt-2 w-full">
|
goto($page.url.toString(), {
|
||||||
<Button
|
invalidateAll: true,
|
||||||
on:click={() => {
|
})
|
||||||
$page.url.searchParams.set(
|
}}
|
||||||
'page',
|
>
|
||||||
((Number($page.url.searchParams.get('page')) || 1) + 1).toString()
|
Next
|
||||||
)
|
</Button>
|
||||||
|
</div>
|
||||||
goto($page.url.toString(), {
|
{/if}
|
||||||
invalidateAll: true,
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Next
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
Reference in new issue
Block a user