migrate: convert most components to svelte 5
This commit is contained in:
1 parent
d670f39f0a
commit
10ef4123da
225 files changed
+5441
-3341
No files matched your search
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { run } from 'svelte/legacy';
|
||||
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import { searchParam } from '$lib/util.js'
|
||||
import { page } from '$app/stores'
|
||||
@@ -20,16 +22,18 @@
|
||||
import { isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
|
||||
import { browser } from '$app/environment'
|
||||
|
||||
export let data
|
||||
let { data = $bindable() } = $props();
|
||||
|
||||
let view = `${
|
||||
let view = $state(`${
|
||||
$userSettings.modlogCardView ?? browser
|
||||
? !window.matchMedia('(min-width: 1600px)').matches
|
||||
: false
|
||||
}`
|
||||
}`)
|
||||
|
||||
$: $userSettings.modlogCardView =
|
||||
view == 'true' ? true : view == 'false' ? false : undefined
|
||||
run(() => {
|
||||
$userSettings.modlogCardView =
|
||||
view == 'true' ? true : view == 'false' ? false : undefined
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -44,10 +48,12 @@
|
||||
on:change={(e) => searchParam($page.url, 'type', data.type, 'page')}
|
||||
class="w-48"
|
||||
>
|
||||
<span slot="label" class="flex gap-1 items-center">
|
||||
<Icon src={Bars3BottomRight} size="15" mini />
|
||||
Type
|
||||
</span>
|
||||
{#snippet label()}
|
||||
<span class="flex gap-1 items-center">
|
||||
<Icon src={Bars3BottomRight} size="15" mini />
|
||||
Type
|
||||
</span>
|
||||
{/snippet}
|
||||
<option value="All">All</option>
|
||||
<option value="ModRemovePost">Remove Post</option>
|
||||
<option value="ModLockPost">Lock Post</option>
|
||||
@@ -67,10 +73,12 @@
|
||||
</Select>
|
||||
|
||||
<Select bind:value={view} class="w-36">
|
||||
<span slot="label" class="flex gap-1 items-center">
|
||||
<Icon src={ViewColumns} size="15" mini />
|
||||
View
|
||||
</span>
|
||||
{#snippet label()}
|
||||
<span class="flex gap-1 items-center">
|
||||
<Icon src={ViewColumns} size="15" mini />
|
||||
View
|
||||
</span>
|
||||
{/snippet}
|
||||
<option value="false">Table</option>
|
||||
<option value="true">Cards</option>
|
||||
<option value="undefined">Default</option>
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
} from 'svelte-hero-icons'
|
||||
import type { ActionName } from './+page.js'
|
||||
|
||||
export let action: ActionName
|
||||
interface Props {
|
||||
action: ActionName;
|
||||
}
|
||||
|
||||
let { action }: Props = $props();
|
||||
|
||||
$: actionData = getAction(action)
|
||||
|
||||
const getAction = (
|
||||
action: ActionName
|
||||
@@ -151,6 +154,7 @@
|
||||
class: '',
|
||||
}
|
||||
}
|
||||
let actionData = $derived(getAction(action))
|
||||
</script>
|
||||
|
||||
<span class="font-bold">
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
import type { ModLog } from '../+page.js'
|
||||
import ModlogAction from '../ModlogAction.svelte'
|
||||
|
||||
export let item: ModLog
|
||||
interface Props {
|
||||
item: ModLog;
|
||||
}
|
||||
|
||||
let { item }: Props = $props();
|
||||
</script>
|
||||
|
||||
<Material padding="lg" class="flex flex-col gap-2">
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
import type { ModLog } from '../+page.js'
|
||||
import ModlogAction from '../ModlogAction.svelte'
|
||||
|
||||
export let item: ModLog
|
||||
interface Props {
|
||||
item: ModLog;
|
||||
}
|
||||
|
||||
let { item }: Props = $props();
|
||||
</script>
|
||||
|
||||
<tr class="">
|
||||
@@ -24,7 +28,7 @@
|
||||
user={item.moderator}
|
||||
/>
|
||||
{:else}
|
||||
<p class="text-slate-500 dark:text-zinc-500">Hidden<p/>
|
||||
<p class="text-slate-500 dark:text-zinc-500">Hidden<p></p>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in new issue
Block a user