feat: add community search to search page

This commit is contained in:
Xyphyn committed 2023-09-04 10:49:31 -07:00
1 parent 819fde66ab
commit e946d0de48
44 files changed
+79 -218

No files matched your search

+3 -2
View File
@@ -14,7 +14,7 @@
<div class="flex flex-row gap-4 flex-wrap">
{#if selected?.startsWith('Top')}
<div class="w-32" transition:fly={{ x: 4 }}>
<div transition:fly={{ x: 4 }}>
<Select
bind:value={selected}
on:change={(e) => {
@@ -45,7 +45,6 @@
setSelected()
if (navigate) searchParam($page.url, 'sort', selected, 'page')
}}
class="w-32"
>
<span slot="label" class="flex items-center gap-1">
<Icon src={ChartBar} size="14" mini />
@@ -56,5 +55,7 @@
<option value="TopAll">Top</option>
<option value="New">New</option>
<option value="Old">Old</option>
<option value="MostComments">Most Comments</option>
<option value="NewComments">New Comments</option>
</Select>
</div>
@@ -15,7 +15,7 @@
import Markdown from '$lib/components/markdown/Markdown.svelte'
import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte'
import { getClient } from '$lib/lemmy.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { profile } from '$lib/auth.js'
import { Button, Modal } from 'mono-svelte'
@@ -18,7 +18,7 @@
Trash,
} from 'svelte-hero-icons'
import { getClient, getInstance } from '$lib/lemmy.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { createEventDispatcher } from 'svelte'
@@ -5,7 +5,7 @@
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import { profile } from '$lib/auth.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { placeholders } from '$lib/util.js'
import { Button } from 'mono-svelte'
@@ -7,7 +7,7 @@
import { getClient } from '$lib/lemmy.js'
import type { CommentView, Post } from 'lemmy-js-client'
import { fly } from 'svelte/transition'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
@@ -5,7 +5,7 @@
import Avatar from '$lib/components/ui/Avatar.svelte'
import Card from '$lib/components/ui/Card.svelte'
import StickyCard from '$lib/components/ui/StickyCard.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { getClient } from '$lib/lemmy.js'
@@ -3,7 +3,7 @@
import { profile } from '$lib/auth.js'
import FileInput from '$lib/components/input/FileInput.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { getClient, uploadImage } from '$lib/lemmy.js'
import { addSubscription } from '$lib/lemmy/user.js'
import { Button, Checkbox, TextInput } from 'mono-svelte'
@@ -1,7 +1,7 @@
<script lang="ts">
import { profile } from '$lib/auth.js'
import FileInput from '$lib/components/input/FileInput.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { uploadImage } from '$lib/lemmy.js'
import { Button, Modal } from 'mono-svelte'
import { createEventDispatcher } from 'svelte'
@@ -2,7 +2,7 @@
import Avatar from '$lib/components/ui/Avatar.svelte'
import type { Community, Person, PersonView } from 'lemmy-js-client'
import { getClient } from '$lib/lemmy.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { profile } from '$lib/auth.js'
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
@@ -16,7 +16,7 @@
} from 'svelte-hero-icons'
import { Color } from '$lib/ui/colors.js'
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
@@ -1,7 +1,7 @@
<script lang="ts">
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import type { CommentView, PostView } from 'lemmy-js-client'
@@ -1,7 +1,7 @@
<script lang="ts">
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import type { CommentView, PostView } from 'lemmy-js-client'
import { profile } from '$lib/auth.js'
+4 -2
View File
@@ -7,7 +7,7 @@
import { userSettings } from '$lib/settings.js'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
@@ -95,7 +95,9 @@
{:else if post.post.url}
<PostLink
url={post.post.url}
thumbnail_url={post.post.thumbnail_url ? `${post.post.thumbnail_url}?format=webp&thumbnail=512` : undefined}
thumbnail_url={post.post.thumbnail_url
? `${post.post.thumbnail_url}?format=webp&thumbnail=512`
: undefined}
nsfw={post.post.nsfw}
/>
{/if}
@@ -2,7 +2,7 @@
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
import { getClient, uploadImage } from '$lib/lemmy.js'
import type { Community, Post, PostView } from 'lemmy-js-client'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { toast } from 'mono-svelte'
import { Check, Icon, Photo } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
@@ -68,7 +68,7 @@
</Button>
</div>
{:else}
<Popover targetClass="h-8" openOnHover>
<Popover targetClass="h-8 z-30" openOnHover>
<div
class="flex items-center text-sm gap-1 rounded-md border border-slate-200
dark:border-zinc-700 px-1 h-8 duration-200 dark:bg-zinc-900"