cleanup: use native html forms for earch and communities

This commit is contained in:
James Xylight committed 2025-02-03 21:51:28 -08:00
1 parent e46422c27b
commit 73a4c16322
37 files changed
+254 -246

No files matched your search

@@ -25,7 +25,7 @@
import { Button, Modal } from 'mono-svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import ShieldIcon from '../moderation/ShieldIcon.svelte'
import { page } from '$app/stores'
import { page } from '$app/state'
import { onMount } from 'svelte'
import { t } from '$lib/translations'
import { fly, slide } from 'svelte/transition'
@@ -90,7 +90,7 @@
}
onMount(() => {
if ('#' + node.comment_view.comment.id.toString() == $page.url.hash) {
if ('#' + node.comment_view.comment.id.toString() == page.url.hash) {
highlight = 'text-primary-900 dark:text-primary-100 font-medium'
setTimeout(() => (highlight = 'duration-[3s] transition-all'), 500)
@@ -2,7 +2,7 @@
import Comments from './Comments.svelte'
import Comment from './Comment.svelte'
import { buildCommentsTree, type CommentNodeI } from './comments.svelte'
import { page } from '$app/stores'
import { page } from '$app/state'
import { onMount, setContext } from 'svelte'
import { Icon, ArrowDownCircle } from 'svelte-hero-icons'
import { getClient } from '$lib/lemmy.js'
@@ -28,8 +28,8 @@
onMount(() => {
hydrated = true
if (isParent && $page.url.hash && browser) {
document.getElementById($page.url.hash)?.scrollIntoView({
if (isParent && page.url.hash && browser) {
document.getElementById(page.url.hash)?.scrollIntoView({
behavior: 'smooth',
block: 'center',
})
@@ -51,7 +51,7 @@
try {
parent.loading = true
const newComments = await getClient($page.params.instance).getComments({
const newComments = await getClient(page.params.instance).getComments({
max_depth: 5,
parent_id: parent.comment_view.comment.id,
type_: 'All',
@@ -128,7 +128,7 @@
<svelte:element
this={hydrated ? 'div' : 'a'}
class="w-full my-2 h-8"
href="/comment/{$page.params.instance}/{node.comment_view.comment.id}"
href="/comment/{page.params.instance}/{node.comment_view.comment.id}"
>
<Button
loading={node.loading}
@@ -140,7 +140,7 @@
onclick={() => {
if (node.depth > 4) {
goto(
`/comment/${$page.params.instance}/${node.comment_view.comment.id}#comments`,
`/comment/${page.params.instance}/${node.comment_view.comment.id}#comments`,
)
} else {
node.loading = true
@@ -1,5 +1,5 @@
<script lang="ts">
import { page } from '$app/stores'
import { page } from '$app/state'
import { profile } from '$lib/auth.svelte'
import { searchParam } from '$lib/util.svelte'
import { Select } from 'mono-svelte'
@@ -35,7 +35,7 @@
{...rest}
bind:value={selected}
onchange={() => {
if (navigate) searchParam($page.url, 'type', selected, 'page', 'cursor')
if (navigate) searchParam(page.url, 'type', selected, 'page', 'cursor')
}}
>
{#snippet customLabel()}
@@ -1,5 +1,5 @@
<script lang="ts">
import { page } from '$app/stores'
import { page } from '$app/state'
import { t } from '$lib/translations'
import { searchParam } from '$lib/util.svelte.js'
import { Select } from 'mono-svelte'
@@ -51,7 +51,7 @@
bind:value={sort}
onchange={() => {
setSelected()
if (navigate) searchParam($page.url, 'sort', selected, 'page', 'cursor')
if (navigate) searchParam(page.url, 'sort', selected, 'page', 'cursor')
}}
>
{#snippet customLabel()}
@@ -96,7 +96,7 @@
onchange={() => {
sort = 'TopAll'
if (navigate)
searchParam($page.url, 'sort', selected, 'page', 'cursor')
searchParam(page.url, 'sort', selected, 'page', 'cursor')
}}
>
{#snippet customLabel()}