Merge pull request #598 from Xyphyn/generic-issue-fix
fix: Lots of generic issues fixes
This commit is contained in:
22 files changed
+139
-114
No files matched your search
+6
-58
@@ -1,29 +1,11 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html class="dark" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/img/logo-background.svg" />
|
<link rel="icon" href="%sveltekit.assets%/img/logo-background.svg" />
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="keywords" content="lemmy, client" />
|
<meta name="keywords" content="lemmy, client" />
|
||||||
<script defer type="">
|
|
||||||
const dark = () =>
|
|
||||||
localStorage.theme == 'dark' ||
|
|
||||||
((!localStorage.theme || localStorage.theme == 'system') &&
|
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').matches)
|
|
||||||
|
|
||||||
if (dark()) document.documentElement.classList.add('dark')
|
|
||||||
else document.documentElement.classList.remove('dark')
|
|
||||||
|
|
||||||
window
|
|
||||||
.matchMedia('(prefers-color-scheme: dark)')
|
|
||||||
.addEventListener('change', (event) => {
|
|
||||||
if (dark()) document.documentElement.classList.add('dark')
|
|
||||||
else document.documentElement.classList.remove('dark')
|
|
||||||
})
|
|
||||||
|
|
||||||
// document.getElementById("loader")?.classList.remove('hidden')
|
|
||||||
</script>
|
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover">
|
||||||
@@ -33,13 +15,11 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
z-index: -50;
|
z-index: -50;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
inset: 0;
|
||||||
left: 0;
|
display: grid;
|
||||||
display: flex;
|
place-items: center;
|
||||||
flex-direction: column;
|
background-color: #111115;
|
||||||
align-items: center;
|
color: #fafafe;
|
||||||
justify-content: center;
|
|
||||||
gap: 1rem;
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -53,39 +33,7 @@
|
|||||||
d="M45 20.8868C48.094 19.1004 51.906 19.1004 55 20.8868L72.7128 31.1132C75.8068 32.8996 77.7128 36.2008 77.7128 39.7735V60.2265C77.7128 63.7992 75.8068 67.1004 72.7128 68.8867L55 79.1133C51.906 80.8996 48.094 80.8996 45 79.1133L27.2872 68.8867C24.1932 67.1004 22.2872 63.7992 22.2872 60.2265V39.7735C22.2872 36.2008 24.1932 32.8996 27.2872 31.1132L45 20.8868Z"
|
d="M45 20.8868C48.094 19.1004 51.906 19.1004 55 20.8868L72.7128 31.1132C75.8068 32.8996 77.7128 36.2008 77.7128 39.7735V60.2265C77.7128 63.7992 75.8068 67.1004 72.7128 68.8867L55 79.1133C51.906 80.8996 48.094 80.8996 45 79.1133L27.2872 68.8867C24.1932 67.1004 22.2872 63.7992 22.2872 60.2265V39.7735C22.2872 36.2008 24.1932 32.8996 27.2872 31.1132L45 20.8868Z"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<svg
|
|
||||||
stroke="currentColor"
|
|
||||||
fill="none"
|
|
||||||
stroke-width="2"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
height="20"
|
|
||||||
width="20"
|
|
||||||
class="animate-spin"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<line x1="12" y1="2" x2="12" y2="6"></line>
|
|
||||||
<line x1="12" y1="18" x2="12" y2="22"></line>
|
|
||||||
<line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line>
|
|
||||||
<line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line>
|
|
||||||
<line x1="2" y1="12" x2="6" y2="12"></line>
|
|
||||||
<line x1="18" y1="12" x2="22" y2="12"></line>
|
|
||||||
<line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line>
|
|
||||||
<line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<style>
|
|
||||||
@keyframes spin {
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.animate-spin {
|
|
||||||
animation: spin 0.9s linear infinite;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</html>
|
</html>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
import { client } from '$lib/lemmy.svelte'
|
import { client } from '$lib/lemmy.svelte'
|
||||||
import { instanceToURL } from '$lib/util.svelte'
|
import { instanceToURL } from '$lib/util.svelte'
|
||||||
import type { LocalImage, Person } from 'lemmy-js-client'
|
import type { LocalImage, Person } from 'lemmy-js-client'
|
||||||
import { Button, toast } from 'mono-svelte'
|
import { action, Button, modal, toast } from 'mono-svelte'
|
||||||
import { ArrowDownTray, Icon, Trash } from 'svelte-hero-icons'
|
import { ArrowDownTray, Icon, Trash } from 'svelte-hero-icons'
|
||||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||||
|
|
||||||
@@ -67,7 +67,24 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
title={$t('post.actions.more.delete')}
|
title={$t('post.actions.more.delete')}
|
||||||
onclick={() => deleteImage(image)}
|
onclick={() => {
|
||||||
|
modal({
|
||||||
|
title: $t('routes.theme.preset.delete.confirm'),
|
||||||
|
body: '',
|
||||||
|
actions: [
|
||||||
|
action({
|
||||||
|
close: true,
|
||||||
|
content: $t('common.cancel'),
|
||||||
|
}),
|
||||||
|
action({
|
||||||
|
type: 'danger',
|
||||||
|
action: () => deleteImage(image),
|
||||||
|
close: true,
|
||||||
|
content: $t('post.actions.more.delete'),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon src={Square2Stack} mini size="16" />
|
<Icon src={Square2Stack} mini size="16" />
|
||||||
<div>{$t('comment.actions.link')}</div>
|
<div>{$t('post.actions.more.share')}</div>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{#if profile.data?.jwt}
|
{#if profile.data?.jwt}
|
||||||
{#if comment.creator.id == profile.data.user?.local_user_view.person.id}
|
{#if comment.creator.id == profile.data.user?.local_user_view.person.id}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
Trash,
|
Trash,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||||
|
import { settings } from '$lib/settings.svelte'
|
||||||
|
|
||||||
let showInfo = $state(false)
|
let showInfo = $state(false)
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -65,11 +66,16 @@
|
|||||||
? 'flex-col gap-2'
|
? 'flex-col gap-2'
|
||||||
: 'flex-row'} gap-2 items-center"
|
: 'flex-row'} gap-2 items-center"
|
||||||
>
|
>
|
||||||
{#if icon}{@render icon()}{:else}
|
{#if icon}{@render icon()}{:else if community.community.nsfw && settings.nsfwBlur}
|
||||||
|
<div class="w-8 h-8 rounded-full bg-red-400"></div>
|
||||||
|
{:else}
|
||||||
<Avatar
|
<Avatar
|
||||||
url={community.community.icon}
|
url={community.community.icon}
|
||||||
width={32}
|
width={32}
|
||||||
alt={community.community.name}
|
alt={community.community.name}
|
||||||
|
class={[
|
||||||
|
community.community.nsfw && settings.nsfwBlur && 'blur-3xl',
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -133,6 +133,7 @@
|
|||||||
style="grid-area: meta;"
|
style="grid-area: meta;"
|
||||||
edited={post.post.updated}
|
edited={post.post.updated}
|
||||||
tags={tags?.tags}
|
tags={tags?.tags}
|
||||||
|
postUrl={post.post.url}
|
||||||
{view}
|
{view}
|
||||||
{extraBadges}
|
{extraBadges}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
style?: string
|
style?: string
|
||||||
titleClass?: string
|
titleClass?: string
|
||||||
extraBadges?: import('svelte').Snippet
|
extraBadges?: import('svelte').Snippet
|
||||||
|
postUrl?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -122,6 +123,7 @@
|
|||||||
admin: false,
|
admin: false,
|
||||||
},
|
},
|
||||||
tags = [],
|
tags = [],
|
||||||
|
postUrl,
|
||||||
style = '',
|
style = '',
|
||||||
titleClass = '',
|
titleClass = '',
|
||||||
extraBadges,
|
extraBadges,
|
||||||
@@ -150,6 +152,15 @@
|
|||||||
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
|
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
{#if community.nsfw && settings.nsfwBlur}
|
||||||
|
<div
|
||||||
|
style="width: {view == 'compact' ? 24 : 32}; height: {view ==
|
||||||
|
'compact'
|
||||||
|
? 24
|
||||||
|
: 32}"
|
||||||
|
class="bg-red-400 rounded-xl"
|
||||||
|
></div>
|
||||||
|
{:else}
|
||||||
<Avatar
|
<Avatar
|
||||||
url={community?.icon}
|
url={community?.icon}
|
||||||
width={view == 'compact' ? 24 : 32}
|
width={view == 'compact' ? 24 : 32}
|
||||||
@@ -157,6 +168,7 @@
|
|||||||
circle={false}
|
circle={false}
|
||||||
class="group-hover/btn:scale-90 group-active/btn:scale-[.85] transition-transform"
|
class="group-hover/btn:scale-90 group-active/btn:scale-[.85] transition-transform"
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet popover()}
|
{#snippet popover()}
|
||||||
@@ -322,7 +334,12 @@
|
|||||||
</header>
|
</header>
|
||||||
{#if title && id}
|
{#if title && id}
|
||||||
<a
|
<a
|
||||||
href="/post/{encodeURIComponent(instance.data)}/{id}"
|
href={settings.posts.titleOpensUrl && postUrl
|
||||||
|
? postUrl
|
||||||
|
: `/post/${encodeURIComponent(instance.data)}/${id}`}
|
||||||
|
target={settings.posts.titleOpensUrl || settings.openLinksInNewTab
|
||||||
|
? '_blank'
|
||||||
|
: undefined}
|
||||||
class={[
|
class={[
|
||||||
'inline max-[480px]:mt-0!',
|
'inline max-[480px]:mt-0!',
|
||||||
'hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors',
|
'hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors',
|
||||||
|
|||||||
@@ -46,11 +46,21 @@
|
|||||||
|
|
||||||
const videoID = youtubeVideoID(inputUrl)
|
const videoID = youtubeVideoID(inputUrl)
|
||||||
|
|
||||||
if (autoplay) url.searchParams.set('autoplay', '1')
|
if (videoID) {
|
||||||
|
const embedUrl = new URL(
|
||||||
|
`https://${youtubeDomain(settings.embeds.youtube)}/embed/${videoID}`,
|
||||||
|
)
|
||||||
|
|
||||||
return `https://${youtubeDomain(
|
embedUrl.searchParams.set('start', url.searchParams.get('t') ?? '')
|
||||||
settings.embeds.youtube,
|
|
||||||
)}/embed/${videoID}?${url.searchParams.toString()}`
|
url.searchParams.forEach((value, key) => {
|
||||||
|
embedUrl.searchParams.set(key, value)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (autoplay) embedUrl.searchParams.set('autoplay', '1')
|
||||||
|
|
||||||
|
return embedUrl.toString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { stopPropagation } from 'svelte/legacy'
|
|
||||||
|
|
||||||
import { notifications, profile } from '$lib/auth.svelte'
|
import { notifications, profile } from '$lib/auth.svelte'
|
||||||
|
|
||||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
||||||
@@ -133,7 +131,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
{$t('nav.menu.settings')}
|
{$t('nav.menu.settings')}
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton class="py-0!">
|
<MenuButton class="py-0!" onclick={e => e.stopPropagation()}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon
|
<Icon
|
||||||
src={theme.colorScheme == 'system'
|
src={theme.colorScheme == 'system'
|
||||||
@@ -148,9 +146,6 @@
|
|||||||
/>
|
/>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<span>{$t('nav.menu.colorscheme.label')}</span>
|
<span>{$t('nav.menu.colorscheme.label')}</span>
|
||||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
||||||
<div class="contents" onclick={stopPropagation(() => {})}>
|
|
||||||
<Select
|
<Select
|
||||||
bind:value={theme.colorScheme}
|
bind:value={theme.colorScheme}
|
||||||
class="ml-auto my-auto w-24"
|
class="ml-auto my-auto w-24"
|
||||||
@@ -166,7 +161,6 @@
|
|||||||
{$t('nav.menu.colorscheme.dark')}
|
{$t('nav.menu.colorscheme.dark')}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuButton href="/theme">
|
<MenuButton href="/theme">
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
|
|||||||
@@ -313,7 +313,10 @@
|
|||||||
"messages": {
|
"messages": {
|
||||||
"conversation": "This is the beginning of your conversation with {{user}}",
|
"conversation": "This is the beginning of your conversation with {{user}}",
|
||||||
"indicator": "Messaging {{user}}",
|
"indicator": "Messaging {{user}}",
|
||||||
"start": "Start chat"
|
"start": "Start chat",
|
||||||
|
"empty": {
|
||||||
|
"title": "No messages"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moderation": {
|
"moderation": {
|
||||||
@@ -828,6 +831,10 @@
|
|||||||
"absoluteDates": {
|
"absoluteDates": {
|
||||||
"title": "Absolute timestamps",
|
"title": "Absolute timestamps",
|
||||||
"description": "Replaces relative timestamps (3 hours ago) with absolute ones (15/6/25)"
|
"description": "Replaces relative timestamps (3 hours ago) with absolute ones (15/6/25)"
|
||||||
|
},
|
||||||
|
"titleOpensUrl": {
|
||||||
|
"title": "Title opens URL",
|
||||||
|
"description": "Makes clicking the title open the post's attached URL, rather than the comments."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"embeds": {
|
"embeds": {
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ interface Settings {
|
|||||||
showHidden: boolean
|
showHidden: boolean
|
||||||
noVirtualize: boolean
|
noVirtualize: boolean
|
||||||
reverseActions: boolean
|
reverseActions: boolean
|
||||||
|
titleOpensUrl: boolean
|
||||||
}
|
}
|
||||||
infiniteScroll: boolean
|
infiniteScroll: boolean
|
||||||
language: string | null
|
language: string | null
|
||||||
@@ -172,6 +173,7 @@ export const defaultSettings: Settings = {
|
|||||||
showHidden: false,
|
showHidden: false,
|
||||||
noVirtualize: false,
|
noVirtualize: false,
|
||||||
reverseActions: toBool(env.PUBLIC_REVERSE_ACTIONS) ?? false,
|
reverseActions: toBool(env.PUBLIC_REVERSE_ACTIONS) ?? false,
|
||||||
|
titleOpensUrl: toBool(env.PUBLIC_TITLE_OPENS_URL) ?? false,
|
||||||
},
|
},
|
||||||
infiniteScroll: true,
|
infiniteScroll: true,
|
||||||
language: env.PUBLIC_LANGUAGE ?? null,
|
language: env.PUBLIC_LANGUAGE ?? null,
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import { env } from '$env/dynamic/public'
|
import { env } from '$env/dynamic/public'
|
||||||
import type { Theme, ThemeColors } from './colors.svelte'
|
import type { Theme, ThemeColors } from './colors.svelte'
|
||||||
|
|
||||||
export function getDefaultColors(): ThemeColors {
|
const PHOTON_DEFAULT = {
|
||||||
return env.PUBLIC_THEME
|
|
||||||
? JSON.parse(env.PUBLIC_THEME)
|
|
||||||
: {
|
|
||||||
slate: {
|
slate: {
|
||||||
25: '252 253 254',
|
25: '252 253 254',
|
||||||
50: '248 250 252',
|
50: '248 250 252',
|
||||||
@@ -42,18 +39,24 @@ export function getDefaultColors(): ThemeColors {
|
|||||||
white: '255 255 255',
|
white: '255 255 255',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDefaultColors(): ThemeColors {
|
||||||
|
return env.PUBLIC_THEME ? JSON.parse(env.PUBLIC_THEME) : PHOTON_DEFAULT
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDefaultTheme(): Theme {
|
export function getDefaultTheme(): Theme {
|
||||||
return {
|
return {
|
||||||
id: 0,
|
id: 0,
|
||||||
colors: getDefaultColors(),
|
colors: getDefaultColors(),
|
||||||
name: 'Default',
|
name: env.PUBLIC_THEME ? 'Instance Default' : 'Mono',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const presets: Theme[] = [
|
export const presets: Theme[] = [
|
||||||
getDefaultTheme(),
|
getDefaultTheme(),
|
||||||
|
...(env.PUBLIC_THEME
|
||||||
|
? [{ colors: PHOTON_DEFAULT, id: -10, name: 'Mono' }]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
colors: {
|
colors: {
|
||||||
slate: {
|
slate: {
|
||||||
|
|||||||
@@ -61,8 +61,6 @@
|
|||||||
? 'font-inter'
|
? 'font-inter'
|
||||||
: settings.font == 'system'
|
: settings.font == 'system'
|
||||||
? 'font-system'
|
? 'font-system'
|
||||||
: settings.font == 'satoshi/nunito'
|
|
||||||
? 'font-nunito'
|
|
||||||
: 'font-sans',
|
: 'font-sans',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -81,7 +79,6 @@
|
|||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
{#if site.data?.site_view}
|
{#if site.data?.site_view}
|
||||||
<title>{site.data?.site_view.site.name}</title>
|
|
||||||
<meta
|
<meta
|
||||||
name="theme-color"
|
name="theme-color"
|
||||||
content={rgbToHex(
|
content={rgbToHex(
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>{site.data?.site_view.site.name}</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2 max-w-full w-full min-w-0">
|
<div class="flex flex-col gap-2 max-w-full w-full min-w-0">
|
||||||
<header class="flex flex-col gap-4 relative">
|
<header class="flex flex-col gap-4 relative">
|
||||||
<Header pageHeader>
|
<Header pageHeader>
|
||||||
|
|||||||
@@ -12,14 +12,14 @@
|
|||||||
|
|
||||||
<Header pageHeader>{$t('routes.profile.media.title')}</Header>
|
<Header pageHeader>{$t('routes.profile.media.title')}</Header>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
|
||||||
{#each data.images as image (image.local_image.pictrs_delete_token)}
|
{#each data.images.value as image (image.local_image.pictrs_delete_token)}
|
||||||
<div animate:flip={{ duration: 500, easing: expoInOut }}>
|
<div animate:flip={{ duration: 500, easing: expoInOut }}>
|
||||||
<PictrsImage
|
<PictrsImage
|
||||||
image={image.local_image}
|
image={image.local_image}
|
||||||
user={image.person}
|
user={image.person}
|
||||||
ondelete={() => {
|
ondelete={() => {
|
||||||
data.images = data.images.toSpliced(
|
data.images.value = data.images.value.toSpliced(
|
||||||
data.images.findIndex(
|
data.images.value.findIndex(
|
||||||
i =>
|
i =>
|
||||||
i.local_image.pictrs_delete_token ==
|
i.local_image.pictrs_delete_token ==
|
||||||
image.local_image.pictrs_delete_token,
|
image.local_image.pictrs_delete_token,
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{#if data.images.length == 20}
|
{#if data.images.value.length == 20}
|
||||||
<Pageination
|
<Pageination
|
||||||
page={Number(page.url.searchParams.get('page')) || 1}
|
page={Number(page.url.searchParams.get('page')) || 1}
|
||||||
href={page => `?page=${page}`}
|
href={page => `?page=${page}`}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { client } from '$lib/lemmy.svelte.js'
|
import { client } from '$lib/lemmy.svelte.js'
|
||||||
|
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
const { jwt } = profile.data
|
const { jwt } = profile.data
|
||||||
@@ -11,5 +12,5 @@ export async function load({ fetch, url }) {
|
|||||||
page: page,
|
page: page,
|
||||||
})
|
})
|
||||||
|
|
||||||
return { images: res.images }
|
return { images: new ReactiveState(res.images) }
|
||||||
}
|
}
|
||||||
@@ -154,7 +154,7 @@ items-center px-2 w-max top-6 lg:top-22"
|
|||||||
class="self-center justify-self-center my-auto"
|
class="self-center justify-self-center my-auto"
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
{#each data.inbox.value as item, index (item.id)}
|
{#each data.inbox.value as item, index}
|
||||||
{#if item.creator.id != profile.data.user?.local_user_view.person.id}
|
{#if item.creator.id != profile.data.user?.local_user_view.person.id}
|
||||||
<div
|
<div
|
||||||
class="-mx-4 sm:-mx-6 px-4 sm:px-6
|
class="-mx-4 sm:-mx-6 px-4 sm:px-6
|
||||||
|
|||||||
@@ -7,12 +7,13 @@
|
|||||||
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
|
||||||
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 Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import { t } from '$lib/i18n/translations.js'
|
import { t } from '$lib/i18n/translations.js'
|
||||||
import type { Person, PrivateMessageView } from 'lemmy-js-client'
|
import type { Person, PrivateMessageView } from 'lemmy-js-client'
|
||||||
import { Button, Modal } from 'mono-svelte'
|
import { Button, Modal } from 'mono-svelte'
|
||||||
import { ChatBubbleOvalLeftEllipsis, Icon } from 'svelte-hero-icons'
|
import { ChatBubbleOvalLeftEllipsis, Icon, Inbox } from 'svelte-hero-icons'
|
||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
|
|
||||||
@@ -85,9 +86,7 @@
|
|||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Header pageHeader>
|
{#snippet startChat()}
|
||||||
{$t('filter.inbox.messages')}
|
|
||||||
{#snippet extended()}
|
|
||||||
<Button
|
<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
size="lg"
|
size="lg"
|
||||||
@@ -97,6 +96,9 @@
|
|||||||
{$t('routes.inbox.messages.start')}
|
{$t('routes.inbox.messages.start')}
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
|
<Header pageHeader extended={startChat}>
|
||||||
|
{$t('filter.inbox.messages')}
|
||||||
</Header>
|
</Header>
|
||||||
{#await data.messages}
|
{#await data.messages}
|
||||||
<div class="w-full h-full flex flex-col gap-2">
|
<div class="w-full h-full flex flex-col gap-2">
|
||||||
@@ -119,8 +121,17 @@
|
|||||||
{@const previews = conversationPreviews(conversations)}
|
{@const previews = conversationPreviews(conversations)}
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
class="flex flex-col divide-y divide-slate-200 dark:divide-zinc-800 w-full mt-6"
|
class="flex flex-col divide-y divide-slate-200 dark:divide-zinc-800 w-full mt-6 h-full"
|
||||||
>
|
>
|
||||||
|
{#if previews.length == 0}
|
||||||
|
<Placeholder
|
||||||
|
title={$t('routes.inbox.messages.empty.title')}
|
||||||
|
icon={Inbox}
|
||||||
|
class="my-auto"
|
||||||
|
>
|
||||||
|
{@render startChat?.()}
|
||||||
|
</Placeholder>
|
||||||
|
{/if}
|
||||||
{#each previews as preview, index (preview)}
|
{#each previews as preview, index (preview)}
|
||||||
<a
|
<a
|
||||||
href="/inbox/messages/{preview.user.id}"
|
href="/inbox/messages/{preview.user.id}"
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
|
|
||||||
<Header pageHeader>{$t('routes.admin.media.title')}</Header>
|
<Header pageHeader>{$t('routes.admin.media.title')}</Header>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
|
||||||
{#each data.images as image (image.local_image.pictrs_delete_token)}
|
{#each data.images.value as image (image.local_image.pictrs_delete_token)}
|
||||||
<div animate:flip={{ duration: 500, easing: expoInOut }}>
|
<div animate:flip={{ duration: 500, easing: expoInOut }}>
|
||||||
<PictrsImage
|
<PictrsImage
|
||||||
image={image.local_image}
|
image={image.local_image}
|
||||||
ondelete={() => {
|
ondelete={() => {
|
||||||
data.images = data.images.toSpliced(
|
data.images.value = data.images.value.toSpliced(
|
||||||
data.images.findIndex(
|
data.images.value.findIndex(
|
||||||
i =>
|
i =>
|
||||||
i.local_image.pictrs_delete_token ==
|
i.local_image.pictrs_delete_token ==
|
||||||
image.local_image.pictrs_delete_token,
|
image.local_image.pictrs_delete_token,
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{#if data.images.length == 20}
|
{#if data.images.value.length == 20}
|
||||||
<Pageination
|
<Pageination
|
||||||
page={Number(page.url.searchParams.get('page')) || 1}
|
page={Number(page.url.searchParams.get('page')) || 1}
|
||||||
href={page => `?page=${page}`}
|
href={page => `?page=${page}`}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { profile } from '$lib/auth.svelte'
|
import { profile } from '$lib/auth.svelte'
|
||||||
import { client } from '$lib/lemmy.svelte.js'
|
import { client } from '$lib/lemmy.svelte.js'
|
||||||
|
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
const { jwt } = profile.data
|
const { jwt } = profile.data
|
||||||
@@ -11,5 +12,5 @@ export async function load({ fetch, url }) {
|
|||||||
page: page,
|
page: page,
|
||||||
})
|
})
|
||||||
|
|
||||||
return { images: res.images }
|
return { images: new ReactiveState(res.images) }
|
||||||
}
|
}
|
||||||
@@ -36,8 +36,6 @@
|
|||||||
let searchElement: HTMLInputElement | undefined = $state()
|
let searchElement: HTMLInputElement | undefined = $state()
|
||||||
let form = $state<HTMLFormElement>()
|
let form = $state<HTMLFormElement>()
|
||||||
|
|
||||||
let pageNum = $state(data.filters.value.page)
|
|
||||||
|
|
||||||
let moreOptions = $state(false)
|
let moreOptions = $state(false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -200,6 +198,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-4"></div>
|
<div class="mt-4"></div>
|
||||||
{#if data.results.value.length > 0}
|
{#if data.results.value.length > 0}
|
||||||
<Pageination bind:page={pageNum} href={page => `?page=${page}`} />
|
<Pageination
|
||||||
|
bind:page={data.filters.value.page}
|
||||||
|
href={page => `?page=${page}`}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
@@ -439,6 +439,11 @@
|
|||||||
title={$t('settings.app.duplicateTitles.title')}
|
title={$t('settings.app.duplicateTitles.title')}
|
||||||
description={$t('settings.app.duplicateTitles.description')}
|
description={$t('settings.app.duplicateTitles.description')}
|
||||||
/>
|
/>
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={settings.posts.titleOpensUrl}
|
||||||
|
title={$t('settings.app.titleOpensUrl.title')}
|
||||||
|
description={$t('settings.app.titleOpensUrl.description')}
|
||||||
|
/>
|
||||||
<ToggleSetting
|
<ToggleSetting
|
||||||
title={$t('settings.app.titleTags.title')}
|
title={$t('settings.app.titleTags.title')}
|
||||||
description={$t('settings.app.titleTags.description')}
|
description={$t('settings.app.titleTags.description')}
|
||||||
|
|||||||
+12
-12
@@ -29,18 +29,18 @@
|
|||||||
--color-slate-900: rgb(var(--c-s-900, 15 23 42));
|
--color-slate-900: rgb(var(--c-s-900, 15 23 42));
|
||||||
--color-slate-950: rgb(var(--c-s-950, 2 6 23));
|
--color-slate-950: rgb(var(--c-s-950, 2 6 23));
|
||||||
|
|
||||||
--color-zinc-50: rgb(var(--c-z-50, 251 253 255));
|
--color-zinc-50: rgb(var(--c-z-50, 252 252 254));
|
||||||
--color-zinc-100: rgb(var(--c-z-100, 246 247 249));
|
--color-zinc-100: rgb(var(--c-z-100, 248 248 251));
|
||||||
--color-zinc-200: rgb(var(--c-z-200, 229 231 235));
|
--color-zinc-200: rgb(var(--c-z-200, 235 235 240));
|
||||||
--color-zinc-300: rgb(var(--c-z-300, 217 221 226));
|
--color-zinc-300: rgb(var(--c-z-300, 222 222 228));
|
||||||
--color-zinc-400: rgb(var(--c-z-400, 171 177 188));
|
--color-zinc-400: rgb(var(--c-z-400, 175 175 185));
|
||||||
--color-zinc-500: rgb(var(--c-z-500, 127 133 146));
|
--color-zinc-500: rgb(var(--c-z-500, 128 128 138));
|
||||||
--color-zinc-600: rgb(var(--c-z-600, 95 104 117));
|
--color-zinc-600: rgb(var(--c-z-600, 98 98 108));
|
||||||
--color-zinc-700: rgb(var(--c-z-700, 75 84 99));
|
--color-zinc-700: rgb(var(--c-z-700, 68 68 76));
|
||||||
--color-zinc-800: rgb(var(--c-z-800, 42 50 63));
|
--color-zinc-800: rgb(var(--c-z-800, 47 47 54));
|
||||||
--color-zinc-900: rgb(var(--c-z-900, 32 37 50));
|
--color-zinc-900: rgb(var(--c-z-900, 34 34 39));
|
||||||
--color-zinc-925: rgb(var(--c-z-925, 28 32 43));
|
--color-zinc-925: rgb(var(--c-z-925, 28 28 32));
|
||||||
--color-zinc-950: rgb(var(--c-z-950, 23 27 36));
|
--color-zinc-950: rgb(var(--c-z-950, 25 25 29));
|
||||||
|
|
||||||
--color-primary-100: rgb(var(--c-p-100, 241 245 249));
|
--color-primary-100: rgb(var(--c-p-100, 241 245 249));
|
||||||
--color-primary-900: rgb(var(--c-p-900, 15 23 42));
|
--color-primary-900: rgb(var(--c-p-900, 15 23 42));
|
||||||
|
|||||||
Reference in new issue
Block a user