cleanup: use native html forms for earch and communities
This commit is contained in:
1 parent
e46422c27b
commit
73a4c16322
37 files changed
+176
-168
No files matched your search
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
"@sveltejs/adapter-node": "^5.2.9",
|
"@sveltejs/adapter-node": "^5.2.9",
|
||||||
"@sveltejs/adapter-vercel": "^5.4.6",
|
"@sveltejs/adapter-vercel": "^5.4.6",
|
||||||
"@sveltejs/kit": "^2.15.0",
|
"@sveltejs/kit": "^2.15.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
"@sveltejs/vite-plugin-svelte": "4.0.0-next.6",
|
||||||
"@tailwindcss/container-queries": "^0.1.1",
|
"@tailwindcss/container-queries": "^0.1.1",
|
||||||
"@tanstack/svelte-virtual": "^3.8.1",
|
"@tanstack/svelte-virtual": "^3.8.1",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
import { Button, Modal } from 'mono-svelte'
|
import { Button, Modal } from 'mono-svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import ShieldIcon from '../moderation/ShieldIcon.svelte'
|
import ShieldIcon from '../moderation/ShieldIcon.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { fly, slide } from 'svelte/transition'
|
import { fly, slide } from 'svelte/transition'
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
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'
|
highlight = 'text-primary-900 dark:text-primary-100 font-medium'
|
||||||
|
|
||||||
setTimeout(() => (highlight = 'duration-[3s] transition-all'), 500)
|
setTimeout(() => (highlight = 'duration-[3s] transition-all'), 500)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Comments from './Comments.svelte'
|
import Comments from './Comments.svelte'
|
||||||
import Comment from './Comment.svelte'
|
import Comment from './Comment.svelte'
|
||||||
import { buildCommentsTree, type CommentNodeI } from './comments.svelte'
|
import { buildCommentsTree, type CommentNodeI } from './comments.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { onMount, setContext } from 'svelte'
|
import { onMount, setContext } from 'svelte'
|
||||||
import { Icon, ArrowDownCircle } from 'svelte-hero-icons'
|
import { Icon, ArrowDownCircle } from 'svelte-hero-icons'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
hydrated = true
|
hydrated = true
|
||||||
if (isParent && $page.url.hash && browser) {
|
if (isParent && page.url.hash && browser) {
|
||||||
document.getElementById($page.url.hash)?.scrollIntoView({
|
document.getElementById(page.url.hash)?.scrollIntoView({
|
||||||
behavior: 'smooth',
|
behavior: 'smooth',
|
||||||
block: 'center',
|
block: 'center',
|
||||||
})
|
})
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
try {
|
try {
|
||||||
parent.loading = true
|
parent.loading = true
|
||||||
|
|
||||||
const newComments = await getClient($page.params.instance).getComments({
|
const newComments = await getClient(page.params.instance).getComments({
|
||||||
max_depth: 5,
|
max_depth: 5,
|
||||||
parent_id: parent.comment_view.comment.id,
|
parent_id: parent.comment_view.comment.id,
|
||||||
type_: 'All',
|
type_: 'All',
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
<svelte:element
|
<svelte:element
|
||||||
this={hydrated ? 'div' : 'a'}
|
this={hydrated ? 'div' : 'a'}
|
||||||
class="w-full my-2 h-8"
|
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
|
<Button
|
||||||
loading={node.loading}
|
loading={node.loading}
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (node.depth > 4) {
|
if (node.depth > 4) {
|
||||||
goto(
|
goto(
|
||||||
`/comment/${$page.params.instance}/${node.comment_view.comment.id}#comments`,
|
`/comment/${page.params.instance}/${node.comment_view.comment.id}#comments`,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
node.loading = true
|
node.loading = true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { searchParam } from '$lib/util.svelte'
|
import { searchParam } from '$lib/util.svelte'
|
||||||
import { Select } from 'mono-svelte'
|
import { Select } from 'mono-svelte'
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
{...rest}
|
{...rest}
|
||||||
bind:value={selected}
|
bind:value={selected}
|
||||||
onchange={() => {
|
onchange={() => {
|
||||||
if (navigate) searchParam($page.url, 'type', selected, 'page', 'cursor')
|
if (navigate) searchParam(page.url, 'type', selected, 'page', 'cursor')
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
import { Select } from 'mono-svelte'
|
import { Select } from 'mono-svelte'
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
bind:value={sort}
|
bind:value={sort}
|
||||||
onchange={() => {
|
onchange={() => {
|
||||||
setSelected()
|
setSelected()
|
||||||
if (navigate) searchParam($page.url, 'sort', selected, 'page', 'cursor')
|
if (navigate) searchParam(page.url, 'sort', selected, 'page', 'cursor')
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
onchange={() => {
|
onchange={() => {
|
||||||
sort = 'TopAll'
|
sort = 'TopAll'
|
||||||
if (navigate)
|
if (navigate)
|
||||||
searchParam($page.url, 'sort', selected, 'page', 'cursor')
|
searchParam(page.url, 'sort', selected, 'page', 'cursor')
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { Button, Material, toast } from 'mono-svelte'
|
import { Button, Material, toast } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
ArrowDownTray,
|
ArrowDownTray,
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
let { alt = '', class: clazz = '', children }: Props = $props()
|
let { alt = '', class: clazz = '', children }: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $page.state.openImage || '' != ''}
|
{#if page.state.openImage || '' != ''}
|
||||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<img
|
<img
|
||||||
width={400}
|
width={400}
|
||||||
height={400}
|
height={400}
|
||||||
src={$page.state.openImage}
|
src={page.state.openImage}
|
||||||
class="{zoomed
|
class="{zoomed
|
||||||
? 'object-cover'
|
? 'object-cover'
|
||||||
: 'object-contain'} max-w-max mx-auto my-auto overscroll-contain bg-white dark:bg-zinc-900"
|
: 'object-contain'} max-w-max mx-auto my-auto overscroll-contain bg-white dark:bg-zinc-900"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
download
|
download
|
||||||
href={$page.state.openImage}
|
href={page.state.openImage}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
@@ -104,13 +104,13 @@
|
|||||||
<Button
|
<Button
|
||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
if (navigator.share) {
|
if (navigator.share) {
|
||||||
const file = await downloadImage($page.state.openImage)
|
const file = await downloadImage(page.state.openImage)
|
||||||
|
|
||||||
navigator?.share?.({
|
navigator?.share?.({
|
||||||
files: [file],
|
files: [file],
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
navigator.clipboard.writeText($page.state.openImage)
|
navigator.clipboard.writeText(page.state.openImage)
|
||||||
toast({ content: $t('toast.copied') })
|
toast({ content: $t('toast.copied') })
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { invalidate } from '$app/navigation'
|
import { invalidate } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
transition-colors duration-100 relative z-0 flex-shrink-0"
|
transition-colors duration-100 relative z-0 flex-shrink-0"
|
||||||
>
|
>
|
||||||
{route.name}
|
{route.name}
|
||||||
{#if isSelected($page.url, currentRoute, route.href, defaultRoute)}
|
{#if isSelected(page.url, currentRoute, route.href, defaultRoute)}
|
||||||
<div
|
<div
|
||||||
class="rounded-full bg-slate-100/60 dark:bg-zinc-700/60
|
class="rounded-full bg-slate-100/60 dark:bg-zinc-700/60
|
||||||
absolute inset-0 w-full h-full -z-10"
|
absolute inset-0 w-full h-full -z-10"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||||
import { dockProps } from '../layout/Shell.svelte'
|
import { dockProps } from '../layout/Shell.svelte'
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
...rest
|
...rest
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
let isSelected = $derived(isSelectedFilter($page.url.pathname))
|
let isSelected = $derived(isSelectedFilter(page.url.pathname))
|
||||||
let isPanel = $derived(adaptive ? $dockProps.noGap : false)
|
let isPanel = $derived(adaptive ? $dockProps.noGap : false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
import { profile, profileData } from '$lib/auth.svelte'
|
import { profile, profileData } from '$lib/auth.svelte'
|
||||||
import { getGroups, type Action, type Group } from './actions.svelte'
|
import { getGroups, type Action, type Group } from './actions.svelte'
|
||||||
import { themeData } from '$lib/ui/colors'
|
import { themeData } from '$lib/ui/colors'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open?: boolean
|
open?: boolean
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
$profile,
|
$profile,
|
||||||
$profileData.profiles,
|
$profileData.profiles,
|
||||||
$themeData,
|
$themeData,
|
||||||
$page.data.contextual?.actions,
|
page.data.contextual?.actions,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
let flattenedActions = $derived(
|
let flattenedActions = $derived(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { setUserID, type Profile } from '$lib/auth.svelte'
|
import { setUserID, type Profile } from '$lib/auth.svelte'
|
||||||
import {
|
import {
|
||||||
amModOfAny,
|
amModOfAny,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { profile, setUserID, type Profile } from '$lib/auth.svelte.js'
|
import { profile, setUserID, type Profile } from '$lib/auth.svelte.js'
|
||||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/instance'
|
import { LINKED_INSTANCE_URL } from '$lib/instance'
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
await setUserID(prof.id)
|
await setUserID(prof.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
await goto($page.url, {
|
await goto(page.url, {
|
||||||
invalidateAll: true,
|
invalidateAll: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run } from 'svelte/legacy'
|
import { run } from 'svelte/legacy'
|
||||||
|
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
run(() => {
|
run(() => {
|
||||||
if (href != undefined) {
|
if (href != undefined) {
|
||||||
selected = $page.url.pathname == href
|
selected = page.url.pathname == href
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
import Menu from '../../popover/Menu.svelte'
|
import Menu from '../../popover/Menu.svelte'
|
||||||
import MenuButton from '../../popover/MenuButton.svelte'
|
import MenuButton from '../../popover/MenuButton.svelte'
|
||||||
import Popover from '../../popover/Popover.svelte'
|
import Popover from '../../popover/Popover.svelte'
|
||||||
import { createEventDispatcher, onMount, setContext } from 'svelte'
|
import { createEventDispatcher, onMount, setContext, tick } from 'svelte'
|
||||||
import {
|
import {
|
||||||
CheckCircle,
|
CheckCircle,
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
customLabel?: import('svelte').Snippet
|
customLabel?: import('svelte').Snippet
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
customOption?: import('svelte').Snippet<[any]>
|
customOption?: import('svelte').Snippet<[any]>
|
||||||
oncontextmenu?: () => void
|
oncontextmenu?: HTMLSelectAttributes['oncontextmenu']
|
||||||
onchange?: () => void
|
onchange?: HTMLSelectAttributes['onchange']
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -99,8 +99,8 @@
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
open = !open
|
open = !open
|
||||||
}}
|
}}
|
||||||
onchange={bubble('change')}
|
{onchange}
|
||||||
oncontextmenu={bubble('contextmenu')}
|
{oncontextmenu}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
>
|
>
|
||||||
{#if placeholder}
|
{#if placeholder}
|
||||||
@@ -116,10 +116,10 @@
|
|||||||
selected: option.value == value,
|
selected: option.value == value,
|
||||||
})}{:else}
|
})}{:else}
|
||||||
<MenuButton
|
<MenuButton
|
||||||
on:contextmenu={() => oncontextmenu?.()}
|
onclick={async () => {
|
||||||
onclick={() => {
|
|
||||||
value = option.value
|
value = option.value
|
||||||
onchange?.()
|
await tick()
|
||||||
|
element?.dispatchEvent(new Event('change', { bubbles: true }))
|
||||||
}}
|
}}
|
||||||
size="custom"
|
size="custom"
|
||||||
disabled={option.disabled}
|
disabled={option.disabled}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { toast } from 'mono-svelte'
|
|||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
import { get } from 'svelte/store'
|
import { get } from 'svelte/store'
|
||||||
import type { SubscribedType } from 'lemmy-js-client'
|
import type { SubscribedType } from 'lemmy-js-client'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { feature } from '$lib/version.js'
|
import { feature } from '$lib/version.js'
|
||||||
import { client } from '$lib/lemmy.js'
|
import { client } from '$lib/lemmy.js'
|
||||||
import { site } from './lemmy'
|
import { site } from './lemmy'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
@@ -22,10 +22,10 @@
|
|||||||
class="text-primary-900 dark:text-primary-100 text-6xl font-black flex items-center flex-row gap-2
|
class="text-primary-900 dark:text-primary-100 text-6xl font-black flex items-center flex-row gap-2
|
||||||
font-display border-b pb-4 border-slate-200 dark:border-zinc-800"
|
font-display border-b pb-4 border-slate-200 dark:border-zinc-800"
|
||||||
>
|
>
|
||||||
{$page.status}
|
{page.status}
|
||||||
</h1>
|
</h1>
|
||||||
{#if $page?.error?.message}
|
{#if page?.error?.message}
|
||||||
{@const error = getError($page?.error?.message)}
|
{@const error = getError(page?.error?.message)}
|
||||||
{#if error.code}
|
{#if error.code}
|
||||||
<code class="rounded-md dark:!bg-zinc-950 px-2 py-1 min-w-48">
|
<code class="rounded-md dark:!bg-zinc-950 px-2 py-1 min-w-48">
|
||||||
{error.string}
|
{error.string}
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
onclick={() => goto($page.url, { invalidateAll: true })}
|
onclick={() => goto(page.url, { invalidateAll: true })}
|
||||||
>
|
>
|
||||||
{$t('message.retry')}
|
{$t('message.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
import Navbar from '$lib/components/ui/navbar/Navbar.svelte'
|
||||||
import '../style/app.css'
|
import '../style/app.css'
|
||||||
import { navigating, page } from '$app/stores'
|
import { navigating, page } from '$app/state'
|
||||||
import nProgress from 'nprogress'
|
import nProgress from 'nprogress'
|
||||||
import 'nprogress/nprogress.css'
|
import 'nprogress/nprogress.css'
|
||||||
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
|
||||||
@@ -65,7 +65,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
let barTimeout: number = $state(0)
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
document.body.classList.remove(
|
document.body.classList.remove(
|
||||||
@@ -86,9 +85,10 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
navigating.subscribe((value) => {
|
let barTimeout: number = $state(0)
|
||||||
if (value) {
|
$effect(() => {
|
||||||
|
if (navigating.to) {
|
||||||
document.body.classList.toggle('wait', true)
|
document.body.classList.toggle('wait', true)
|
||||||
barTimeout = setTimeout(() => nProgress.start(), 100)
|
barTimeout = setTimeout(() => nProgress.start(), 100)
|
||||||
} else {
|
} else {
|
||||||
@@ -97,7 +97,6 @@
|
|||||||
nProgress.done()
|
nProgress.done()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
let error = $state(null)
|
let error = $state(null)
|
||||||
|
|
||||||
@@ -139,7 +138,7 @@
|
|||||||
<Shell
|
<Shell
|
||||||
dir={$locale == 'he' && settings.useRtl ? 'rtl' : 'ltr'}
|
dir={$locale == 'he' && settings.useRtl ? 'rtl' : 'ltr'}
|
||||||
class="min-h-screen "
|
class="min-h-screen "
|
||||||
route={$page.route}
|
route={page.route}
|
||||||
>
|
>
|
||||||
<Moderation />
|
<Moderation />
|
||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
@@ -163,9 +162,9 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet suffix({ class: c, style: s })}
|
{#snippet suffix({ class: c, style: s })}
|
||||||
<div class={c} style={s}>
|
<div class={c} style={s}>
|
||||||
{#if $page.data.slots?.sidebar?.component}
|
{#if page.data.slots?.sidebar?.component}
|
||||||
{@const SvelteComponent = $page.data.slots.sidebar.component}
|
{@const SvelteComponent = page.data.slots.sidebar.component}
|
||||||
<SvelteComponent {...$page.data.slots.sidebar.props} />
|
<SvelteComponent {...page.data.slots.sidebar.props} />
|
||||||
{:else if $site}
|
{:else if $site}
|
||||||
<SiteCard
|
<SiteCard
|
||||||
site={$site.site_view}
|
site={$site.site_view}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||||
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
|
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
|
||||||
@@ -70,9 +70,9 @@
|
|||||||
>
|
>
|
||||||
<Pageination
|
<Pageination
|
||||||
cursor={{ next: data.cursor.next }}
|
cursor={{ next: data.cursor.next }}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
on:cursor={(c) => {
|
on:cursor={(c) => {
|
||||||
searchParam($page.url, 'cursor', c.detail)
|
searchParam(page.url, 'cursor', c.detail)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
selected={data.unreadOnly ?? true}
|
selected={data.unreadOnly ?? true}
|
||||||
optionNames={[$t('filter.location.all'), $t('filter.unread')]}
|
optionNames={[$t('filter.location.all'), $t('filter.unread')]}
|
||||||
on:select={(e) =>
|
on:select={(e) =>
|
||||||
searchParam($page.url, 'unreadOnly', e.detail.toString(), 'page')}
|
searchParam(page.url, 'unreadOnly', e.detail.toString(), 'page')}
|
||||||
/>
|
/>
|
||||||
{#if data.applications && data.applications.length > 0}
|
{#if data.applications && data.applications.length > 0}
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="mt-auto">
|
<div class="mt-auto">
|
||||||
<Pageination
|
<Pageination
|
||||||
page={data.page}
|
page={data.page}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { run } from 'svelte/legacy'
|
import { run } from 'svelte/legacy'
|
||||||
|
|
||||||
import { navigating, page } from '$app/stores'
|
import { navigating, page } from '$app/state'
|
||||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
@@ -47,14 +47,14 @@
|
|||||||
resumables.add({
|
resumables.add({
|
||||||
name: data.community.community_view.community.title,
|
name: data.community.community_view.community.title,
|
||||||
type: 'community',
|
type: 'community',
|
||||||
url: $page.url.toString(),
|
url: page.url.toString(),
|
||||||
avatar: data.community.community_view.community.icon,
|
avatar: data.community.community_view.community.icon,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
if (browser) {
|
if (browser) {
|
||||||
if ($navigating?.to?.route?.id == '/create/post') return
|
if (navigating?.to?.route?.id == '/create/post') return
|
||||||
|
|
||||||
setSessionStorage('lastSeenCommunity', undefined)
|
setSessionStorage('lastSeenCommunity', undefined)
|
||||||
}
|
}
|
||||||
@@ -119,9 +119,9 @@
|
|||||||
<Pageination
|
<Pageination
|
||||||
page={data.page}
|
page={data.page}
|
||||||
cursor={{ next: data.cursor.next }}
|
cursor={{ next: data.cursor.next }}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
on:cursor={(c) => {
|
on:cursor={(c) => {
|
||||||
searchParam($page.url, 'cursor', c.detail)
|
searchParam(page.url, 'cursor', c.detail)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span class="flex flex-row items-center gap-1">
|
<span class="flex flex-row items-center gap-1">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||||
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy'
|
import { preventDefault } from 'svelte/legacy'
|
||||||
|
|
||||||
import { navigating, page } from '$app/stores'
|
import { navigating, page } from '$app/state'
|
||||||
import {
|
import {
|
||||||
GlobeAmericas,
|
GlobeAmericas,
|
||||||
Icon,
|
Icon,
|
||||||
@@ -40,7 +40,9 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
let search = $state(data.query || '')
|
let search = $state(data.query || '')
|
||||||
let searchElement: HTMLInputElement | undefined = $state()
|
let searchElement = $state<HTMLInputElement>()
|
||||||
|
let form = $state<HTMLFormElement>()
|
||||||
|
|
||||||
let instance = ''
|
let instance = ''
|
||||||
|
|
||||||
let showTop = $derived(
|
let showTop = $derived(
|
||||||
@@ -66,12 +68,9 @@
|
|||||||
class="mt-4 mb-0 sticky z-30"
|
class="mt-4 mb-0 sticky z-30"
|
||||||
style="top: max(1.5rem, {$contentPadding.top}px);"
|
style="top: max(1.5rem, {$contentPadding.top}px);"
|
||||||
>
|
>
|
||||||
|
<form method="get" action="/communities" bind:this={form}>
|
||||||
<Tabs routes={[]} class="p-2 dark:bg-zinc-925/70 shadow-md shadow-black/5">
|
<Tabs routes={[]} class="p-2 dark:bg-zinc-925/70 shadow-md shadow-black/5">
|
||||||
<form
|
<div class="flex gap-2 flex-row items-center w-full text-base h-10">
|
||||||
method="get"
|
|
||||||
action="/communities"
|
|
||||||
class="flex gap-2 flex-row items-center w-full text-base h-10"
|
|
||||||
>
|
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={search}
|
bind:value={search}
|
||||||
bind:element={searchElement}
|
bind:element={searchElement}
|
||||||
@@ -88,18 +87,27 @@
|
|||||||
class="flex-shrink-0 h-full aspect-square"
|
class="flex-shrink-0 h-full aspect-square"
|
||||||
title="Search"
|
title="Search"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
loading={$navigating != null}
|
loading={navigating.to != null}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={MagnifyingGlass} size="16" micro />
|
<Icon src={MagnifyingGlass} size="16" micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</div>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center">
|
||||||
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center">
|
<Location
|
||||||
<Location selected={data.type} />
|
name="type"
|
||||||
<Sort selected={data.sort} />
|
selected={data.type}
|
||||||
|
onchange={() => form?.requestSubmit()}
|
||||||
|
/>
|
||||||
|
<Sort
|
||||||
|
name="sort"
|
||||||
|
selected={data.sort}
|
||||||
|
onchange={() => form?.requestSubmit()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<ul
|
<ul
|
||||||
class="flex flex-col divide-y divide-slate-100 dark:divide-zinc-800 my-6 h-full"
|
class="flex flex-col divide-y divide-slate-100 dark:divide-zinc-800 my-6 h-full"
|
||||||
@@ -179,8 +187,8 @@
|
|||||||
>
|
>
|
||||||
<Tabs routes={[]} class="mx-auto">
|
<Tabs routes={[]} class="mx-auto">
|
||||||
<Pageination
|
<Pageination
|
||||||
page={Number($page.url.searchParams.get('page')) || 1}
|
page={Number(page.url.searchParams.get('page')) || 1}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import { notifications, profile } from '$lib/auth.svelte.js'
|
import { notifications, profile } from '$lib/auth.svelte.js'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
$notifications.inbox = 0
|
$notifications.inbox = 0
|
||||||
|
|
||||||
goto($page.url, {
|
goto(page.url, {
|
||||||
invalidateAll: true,
|
invalidateAll: true,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
markingAsRead = false
|
markingAsRead = false
|
||||||
@@ -104,17 +104,17 @@ items-center px-2 w-max"
|
|||||||
name: $t('filter.inbox.messages'),
|
name: $t('filter.inbox.messages'),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
currentRoute={$page.url.search}
|
currentRoute={page.url.search}
|
||||||
isSelected={(url, current, route, def) =>
|
isSelected={(url, current, route, def) =>
|
||||||
$page.url.search == route ||
|
page.url.search == route ||
|
||||||
($page.url.pathname == route && $page.url.search == '') ||
|
(page.url.pathname == route && page.url.search == '') ||
|
||||||
$page.url.searchParams.toString().includes(route.slice(1)) ||
|
page.url.searchParams.toString().includes(route.slice(1)) ||
|
||||||
($page.url.search == '' && route == def)}
|
(page.url.search == '' && route == def)}
|
||||||
class="overflow-auto w-full"
|
class="overflow-auto w-full"
|
||||||
buildUrl={(route, href) =>
|
buildUrl={(route, href) =>
|
||||||
href.includes('?')
|
href.includes('?')
|
||||||
? '?' + addSearchParam($page.url.searchParams, href).toString()
|
? '?' + addSearchParam(page.url.searchParams, href).toString()
|
||||||
: `${href}${$page.url.search}`}
|
: `${href}${page.url.search}`}
|
||||||
defaultRoute="?type=All"
|
defaultRoute="?type=All"
|
||||||
/>
|
/>
|
||||||
<Tabs
|
<Tabs
|
||||||
@@ -129,10 +129,10 @@ items-center px-2 w-max"
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
isSelected={(url, current, route, def) =>
|
isSelected={(url, current, route, def) =>
|
||||||
$page.url.searchParams.toString().includes(route.slice(1)) ||
|
page.url.searchParams.toString().includes(route.slice(1)) ||
|
||||||
($page.url.search == '' && route == def)}
|
(page.url.search == '' && route == def)}
|
||||||
buildUrl={(route, href) =>
|
buildUrl={(route, href) =>
|
||||||
'?' + addSearchParam($page.url.searchParams, href).toString()}
|
'?' + addSearchParam(page.url.searchParams, href).toString()}
|
||||||
defaultRoute="?unreadOnly=true"
|
defaultRoute="?unreadOnly=true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -141,7 +141,7 @@ items-center px-2 w-max"
|
|||||||
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
onclick={() => goto($page.url, { invalidateAll: true })}
|
onclick={() => goto(page.url, { invalidateAll: true })}
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="xl"
|
rounding="xl"
|
||||||
title={$t('common.refresh')}
|
title={$t('common.refresh')}
|
||||||
@@ -201,7 +201,7 @@ items-center px-2 w-max"
|
|||||||
<Pageination
|
<Pageination
|
||||||
hasMore={!(!inbox || (inbox?.length ?? 0) < (data?.limit ?? 0))}
|
hasMore={!(!inbox || (inbox?.length ?? 0) < (data?.limit ?? 0))}
|
||||||
page={data.page}
|
page={data.page}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
clearErrorScope,
|
clearErrorScope,
|
||||||
pushError,
|
pushError,
|
||||||
} from '$lib/components/error/ErrorContainer.svelte'
|
} from '$lib/components/error/ErrorContainer.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
ref?: string
|
ref?: string
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
async function logIn() {
|
async function logIn() {
|
||||||
data.loading = true
|
data.loading = true
|
||||||
clearErrorScope($page.route.id)
|
clearErrorScope(page.route.id)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data.instance = data.instance.trim()
|
data.instance = data.instance.trim()
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
: `_${data.attempts + 1}`),
|
: `_${data.attempts + 1}`),
|
||||||
)
|
)
|
||||||
: errorMessage(error),
|
: errorMessage(error),
|
||||||
scope: $page.route.id!,
|
scope: page.route.id!,
|
||||||
})
|
})
|
||||||
data.attempts++
|
data.attempts++
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
})}
|
})}
|
||||||
</Note>
|
</Note>
|
||||||
{/if}
|
{/if}
|
||||||
<ErrorContainer class="pt-2" scope={$page.route.id} />
|
<ErrorContainer class="pt-2" scope={page.route.id} />
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row w-full items-center gap-2">
|
<div class="flex flex-row w-full items-center gap-2">
|
||||||
<TextInput
|
<TextInput
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
import Report from './Report.svelte'
|
import Report from './Report.svelte'
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import {
|
import {
|
||||||
EnvelopeOpen,
|
EnvelopeOpen,
|
||||||
Funnel,
|
Funnel,
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="flex flex-row gap-2 flex-wrap items-end">
|
<div class="flex flex-row gap-2 flex-wrap items-end">
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.type}
|
bind:value={data.type}
|
||||||
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
|
on:change={() => searchParam(page.url, 'type', data.type, 'page')}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<div class="flex flex-row flex-wrap gap-2">
|
<div class="flex flex-row flex-wrap gap-2">
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.type}
|
bind:value={data.type}
|
||||||
onchange={() => searchParam($page.url, 'type', data.type, 'page')}
|
onchange={() => searchParam(page.url, 'type', data.type, 'page')}
|
||||||
class="w-48"
|
class="w-48"
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
@@ -95,10 +95,10 @@
|
|||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
label="Instance"
|
label="Instance"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
q={$page.url.searchParams.get('instance') || ''}
|
q={page.url.searchParams.get('instance') || ''}
|
||||||
on:select={(e) =>
|
on:select={(e) =>
|
||||||
searchParam(
|
searchParam(
|
||||||
$page.url,
|
page.url,
|
||||||
'instance',
|
'instance',
|
||||||
e.detail?.domain.toString() ?? '',
|
e.detail?.domain.toString() ?? '',
|
||||||
'page',
|
'page',
|
||||||
@@ -114,28 +114,28 @@
|
|||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
label="Community"
|
label="Community"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
q={$page.url.searchParams.get('community') ? 'Selected' : ''}
|
q={page.url.searchParams.get('community') ? 'Selected' : ''}
|
||||||
on:select={(e) =>
|
on:select={(e) =>
|
||||||
searchParam(
|
searchParam(
|
||||||
$page.url,
|
page.url,
|
||||||
'community',
|
'community',
|
||||||
e.detail?.id.toString() ?? '',
|
e.detail?.id.toString() ?? '',
|
||||||
'page',
|
'page',
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<UserAutocomplete
|
<UserAutocomplete
|
||||||
instance={$page.url.searchParams.get('instance') || undefined}
|
instance={page.url.searchParams.get('instance') || undefined}
|
||||||
placeholder="Filter by user"
|
placeholder="Filter by user"
|
||||||
jwt={$profile?.jwt}
|
jwt={$profile?.jwt}
|
||||||
listing_type="All"
|
listing_type="All"
|
||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
label="User"
|
label="User"
|
||||||
q={$page.url.searchParams.get('user')
|
q={page.url.searchParams.get('user')
|
||||||
? (data.filters.user ?? 'Selected')
|
? (data.filters.user ?? 'Selected')
|
||||||
: ''}
|
: ''}
|
||||||
on:select={(e) =>
|
on:select={(e) =>
|
||||||
searchParam($page.url, 'user', e.detail?.id.toString() ?? '', 'page')}
|
searchParam(page.url, 'user', e.detail?.id.toString() ?? '', 'page')}
|
||||||
/>
|
/>
|
||||||
{#if $profile?.user && isAdmin($profile?.user)}
|
{#if $profile?.user && isAdmin($profile?.user)}
|
||||||
<UserAutocomplete
|
<UserAutocomplete
|
||||||
@@ -145,12 +145,12 @@
|
|||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
label="Moderator"
|
label="Moderator"
|
||||||
q={$page.url.searchParams.get('mod_id')
|
q={page.url.searchParams.get('mod_id')
|
||||||
? (data.filters.moderator ?? 'Selected')
|
? (data.filters.moderator ?? 'Selected')
|
||||||
: ''}
|
: ''}
|
||||||
on:select={(e) =>
|
on:select={(e) =>
|
||||||
searchParam(
|
searchParam(
|
||||||
$page.url,
|
page.url,
|
||||||
'mod_id',
|
'mod_id',
|
||||||
e.detail?.id.toString() ?? '',
|
e.detail?.id.toString() ?? '',
|
||||||
'page',
|
'page',
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
<Button
|
<Button
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
searchParam(
|
searchParam(
|
||||||
$page.url,
|
page.url,
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'user',
|
'user',
|
||||||
@@ -221,7 +221,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<Pageination
|
<Pageination
|
||||||
page={data.page}
|
page={data.page}
|
||||||
on:change={(e) => searchParam($page.url, 'page', e.detail.toString())}
|
on:change={(e) => searchParam(page.url, 'page', e.detail.toString())}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<Placeholder
|
<Placeholder
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { XMark, Icon } from 'svelte-hero-icons'
|
import { XMark, Icon } from 'svelte-hero-icons'
|
||||||
</script>
|
</script>
|
||||||
@@ -13,5 +13,5 @@
|
|||||||
<h1 class="text-red-800 dark:text-red-300 text-2xl font-semibold">
|
<h1 class="text-red-800 dark:text-red-300 text-2xl font-semibold">
|
||||||
{$t('message.error')}
|
{$t('message.error')}
|
||||||
</h1>
|
</h1>
|
||||||
<code>{$page.error?.message}</code>
|
<code>{page.error?.message}</code>
|
||||||
</div>
|
</div>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||||
import {
|
import {
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
resumables.add({
|
resumables.add({
|
||||||
name: data.post.post_view.post.name,
|
name: data.post.post_view.post.name,
|
||||||
type: 'post',
|
type: 'post',
|
||||||
url: $page.url.toString(),
|
url: page.url.toString(),
|
||||||
avatar: data.post.post_view.post.thumbnail_url,
|
avatar: data.post.post_view.post.thumbnail_url,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
let commenting = $state(false)
|
let commenting = $state(false)
|
||||||
|
|
||||||
let remoteView = $derived(
|
let remoteView = $derived(
|
||||||
$page.params.instance?.toLowerCase() != $instance.toLowerCase(),
|
page.params.instance?.toLowerCase() != $instance.toLowerCase(),
|
||||||
)
|
)
|
||||||
|
|
||||||
function createCommentsState(tree: CommentNodeI[]) {
|
function createCommentsState(tree: CommentNodeI[]) {
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
<title>{data.post.post_view.post.name}</title>
|
<title>{data.post.post_view.post.name}</title>
|
||||||
<meta property="og:title" content={data.post.post_view.post.name} />
|
<meta property="og:title" content={data.post.post_view.post.name} />
|
||||||
<meta property="twitter:title" content={data.post.post_view.post.name} />
|
<meta property="twitter:title" content={data.post.post_view.post.name} />
|
||||||
<meta property="og:url" content={$page.url.toString()} />
|
<meta property="og:url" content={page.url.toString()} />
|
||||||
{#if isImage(data.post.post_view.post.url)}
|
{#if isImage(data.post.post_view.post.url)}
|
||||||
<meta property="og:image" content={data.post.post_view.post.url} />
|
<meta property="og:image" content={data.post.post_view.post.url} />
|
||||||
<meta property="twitter:card" content={data.post.post_view.post.url} />
|
<meta property="twitter:card" content={data.post.post_view.post.url} />
|
||||||
@@ -368,7 +368,7 @@
|
|||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
href={data.thread.showContext
|
href={data.thread.showContext
|
||||||
? `/comment/${$page.params.instance}/${data.thread.showContext}`
|
? `/comment/${page.params.instance}/${data.thread.showContext}`
|
||||||
: undefined}
|
: undefined}
|
||||||
class="hover:bg-white/50 dark:hover:bg-zinc-800/30"
|
class="hover:bg-white/50 dark:hover:bg-zinc-800/30"
|
||||||
onclick={data.thread.singleThread ? reloadComments : undefined}
|
onclick={data.thread.singleThread ? reloadComments : undefined}
|
||||||
@@ -458,7 +458,7 @@
|
|||||||
.map((c) => c.community.id)
|
.map((c) => c.community.id)
|
||||||
.includes(data.post.community_view.community.id)
|
.includes(data.post.community_view.community.id)
|
||||||
)) ||
|
)) ||
|
||||||
$page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
||||||
banned={data.post.community_view.banned_from_community}
|
banned={data.post.community_view.banned_from_community}
|
||||||
on:focus={() => (commenting = true)}
|
on:focus={() => (commenting = true)}
|
||||||
tools={commenting}
|
tools={commenting}
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
* @property {import('svelte').Snippet} [children]
|
* @property {import('svelte').Snippet} [children]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @type {Props} */
|
/** @type {Props} */
|
||||||
let { children } = $props();
|
let { children } = $props()
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Header pageHeader>
|
<Header pageHeader>
|
||||||
{routes.find((r) => $page.url.pathname == r.url)?.name}
|
{routes.find((r) => page.url.pathname == r.url)?.name}
|
||||||
</Header>
|
</Header>
|
||||||
<div class="flex flex-row gap-12">
|
<div class="flex flex-row gap-12">
|
||||||
<nav class="flex flex-col gap-2 flex-1 max-sm:hidden">
|
<nav class="flex flex-col gap-2 flex-1 max-sm:hidden">
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<SidebarButton
|
<SidebarButton
|
||||||
size="lg"
|
size="lg"
|
||||||
rounding="lg"
|
rounding="lg"
|
||||||
selected={$page.url.pathname == route.url}
|
selected={page.url.pathname == route.url}
|
||||||
href={route.url}
|
href={route.url}
|
||||||
>
|
>
|
||||||
{route.name}
|
{route.name}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import { client } from '$lib/lemmy.js'
|
import { client } from '$lib/lemmy.js'
|
||||||
import { t } from '$lib/translations.js'
|
import { t } from '$lib/translations.js'
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
|
|
||||||
goto($page.url, { invalidateAll: true })
|
goto(page.url, { invalidateAll: true })
|
||||||
} else {
|
} else {
|
||||||
const res = await client().generateTotpSecret()
|
const res = await client().generateTotpSecret()
|
||||||
totpLink = res.totp_secret_url
|
totpLink = res.totp_secret_url
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
|
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** @type {Props} */
|
/** @type {Props} */
|
||||||
let { children } = $props();
|
let { children } = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -67,7 +67,6 @@
|
|||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<Button
|
<Button
|
||||||
title={$t('post.actions.more.label')}
|
title={$t('post.actions.more.label')}
|
||||||
|
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
color="none"
|
color="none"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
@@ -33,9 +33,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if data.images.length == 20}
|
{#if data.images.length == 20}
|
||||||
<Pageination
|
<Pageination
|
||||||
page={Number($page.url.searchParams.get('page')) || 1}
|
page={Number(page.url.searchParams.get('page')) || 1}
|
||||||
on:change={(p) => {
|
on:change={(p) => {
|
||||||
searchParam($page.url, 'page', p.detail.toString())
|
searchParam(page.url, 'page', p.detail.toString())
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { Bookmark } from 'svelte-hero-icons'
|
import { Bookmark } from 'svelte-hero-icons'
|
||||||
import { t } from '$lib/translations.js'
|
import { t } from '$lib/translations.js'
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<Select
|
<Select
|
||||||
bind:value={type}
|
bind:value={type}
|
||||||
onchange={() => searchParam($page.url, 'type', type, 'page')}
|
onchange={() => searchParam(page.url, 'type', type, 'page')}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<div class="flex items-center gap-0.5">
|
<div class="flex items-center gap-0.5">
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
>
|
>
|
||||||
<Tabs routes={[]} class="mx-auto">
|
<Tabs routes={[]} class="mx-auto">
|
||||||
<Pageination
|
<Pageination
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
page={data.page}
|
page={data.page}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { preventDefault } from 'svelte/legacy'
|
import { preventDefault } from 'svelte/legacy'
|
||||||
|
|
||||||
import { navigating, page } from '$app/stores'
|
import { navigating, page } from '$app/state'
|
||||||
import { profile } from '$lib/auth.svelte.js'
|
import { profile } from '$lib/auth.svelte.js'
|
||||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
||||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
let query = $state(data.query || '')
|
let query = $state(data.query || '')
|
||||||
let searchElement: HTMLInputElement | undefined = $state()
|
let searchElement: HTMLInputElement | undefined = $state()
|
||||||
|
let form = $state<HTMLFormElement>()
|
||||||
|
|
||||||
let pageNum = $state(data.page)
|
let pageNum = $state(data.page)
|
||||||
|
|
||||||
@@ -71,12 +72,9 @@
|
|||||||
class="mt-4 mb-0 sticky z-30"
|
class="mt-4 mb-0 sticky z-30"
|
||||||
style="top: max(1.5rem, {$contentPadding.top}px);"
|
style="top: max(1.5rem, {$contentPadding.top}px);"
|
||||||
>
|
>
|
||||||
|
<form method="get" action="/search" class="" bind:this={form}>
|
||||||
<Tabs routes={[]} class="p-2 dark:bg-zinc-925/70">
|
<Tabs routes={[]} class="p-2 dark:bg-zinc-925/70">
|
||||||
<form
|
<div class="flex gap-2 flex-row items-center w-full text-base h-10">
|
||||||
method="get"
|
|
||||||
action="/search"
|
|
||||||
class="flex gap-2 flex-row items-center w-full text-base h-10"
|
|
||||||
>
|
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
bind:element={searchElement}
|
bind:element={searchElement}
|
||||||
@@ -92,19 +90,19 @@
|
|||||||
class="flex-shrink-0 h-full aspect-square"
|
class="flex-shrink-0 h-full aspect-square"
|
||||||
title="Search"
|
title="Search"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
loading={$navigating != null}
|
loading={navigating.to != null}
|
||||||
>
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={MagnifyingGlass} size="16" micro />
|
<Icon src={MagnifyingGlass} size="16" micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</div>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
<div class="flex flex-row flex-wrap items-center gap-4 mt-4">
|
||||||
<div class="flex flex-row flex-wrap items-center gap-4 mt-4">
|
|
||||||
<Select
|
<Select
|
||||||
|
name="type"
|
||||||
bind:value={data.type}
|
bind:value={data.type}
|
||||||
on:change={() => searchParam($page.url, 'type', data.type ?? 'All', 'page')}
|
onchange={() => form?.requestSubmit()}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
@@ -118,8 +116,11 @@
|
|||||||
<Option value="Communities">{$t('content.communities')}</Option>
|
<Option value="Communities">{$t('content.communities')}</Option>
|
||||||
<Option value="Users">{$t('content.users')}</Option>
|
<Option value="Users">{$t('content.users')}</Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Sort navigate bind:selected={data.sort} />
|
<Sort
|
||||||
{#snippet summary()}
|
name="sort"
|
||||||
|
bind:selected={data.sort}
|
||||||
|
onchange={() => form?.requestSubmit()}
|
||||||
|
/>
|
||||||
<Button
|
<Button
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
@@ -128,7 +129,8 @@
|
|||||||
>
|
>
|
||||||
<Icon src={ChevronDown} size="20" mini />
|
<Icon src={ChevronDown} size="20" mini />
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{#if moreOptions}
|
{#if moreOptions}
|
||||||
<div transition:slide={{ axis: 'y', easing: expoOut }} class="max-w-sm">
|
<div transition:slide={{ axis: 'y', easing: expoOut }} class="max-w-sm">
|
||||||
@@ -138,7 +140,7 @@
|
|||||||
listing_type={'All'}
|
listing_type={'All'}
|
||||||
showWhenEmpty={true}
|
showWhenEmpty={true}
|
||||||
on:select={(c) =>
|
on:select={(c) =>
|
||||||
searchParam($page.url, 'community', c.detail?.id || undefined, 'page')}
|
searchParam(page.url, 'community', c.detail?.id || undefined, 'page')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -215,7 +217,7 @@
|
|||||||
{#if data.results.length > 0}
|
{#if data.results.length > 0}
|
||||||
<Pageination
|
<Pageination
|
||||||
bind:page={pageNum}
|
bind:page={pageNum}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { run, preventDefault } from 'svelte/legacy'
|
import { run, preventDefault } from 'svelte/legacy'
|
||||||
|
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { setUser } from '$lib/auth.svelte.js'
|
import { setUser } from '$lib/auth.svelte.js'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
let { data } = $props()
|
let { data } = $props()
|
||||||
|
|
||||||
const instance = $page.params.instance
|
const instance = page.params.instance
|
||||||
|
|
||||||
let captchaRequired = data.site_view.local_site.captcha_enabled
|
let captchaRequired = data.site_view.local_site.captcha_enabled
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (res?.jwt) {
|
if (res?.jwt) {
|
||||||
await setUser(res.jwt, $page.params.instance, username)
|
await setUser(res.jwt, page.params.instance, username)
|
||||||
|
|
||||||
toast({ content: $t('toast.logIn'), type: 'success' })
|
toast({ content: $t('toast.logIn'), type: 'success' })
|
||||||
goto('/')
|
goto('/')
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { isCommentView } from '$lib/lemmy/item.js'
|
import { isCommentView } from '$lib/lemmy/item.js'
|
||||||
import { client, getClient } from '$lib/lemmy.js'
|
import { client, getClient } from '$lib/lemmy.js'
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
|
|
||||||
goto($page.url, {
|
goto(page.url, {
|
||||||
invalidateAll: true,
|
invalidateAll: true,
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -296,7 +296,7 @@
|
|||||||
<div class="flex flex-row gap-4 flex-wrap">
|
<div class="flex flex-row gap-4 flex-wrap">
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.type}
|
bind:value={data.type}
|
||||||
onchange={() => searchParam($page.url, 'type', data.type, 'page')}
|
onchange={() => searchParam(page.url, 'type', data.type, 'page')}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
</Select>
|
</Select>
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.sort}
|
bind:value={data.sort}
|
||||||
onchange={() => searchParam($page.url, 'sort', data.sort, 'page')}
|
onchange={() => searchParam(page.url, 'sort', data.sort, 'page')}
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{#snippet customLabel()}
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<Pageination
|
<Pageination
|
||||||
page={data.page}
|
page={data.page}
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
on:change={(p) => searchParam(page.url, 'page', p.detail.toString())}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||||
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
|
||||||
interface Props {
|
interface Props {
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet
|
||||||
}
|
}
|
||||||
|
|
||||||
let { children }: Props = $props();
|
let { children }: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
class="overflow-auto"
|
class="overflow-auto"
|
||||||
currentRoute={$page.url.toString()}
|
currentRoute={page.url.toString()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/state'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { XMark, Icon } from 'svelte-hero-icons'
|
import { XMark, Icon } from 'svelte-hero-icons'
|
||||||
</script>
|
</script>
|
||||||
@@ -14,5 +14,5 @@
|
|||||||
{$t('message.error')}
|
{$t('message.error')}
|
||||||
</h1>
|
</h1>
|
||||||
<p class="text-red-800 dark:text-red-300">{$t('routes.verifyEmail.error')}</p>
|
<p class="text-red-800 dark:text-red-300">{$t('routes.verifyEmail.error')}</p>
|
||||||
<code>{$page.error?.message}</code>
|
<code>{page.error?.message}</code>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user