Merge pull request #642 from Xyphyn/2.0.2-fixes

2.0.2 fixes
This commit is contained in:
Xylight authored and GitHub committed 2025-08-30 22:46:14 +00:00
commit 10aed8559e
45 files changed
+351 -343

No files matched your search

-1
View File
@@ -14,7 +14,6 @@ declare global {
slots?: {
sidebar?: {
component?: ComponentType
// eslint-disable-next-line
props?: any
}
}
@@ -14,7 +14,6 @@
listing_type?: ListingType
showWhenEmpty?: boolean
placeholder?: string
// eslint-disable-next-line
onselect?: (item: any) => void
}
@@ -5,7 +5,9 @@
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import RelativeDate, {
formatRelativeDate,
} from '$lib/components/util/RelativeDate.svelte'
import { t } from '$lib/i18n/translations'
import { getClient } from '$lib/lemmy.svelte.js'
import { errorMessage } from '$lib/lemmy/error'
@@ -168,8 +170,20 @@
date={publishedToDate(node.comment_view.comment.published)}
/>
<span class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 ml-1">
{#if node.comment_view.comment.updated}
<Icon src={Pencil} solid size="12" aria-label="Edited" />
{#if node.comment_view.comment.updated}{@const edited = $t(
'post.meta.lastEdited',
{
default: formatRelativeDate(
publishedToDate(node.comment_view.comment.updated),
{
style: 'long',
},
),
},
)}
<div title={edited}>
<Icon src={Pencil} micro size="14" />
</div>
{/if}
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
<Icon
@@ -22,8 +22,6 @@
Sun,
Trophy,
} from 'svelte-hero-icons'
import { backOut } from 'svelte/easing'
import { fly } from 'svelte/transition'
interface Props extends SelectProps<string> {
selected: string
+13 -3
View File
@@ -55,7 +55,7 @@
import { instance } from '$lib/instance.svelte'
import { settings, type View } from '$lib/settings.svelte'
import type { Community, Person, SubscribedType } from 'lemmy-js-client'
import { Badge, Popover } from 'mono-svelte'
import { Badge, modal, Popover } from 'mono-svelte'
import {
Bookmark,
ExclamationTriangle,
@@ -147,6 +147,7 @@
{#snippet target(attachment)}
<button
{@attach attachment}
class={[
'row-span-2 shrink-0 mr-2 self-center group/btn',
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
@@ -229,15 +230,24 @@
<RelativeDate date={published} class="shrink-0" />
{/if}
{#if edited}
<div
<button
title={$t('post.meta.lastEdited', {
default: formatRelativeDate(publishedToDate(edited), {
style: 'long',
}),
})}
onclick={() =>
modal({
title: $t('common.info'),
body: $t('post.meta.lastEdited', {
default: formatRelativeDate(publishedToDate(edited), {
style: 'long',
}),
}),
})}
>
<Icon src={Pencil} micro size="14" />
</div>
</button>
{/if}
</div>
<div
@@ -23,7 +23,9 @@
Icon,
} from 'svelte-hero-icons'
import InfiniteScroll from 'svelte-infinite-scroll'
import { expoOut } from 'svelte/easing'
import { SvelteSet } from 'svelte/reactivity'
import { fly } from 'svelte/transition'
interface Props {
posts: PostView[]
@@ -200,12 +202,11 @@
>
{#snippet item(row)}
<li
in:fly={row < 7
? { duration: 800, easing: expoOut, y: 24, delay: row * 50 }
: { opacity: 1, duration: 0 }}
data-index={row}
style={row < 7 ? `--anim-delay: ${row * 50}ms` : ''}
class={[
'relative post-container px-3 sm:px-6',
row < 7 && 'pop-in opacity-0',
]}
class={['relative post-container px-3 sm:px-6', row < 7 && '']}
>
<Post
bind:post={posts[row]}
@@ -278,21 +279,3 @@
{/if}
{@render children?.()}
</ul>
<style lang="postcss">
@keyframes popIn {
from {
transform: translateY(24px);
opacity: 0;
}
to {
transform: translateY(0px);
opacity: 1;
}
}
.pop-in {
animation: popIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards
var(--anim-delay);
}
</style>
@@ -36,7 +36,6 @@
marked.use(linkify, {
extensions: [
// @ts-expect-error hell with marked
// eslint-disable-next-line
containerExtension((params: any) => {
if (params.type == 'spoiler') {
return {
@@ -49,7 +48,6 @@
return null
}),
// @ts-expect-error hell with marked
// eslint-disable-next-line
subSupscriptExtension((params: any) => {
if (params.type == 'subscript') {
return {
-1
View File
@@ -28,7 +28,6 @@
{#if icon}
<div
class={[
,
iconClass
? iconClass
: 'bg-slate-100 dark:bg-zinc-900 p-3 rounded-2xl text-primary-900 dark:text-primary-100',
@@ -0,0 +1,19 @@
<script lang="ts">
import type { Snippet } from 'svelte'
const placements = {
top: 'top-6 lg:top-22',
bottom: 'bottom-22 lg:bottom-6',
}
interface Props {
placement: keyof typeof placements
children?: Snippet
}
let { placement, children }: Props = $props()
</script>
<div class={['sticky z-30 mb-0', placements[placement]]}>
{@render children?.()}
</div>
+1 -1
View File
@@ -40,7 +40,7 @@
class={[
'fixed lg:sticky bottom-0 lg:top-0',
!dockVisible && 'max-lg:-bottom-24',
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
'max-w-3xl p-3 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
'w-full z-50 pointer-events-none',
]}
style="transition: bottom .4s cubic-bezier(0.075, 0.82, 0.165, 1);"
@@ -43,7 +43,7 @@
{@render children?.()}
</h1>
{#if extended}
<div class="mt-4">
<div class="flex flex-col gap-3 mt-3">
{@render extended?.()}
</div>
{/if}
@@ -56,7 +56,7 @@
{#snippet prefix()}
<div class={(icon || customIcon) && adaptive ? 'lg:hidden' : ''}>
{#if icon}
<Icon src={icon} size="18" micro />
<Icon src={icon} size="20" mini />
{:else}
{@render customIcon?.({ size: 16, isSelected })}
{/if}
+1 -1
View File
@@ -133,7 +133,7 @@
{/snippet}
{$t('nav.menu.settings')}
</MenuButton>
<Select bind:value={theme.colorScheme} size="sm" placement="left">
<Select bind:value={theme.colorScheme} size="sm" placement="bottom">
{#snippet target(attachment)}
<MenuButton
{@attach attachment}
@@ -42,7 +42,6 @@
const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout>
// eslint-disable-next-line
return function (this: any, ...args: any[]) {
clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms)
@@ -182,7 +182,7 @@ export function getGroups(
{
name: t.get('filter.sort.top.time.6hours'),
icon: ChartBar,
href: '/?sort=TopSixHours',
href: '/?sort=TopSixHour',
},
{
name: t.get('filter.sort.top.time.hour'),
@@ -3,7 +3,6 @@
import { Modal } from 'mono-svelte'
interface Props {
// eslint-disable-next-line
object: any
open?: boolean
title?: import('svelte').Snippet
@@ -1,7 +1,6 @@
<script lang="ts">
import DebugTree from './DebugTree.svelte'
interface Props {
// eslint-disable-next-line
object: any
isParent?: boolean
}
+4 -3
View File
@@ -603,12 +603,12 @@
"title": "Removing Submission",
"titleRestore": "Restoring Submission",
"titlePurge": "Purging Submission",
"withReason": "Reply with reason",
"withReason": "Notify user",
"comment": "Comment",
"message": "Message",
"failReply": "Failed to post reply. Removing anyway...",
"failMessage": "Failed to message user. Removing anyway...",
"failEmptyReply": "Your reply cannot be empty if 'Reply with reason' is enabled.",
"failEmptyReply": "Your reply cannot be empty if 'Notify user' is enabled.",
"successPurge": "Successfully purged that submission."
},
"reportModal": {
@@ -648,7 +648,8 @@
"general": "General",
"remove": "Remove",
"download": "Download",
"attach": "Attach file"
"attach": "Attach file",
"info": "Info"
},
"message": {
"success": "Success",
+1 -1
View File
@@ -127,7 +127,7 @@ export const aliases = new Map([
])
export const { t, locale, locales, loading, loadTranslations } = new i18n<
Parser.Params<any, object>, // eslint-disable-line
Parser.Params<any, object>,
object,
object
>(config)
-1
View File
@@ -14,7 +14,6 @@ export function errorMessage(error: any, instance?: string): string {
return t.get(`error.${error}`)
} catch {
// eslint-disable-next-line
return error as any
}
}
+7 -4
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import type { Snippet } from 'svelte'
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
interface Props extends HTMLAttributes<HTMLSpanElement> {
@@ -8,13 +9,14 @@
*/
text?: string | undefined
class?: ClassValue
children?: import('svelte').Snippet
customText?: Snippet
}
let {
for: forID = undefined,
text = undefined,
class: clazz = '',
customText,
children,
...rest
}: Props = $props()
@@ -26,8 +28,9 @@
class={['text-sm text-slate-800 dark:text-zinc-200 font-medium', clazz]}
>
{#if text}
{text}
{:else if children}
{@render children?.()}
<div class="inline-block">{text}</div>
{:else if customText}
{@render customText?.()}
{/if}
{@render children?.()}
</label>
+85 -84
View File
@@ -93,91 +93,92 @@
</script>
{#snippet selectTarget(attachment: Attachment)}
<Label text={label} class={['space-y-1 relative', clazz, baseClass]}>
{@render customLabel?.()}
<Icon
src={ChevronUpDown}
micro
size="16"
class="absolute right-1.5 bottom-1 box-border pointer-events-none z-10 text-slate-600 dark:text-zinc-400"
/>
<select
{@attach attachment}
{...rest}
bind:this={element}
class={[
buttonSize[size],
buttonShadow[shadow],
buttonColor.secondary,
'appearance-none transition-colors rounded-xl text-sm w-full min-w-full cursor-pointer pr-6',
selectClass,
clazz,
]}
bind:value
onmousedown={e => {
e.preventDefault()
}}
onkeypress={e => {
e.preventDefault()
open = !open
}}
{onchange}
{oncontextmenu}
{placeholder}
>
{#if placeholder}
<option disabled selected value="">{placeholder}</option>
{/if}
{@render children?.()}
</select>
<Label text={label} customText={customLabel} class={['space-y-1 relative', clazz, baseClass]}>
<div class="relative" role="presentation">
<select
{@attach attachment}
{...rest}
bind:this={element}
class={[
buttonSize[size],
buttonShadow[shadow],
buttonColor.secondary,
'appearance-none transition-colors rounded-xl text-sm w-full min-w-full cursor-pointer pr-6',
selectClass,
clazz,
]}
bind:value
onmousedown={e => {
e.preventDefault()
}}
onkeypress={e => {
e.preventDefault()
open = !open
}}
{onchange}
{oncontextmenu}
{placeholder}
>
{#if placeholder}
<option disabled selected value="">{placeholder}</option>
{/if}
{@render children?.()}
</select>
<Icon
src={ChevronUpDown}
micro
size="16"
class="absolute bottom-1/2 translate-y-1/2 right-1 box-border pointer-events-none z-10 text-slate-600 dark:text-zinc-400"
/>
</div>
</Label>
{/snippet}
<Menu bind:open {placement}>
{#snippet target(attachment)}
{@const render = passedTarget ?? selectTarget}
{@render render?.(attachment)}
{/snippet}
{#each context.options as option (option)}
{#if customOption}{@render customOption({
option,
selected: option.value == value,
})}{:else}
<MenuButton
onclick={async () => {
value = option.value
await tick()
element?.dispatchEvent(new Event('change', { bubbles: true }))
}}
size="custom"
disabled={option.disabled}
color="none"
class={[
'min-h-0! py-1 hover:bg-slate-100 dark:hover:bg-zinc-800',
option.value == value &&
'bg-slate-100 dark:bg-zinc-800 text-primary-900 dark:text-primary-100 font-medium',
option.disabled &&
'pointer-events-none text-slate-600 dark:text-zinc-400',
option.isLabel && 'text-xs mt-2',
]}
>
{#if option.value == value}
<Icon
src={CheckCircle}
size="16"
micro
class="text-primary-900 dark:text-primary-100"
/>
{:else if option.icon}
<Icon
src={option.icon}
size="16"
micro
class="text-slate-600 dark:text-zinc-400"
/>
{/if}
{@html option.label}
</MenuButton>
<Menu bind:open {placement}>
{#snippet target(attachment)}
{@const render = passedTarget ?? selectTarget}
{@render render?.(attachment)}
{/snippet}
{#each context.options as option (option)}
{#if customOption}{@render customOption({
option,
selected: option.value == value,
})}{:else}
<MenuButton
onclick={async () => {
value = option.value
await tick()
element?.dispatchEvent(new Event('change', { bubbles: true }))
}}
size="custom"
disabled={option.disabled}
color="none"
class={[
'min-h-0! py-1 hover:bg-slate-100 dark:hover:bg-zinc-800',
option.value == value &&
'bg-slate-100 dark:bg-zinc-800 text-primary-900 dark:text-primary-100 font-medium',
option.disabled &&
'pointer-events-none text-slate-600 dark:text-zinc-400',
option.isLabel && 'text-xs mt-2',
]}
>
{#if option.value == value}
<Icon
src={CheckCircle}
size="16"
micro
class="text-primary-900 dark:text-primary-100"
/>
{:else if option.icon}
<Icon
src={option.icon}
size="16"
micro
class="text-slate-600 dark:text-zinc-400"
/>
{/if}
{/each}
</Menu>
{@html option.label}
</MenuButton>
{/if}
{/each}
</Menu>
+1 -1
View File
@@ -100,7 +100,7 @@ bg-white/50 dark:bg-black/50 box-border p-4"
}}
class="w-full border border-slate-200 border-b-slate-300
dark:border-zinc-900
rounded-3xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto
rounded-2xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto
p-5 flex flex-col gap-2 dark:bg-zinc-950
bg-slate-50 relative {clazz}"
>
-1
View File
@@ -1,6 +1,5 @@
export const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout>
// eslint-disable-next-line
return function (this: any, ...args: any[]) {
clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms)
+3 -2
View File
@@ -76,12 +76,13 @@
let nprogressTimeout = -1
$effect(() => {
if (navigating.to)
if (navigating.to) {
clearTimeout(nprogressTimeout)
nprogressTimeout = setTimeout(
() => nProgress.start(),
200,
) as unknown as number
else {
} else {
if (nprogressTimeout > -1) {
clearTimeout(nprogressTimeout)
nprogressTimeout = -1
+30 -24
View File
@@ -21,12 +21,12 @@
onMount(async () => {
await data.feed.value
$effect(() => {
if (data.filters.value.type_)
settings.defaultSort.feed = data.filters.value.type_
if (data.filters.value.sort)
settings.defaultSort.sort = data.filters.value.sort
})
})
$effect(() => {
if (data.filters.value.type_)
settings.defaultSort.feed = data.filters.value.type_
if (data.filters.value.sort)
settings.defaultSort.sort = data.filters.value.sort
})
const FeedComponent = $derived(
@@ -45,27 +45,33 @@
{$t('routes.frontpage.title')}
{#snippet extended()}
<form class="flex items-center gap-2" method="get" action="/">
{#if data.filters.value.type_}
<Location
name="type"
<form class="" method="get" action="/">
<div class="flex flex-row gap-4">
{#if data.filters.value.type_}
<Location
name="type"
navigate
bind:selected={data.filters.value.type_}
/>
{/if}
<Sort
placement="bottom"
name="sort"
navigate
bind:selected={data.filters.value.type_}
bind:selected={data.filters.value.sort}
/>
{/if}
<Sort
placement="bottom"
name="sort"
navigate
bind:selected={data.filters.value.sort}
/>
<ViewSelect placement="bottom" />
<ViewSelect placement="bottom" />
<noscript>
<Button class="self-end h-[34px] aspect-square" size="custom" submit>
<Icon src={ArrowRight} size="16" micro />
</Button>
</noscript>
<noscript>
<Button
class="self-end h-[34px] aspect-square"
size="custom"
submit
>
<Icon src={ArrowRight} size="16" micro />
</Button>
</noscript>
</div>
</form>
{/snippet}
</Header>
+1 -1
View File
@@ -126,7 +126,7 @@
</div>
{/snippet}
</Header>
<form class="accounts-grid mt-4 sm:mt-6 gap-4">
<form class="accounts-grid gap-4">
<CommonList
selected={p => p.id == profile.meta.profile}
items={profile.meta.profiles}
-7
View File
@@ -1,15 +1,9 @@
<script>
import { notifications } from '$lib/auth.svelte'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import {} from '$lib/components/ui/layout/Shell.svelte'
import { t } from '$lib/i18n/translations'
import { Badge } from 'mono-svelte'
/**
* @typedef {Object} Props
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let { children } = $props()
</script>
@@ -49,7 +43,6 @@
name: $t('routes.admin.media.title'),
},
]}
class="overflow-auto"
/>
{@render children?.()}
</div>
+3
View File
@@ -1,6 +1,9 @@
import { profile } from '$lib/auth.svelte.js'
import { getClient, site as siteStore } from '$lib/lemmy.svelte.js'
import { error } from '@sveltejs/kit'
export async function load({ fetch }) {
if (!profile.current.jwt) error(403)
const site = siteStore
if (!site.data) {
+2 -2
View File
@@ -74,7 +74,7 @@
{/if}
</ul>
<form
class="flex flex-row items-center gap-2 mt-auto w-full"
class="flex flex-row gap-2 mt-auto w-full"
onsubmit={preventDefault(() => {
trycatch(async () => {
if (!profile.current?.jwt || newAdmin == '') return
@@ -106,7 +106,7 @@
disabled={adding}
rounding="xl"
color="primary"
class="h-full"
size="sm"
submit
>
{#snippet prefix()}
+3 -4
View File
@@ -41,14 +41,13 @@
<title>{$t('routes.communities.title')}</title>
</svelte:head>
<Header pageHeader class="justify-between">
<span>{$t('routes.communities.title')}</span>
<Header pageHeader>
{$t('routes.communities.title')}
{#snippet extended()}
<form method="get" action="/communities" class="contents" bind:this={form}>
<SearchBar bind:query={search} />
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center">
<div class="flex flex-row flex-wrap gap-4 items-center">
<Location
name="type"
selected={data.type}
+1 -2
View File
@@ -2,7 +2,6 @@
import { goto } from '$app/navigation'
import { profile } from '$lib/auth.svelte.js'
import PostForm from '$lib/components/lemmy/post/form/PostForm.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/i18n/translations.js'
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
import { onDestroy, onMount } from 'svelte'
@@ -24,7 +23,7 @@
})
// TODO remove this
// eslint-disable-next-line
let post = getSessionStorage('postDraft') as any
</script>
+3 -4
View File
@@ -12,6 +12,7 @@
import { Button, Option, Select } from 'mono-svelte'
import { ArrowPath, Check, Funnel, Icon, Inbox } from 'svelte-hero-icons'
import InboxItem from './InboxItem.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
let { data } = $props()
@@ -114,9 +115,7 @@
</CommonList>
{/if}
{#if !(data.page == 1 && (data?.inbox?.value.length ?? 0) == 0)}
<div
class="sticky z-30 mx-auto max-w-full self-end mt-auto bottom-22 lg:bottom-6"
>
<Fixate placement="bottom">
<Pageination
hasMore={!(
!data.inbox || (data.inbox.value?.length ?? 0) < (data?.limit ?? 0)
@@ -124,5 +123,5 @@
page={data.page}
href={page => `?page=${page}`}
/>
</div>
</Fixate>
{/if}
+1
View File
@@ -92,6 +92,7 @@
<Button
color="primary"
rounding="pill"
class="w-max"
onclick={() => (searchModal.open = !searchModal.open)}
>
<Icon src={ChatBubbleOvalLeftEllipsis} size="18" mini />
+1 -3
View File
@@ -21,6 +21,4 @@
},
]}
/>
<div class="w-full space-y-4 pb-8">
{@render children?.()}
</div>
{@render children?.()}
+76 -72
View File
@@ -15,6 +15,7 @@
import { tick } from 'svelte'
import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons'
import Report from './Report.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
let { data = $bindable() } = $props()
@@ -71,67 +72,67 @@
}
</script>
<div class="mb-4 flex flex-col gap-4">
<Header pageHeader>
{$t('routes.moderation.title')}
{#snippet extended()}
<div class="flex flex-row gap-2 flex-wrap items-end">
<Select
bind:value={data.type.value}
onchange={async () => {
await tick()
searchParam(page.url, 'type', data.type.value, 'page')
}}
>
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={Funnel} size="15" mini />
{$t('filter.filter')}
</span>
{/snippet}
<Option value="all">{$t('filter.location.all')}</Option>
<Option value="unread">{$t('filter.unread')}</Option>
</Select>
<Button
loading={batch.progress >= 0}
disabled={batch.progress >= 0 || data.items.value?.length == 0}
onclick={markAllAsResolved}
class="h-max ml-auto"
rounding="pill"
color="primary"
>
<Icon src={Check} size="16" mini />
{$t('routes.moderation.markAll')}
</Button>
</div>
{#if data.filters.community}
<ul class="font-normal flex flex-col gap-2 mt-2">
<li>
<span class="text-sm text-slate-600 dark:text-zinc-400">
{$t('form.post.community')}
</span>
{#await client().getCommunity({ id: data.filters.community })}
<Spinner width={24} />
{:then community}
<a
class="inline"
aria-label={$t('common.remove')}
href="?community="
>
<Icon src={XMark} size="16" micro class="inline" />
</a>
<CommunityLink
class="w-max inline"
community={community.community_view.community}
/>
{/await}
</li>
</ul>
{/if}
{/snippet}
</Header>
</div>
<ProgressBar progress={batch.progress} />
<Header pageHeader>
{$t('routes.moderation.title')}
{#snippet extended()}
<div class="flex flex-row gap-2 flex-wrap items-end">
<Select
bind:value={data.type.value}
onchange={async () => {
await tick()
searchParam(page.url, 'type', data.type.value, 'page')
}}
>
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={Funnel} size="15" mini />
{$t('filter.filter')}
</span>
{/snippet}
<Option value="all">{$t('filter.location.all')}</Option>
<Option value="unread">{$t('filter.unread')}</Option>
</Select>
<Button
loading={batch.progress >= 0}
disabled={batch.progress >= 0 || data.items.value?.length == 0}
onclick={markAllAsResolved}
class="h-max ml-auto"
rounding="pill"
color="primary"
>
<Icon src={Check} size="16" mini />
{$t('routes.moderation.markAll')}
</Button>
</div>
{#if data.filters.community}
<ul class="font-normal flex flex-col gap-2 mt-2">
<li>
<span class="text-sm text-slate-600 dark:text-zinc-400">
{$t('form.post.community')}
</span>
{#await client().getCommunity({ id: data.filters.community })}
<Spinner width={24} />
{:then community}
<a
class="inline"
aria-label={$t('common.remove')}
href="?community="
>
<Icon src={XMark} size="16" micro class="inline" />
</a>
<CommunityLink
class="w-max inline"
community={community.community_view.community}
/>
{/await}
</li>
</ul>
{/if}
{/snippet}
</Header>
{#if batch.progress > 0}
<ProgressBar progress={batch.progress} />
{/if}
{#if data.items?.value && data.items?.value.length > 0}
<CommonList items={data.items?.value} size="lg">
{#snippet item(item)}
@@ -153,16 +154,19 @@
{/if}
{/snippet}
</CommonList>
<Pageination
page={data.page}
href={current => `?page=${current}`}
hasMore={data.items.value.length >= 20}
/>
<Fixate placement="bottom">
<Pageination
page={data.page}
href={current => `?page=${current}`}
hasMore={data.items.value.length >= 20}
/>
</Fixate>
{:else}
<Placeholder
icon={ShieldCheck}
title={$t('routes.moderation.empty.title')}
description={$t('routes.moderation.empty.description')}
/>
<div class="h-full grid place-items-center">
<Placeholder
icon={ShieldCheck}
title={$t('routes.moderation.empty.title')}
description={$t('routes.moderation.empty.description')}
/>
</div>
{/if}
<div class="h-4"></div>
@@ -2,10 +2,11 @@
import { profile } from '$lib/auth.svelte.js'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
import Entity from '$lib/components/ui/Entity.svelte'
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { t } from '$lib/i18n/translations.js'
import { getClient } from '$lib/lemmy.svelte.js'
import type {
@@ -14,11 +15,8 @@
PersonBlockView,
} from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import Material from 'mono-svelte/materials/Material.svelte'
import { Check, Icon, XMark } from 'svelte-hero-icons'
import type { PageData } from './$types.js'
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
interface Props {
// sveltekit doesn't feel like making types work right now
+3 -2
View File
@@ -2,6 +2,7 @@
import { page } from '$app/state'
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
import PostItem from '$lib/components/lemmy/post/PostItem.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte'
@@ -78,10 +79,10 @@
{/snippet}
</CommonList>
{/if}
<div class="sticky z-30 mx-auto max-w-full bottom-22 lg:bottom-6">
<Fixate placement="bottom">
<Pageination
hasMore={data.data.length == 40}
href={page => `?page=${page}`}
page={data.page}
/>
</div>
</Fixate>
+1 -1
View File
@@ -26,7 +26,7 @@ export async function load({ url, fetch }) {
const { posts, comments } = await client({ func: fetch }).getPersonDetails({
saved_only: true,
limit: 20,
page: 1,
page: page,
person_id: user?.local_user_view.person.id,
})
+1 -6
View File
@@ -55,12 +55,7 @@
<Header pageHeader>
{$t('routes.search.title')}
{#snippet extended()}
<form
method="get"
action="/search"
class="flex flex-col gap-4"
bind:this={form}
>
<form method="get" action="/search" class="contents" bind:this={form}>
<SearchBar bind:query={data.filters.value.query} />
<div class="flex flex-row flex-wrap items-center gap-4">
<Select
+23 -25
View File
@@ -13,30 +13,28 @@
let searchElement = $state<HTMLInputElement>()
</script>
<div class="mt-4 mb-0 sticky z-30 top-6 lg:top-22">
<div
class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl"
<div
class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl"
>
<TextInput
bind:value={query}
bind:element={searchElement}
name="q"
placeholder={$t('routes.search.query')}
size="lg"
class="flex-1 rounded-full! h-full text-base!"
/>
<Button
submit
color="primary"
size="custom"
class="shrink-0 h-full aspect-square shadow-md"
title="Search"
rounding="pill"
loading={navigating.to?.route.id == '/search'}
>
<TextInput
bind:value={query}
bind:element={searchElement}
name="q"
placeholder={$t('routes.search.query')}
size="lg"
class="flex-1 rounded-full! h-full text-base!"
/>
<Button
submit
color="primary"
size="custom"
class="shrink-0 h-full aspect-square shadow-md"
title="Search"
rounding="pill"
loading={navigating.to?.route.id == '/search'}
>
{#snippet prefix()}
<Icon src={MagnifyingGlass} size="16" micro />
{/snippet}
</Button>
</div>
{#snippet prefix()}
<Icon src={MagnifyingGlass} size="16" micro />
{/snippet}
</Button>
</div>
+34 -40
View File
@@ -153,47 +153,41 @@
class="flex flex-row flex-wrap
flex-1 gap-2 w-full lg:w-max max-w-full lg:self-end"
>
<div class="max-w-full">
<Select bind:value={settings.defaultSort.feed}>
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={GlobeAmericas} size="16" mini />
{$t('filter.location.label')}
</span>
{/snippet}
<Option value="All">{$t('filter.location.all')}</Option>
<Option value="Local">{$t('filter.location.local')}</Option>
<Option value="Subscribed">
{$t('filter.location.subscribed')}
</Option>
<Option value="Moderator">
{$t('filter.location.moderator')}
</Option>
</Select>
</div>
<div class="max-w-full">
<Sort bind:selected={settings.defaultSort.sort} navigate={false} />
</div>
<div class="max-w-full">
<Select bind:value={settings.defaultSort.comments}>
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini />
{$t('content.comments')}
</span>
{/snippet}
<Select bind:value={settings.defaultSort.feed}>
{#snippet customLabel()}
<div class="flex items-center gap-1">
<Icon src={GlobeAmericas} size="16" mini />
{$t('filter.location.label')}
</div>
{/snippet}
<Option value="All">{$t('filter.location.all')}</Option>
<Option value="Local">{$t('filter.location.local')}</Option>
<Option value="Subscribed">
{$t('filter.location.subscribed')}
</Option>
<Option value="Moderator">
{$t('filter.location.moderator')}
</Option>
</Select>
<Sort bind:selected={settings.defaultSort.sort} navigate={false} />
<Select bind:value={settings.defaultSort.comments}>
{#snippet customLabel()}
<div class="flex items-center gap-1">
<Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini />
{$t('content.comments')}
</div>
{/snippet}
<Option icon={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
<Option icon={Trophy} value="Top">
{$t('filter.sort.top.label')}
</Option>
<Option icon={Star} value="New">{$t('filter.sort.new')}</Option>
<Option icon={Clock} value="Old">{$t('filter.sort.old')}</Option>
<Option icon={ArrowTrendingDown} value="Controversial">
{$t('filter.sort.controversial')}
</Option>
</Select>
</div>
<Option icon={Fire} value="Hot">{$t('filter.sort.hot')}</Option>
<Option icon={Trophy} value="Top">
{$t('filter.sort.top.label')}
</Option>
<Option icon={Star} value="New">{$t('filter.sort.new')}</Option>
<Option icon={Clock} value="Old">{$t('filter.sort.old')}</Option>
<Option icon={ArrowTrendingDown} value="Controversial">
{$t('filter.sort.controversial')}
</Option>
</Select>
</div>
</Setting>
<ToggleSetting
+1 -1
View File
@@ -157,7 +157,7 @@
class="flex flex-col gap-4 h-full w-full flex-2/3"
onsubmit={preventDefault(submit)}
>
<Button href="/signup" class="inline-block mb-4 w-max" rounding="pill">
<Button href="/accounts" class="inline-block mb-4 w-max" rounding="pill">
<Icon src={ArrowLeft} size="16" micro />
{$t('common.back')}
</Button>
+2 -2
View File
@@ -51,10 +51,10 @@
</Modal>
{/if}
<Header pageHeader>{$t('routes.theme.title')}</Header>
<div class="flex flex-col gap-4 h-full">
<Header pageHeader>{$t('routes.theme.title')}</Header>
<h3
class="relative top-[26px] z-10 left-6 font-medium text-sm bg-slate-25 dark:bg-zinc-925 w-max px-1"
class="relative -mb-7 z-10 left-6 font-medium text-sm bg-slate-25 dark:bg-zinc-925 w-max px-1"
>
{$t('routes.theme.preset.presets')}
</h3>
+2 -2
View File
@@ -11,7 +11,7 @@
--font-display: Inter, system-ui, sans-serif;
--font-mono: monospace;
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);
--ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1);
--spacing-22: 88px;
@@ -50,7 +50,7 @@
@keyframes pop-in {
0% {
transform: translateY(16px);
transform: translateY(12px);
opacity: 0;
}
100% {