diff --git a/src/lib/components/lemmy/community/CommunityItem.svelte b/src/lib/components/lemmy/community/CommunityItem.svelte index eeeeeee7..19f9be8b 100644 --- a/src/lib/components/lemmy/community/CommunityItem.svelte +++ b/src/lib/components/lemmy/community/CommunityItem.svelte @@ -24,32 +24,62 @@ import Entity from '$lib/components/ui/Entity.svelte' export let community: CommunityView + export let view: 'cozy' | 'compact' = 'compact' + export let showCounts: boolean = true let showInfo = false {#if showInfo} - + {/if} -
-
+
+
- +
+ + + +
+
+ {community.community.title} +
+
+ {new URL(community.community.actor_id).hostname} + {#if !showCounts} + • + + {/if} +
+
+
-
+
@@ -93,8 +123,8 @@
- {#if community.counts} -
+ {#if showCounts} +
{#if community.counts.posts}
-
- - - + -
-
- - + {#if showCounts} +
+ {#if user.counts.post_count} + + {/if} + {#if user.counts.comment_count} + + {/if}
-
- - -
-
+ {/if}
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 3129785d..c2def394 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -226,7 +226,9 @@ "title": "No Results", "description": "There are no results that match that filter. Try refining your search.", "alt": "Search across the fediverse" - } + }, + "top": "Top results", + "other": "Other results" }, "saved": "Saved", "createPost": "Create Post", diff --git a/src/routes/communities/+page.svelte b/src/routes/communities/+page.svelte index b25f1b5c..ed964fa3 100644 --- a/src/routes/communities/+page.svelte +++ b/src/routes/communities/+page.svelte @@ -16,6 +16,9 @@ import Location from '$lib/components/lemmy/dropdowns/Location.svelte' import { t } from '$lib/translations.js' import Header from '$lib/components/ui/layout/pages/Header.svelte' + import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte' + import { contentPadding } from '$lib/components/ui/layout/Shell.svelte' + import SectionTitle from '$lib/components/ui/SectionTitle.svelte' export let data @@ -55,35 +58,41 @@

- -
searchParam($page.url, 'q', search, 'page')} - class="flex gap-2 flex-row items-center" - slot="extended" - > - - - +
+ +
+ searchParam($page.url, 'q', search, 'page')} + class="flex gap-2 flex-row items-center w-full text-base h-10" + > + + + +
+
-
    +
      {#if data.communities.length == 0} {/if} - {#each data.communities as community} - + + {#if (data.query ?? '' != '') && data.communities.length > 0} + + {$t('routes.search.top')} + +
      + {#each data.communities.slice(0, 3) as community} + + + + {/each} +
      + {/if} + + {#if data.communities.slice(data.query ?? '' != '' ? 3 : 0).length > 0} + + {$t('routes.search.other')} + + {/if} + {#each data.communities.slice(data.query ?? '' != '' ? 3 : 0) as community} +
      + +
      {/each}
    {#if data.communities.length > 0} diff --git a/src/routes/search/+page.svelte b/src/routes/search/+page.svelte index aa952ad4..43b95b8a 100644 --- a/src/routes/search/+page.svelte +++ b/src/routes/search/+page.svelte @@ -35,6 +35,8 @@ import { slide } from 'svelte/transition' import { t } from '$lib/translations.js' import Header from '$lib/components/ui/layout/pages/Header.svelte' + import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte' + import { contentPadding } from '$lib/components/ui/layout/Shell.svelte' type Result = PostView | CommentView | PersonView | CommunityView @@ -53,29 +55,36 @@
    {$t('routes.search.title')} -
    searchParam($page.url, 'q', query, 'page')} - class="flex flex-row gap-2 items-center" - slot="extended" - > - - -
    +
    + +
    + searchParam($page.url, 'q', query, 'page')} + class="flex gap-2 flex-row items-center w-full text-base h-10" + > + + + +
    +