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
@@ -17,29 +17,33 @@
|
||||
import { t } from '$lib/translations'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
|
||||
export let data
|
||||
let { data = $bindable() } = $props();
|
||||
</script>
|
||||
|
||||
<div class="mb-4 flex flex-col gap-4">
|
||||
<Header pageHeader>
|
||||
{$t('routes.moderation.title')}
|
||||
<div class="flex flex-row gap-2 flex-wrap items-end" slot="extended">
|
||||
<Select
|
||||
bind:value={data.type}
|
||||
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
|
||||
>
|
||||
<span slot="label" class="flex items-center gap-1">
|
||||
<Icon src={Funnel} size="15" mini />
|
||||
{$t('filter.filter')}
|
||||
</span>
|
||||
<option value="all">{$t('filter.location.all')}</option>
|
||||
<option value="unread">{$t('filter.unread')}</option>
|
||||
</Select>
|
||||
<Button href="/modlog" class="h-max ml-auto">
|
||||
<Icon src={Newspaper} size="16" mini />
|
||||
{$t('routes.modlog')}
|
||||
</Button>
|
||||
</div>
|
||||
{#snippet extended()}
|
||||
<div class="flex flex-row gap-2 flex-wrap items-end" >
|
||||
<Select
|
||||
bind:value={data.type}
|
||||
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
|
||||
>
|
||||
{#snippet label()}
|
||||
<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 href="/modlog" class="h-max ml-auto">
|
||||
<Icon src={Newspaper} size="16" mini />
|
||||
{$t('routes.modlog')}
|
||||
</Button>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Header>
|
||||
</div>
|
||||
{#if data.items && data.items.length > 0}
|
||||
|
||||
@@ -18,9 +18,13 @@
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
|
||||
export let item: ReportView
|
||||
interface Props {
|
||||
item: ReportView;
|
||||
}
|
||||
|
||||
let resolving = false
|
||||
let { item = $bindable() }: Props = $props();
|
||||
|
||||
let resolving = $state(false)
|
||||
async function resolve() {
|
||||
if (!$profile?.jwt || !$profile.user) return
|
||||
resolving = true
|
||||
@@ -135,7 +139,9 @@
|
||||
loading={resolving}
|
||||
disabled={resolving}
|
||||
>
|
||||
<Icon src={CheckCircle} micro={item.resolved} size="18" slot="prefix" />
|
||||
{#snippet prefix()}
|
||||
<Icon src={CheckCircle} micro={item.resolved} size="18" />
|
||||
{/snippet}
|
||||
{!item.resolved
|
||||
? $t('routes.moderation.resolve')
|
||||
: $t('routes.moderation.resolved')}
|
||||
|
||||
Reference in new issue
Block a user