misc: increase visual separation for reports
This commit is contained in:
5 files changed
+68
-60
No files matched your search
@@ -17,9 +17,11 @@
|
||||
import { t } from '$lib/translations'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import { tick } from 'svelte'
|
||||
|
||||
let { data = $bindable() } = $props()
|
||||
|
||||
let type = $state(data.type)
|
||||
let reports = $state(data.items)
|
||||
$effect(() => {
|
||||
reports = data.items
|
||||
@@ -32,8 +34,11 @@
|
||||
{#snippet extended()}
|
||||
<div class="flex flex-row gap-2 flex-wrap items-end">
|
||||
<Select
|
||||
bind:value={data.type}
|
||||
onchange={() => searchParam(page.url, 'type', data.type, 'page')}
|
||||
bind:value={type}
|
||||
onchange={async () => {
|
||||
await tick()
|
||||
searchParam(page.url, 'type', type, 'page')
|
||||
}}
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
<span class="flex items-center gap-1">
|
||||
@@ -59,18 +64,11 @@
|
||||
{#each reports as item}
|
||||
<div
|
||||
in:fly={{ y: -6, opacity: 0, duration: 500 }}
|
||||
class="flex flex-col gap-1 text-sm"
|
||||
class="flex flex-col gap-3 text-sm -mx-4 sm:-mx-6 px-4 sm:px-6"
|
||||
>
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<span class="text-xs font-bold dark:text-zinc-400 text-slate-600">
|
||||
Report from
|
||||
</span>
|
||||
<span class="font-bold">
|
||||
<UserLink avatar user={item.creator} />
|
||||
</span>
|
||||
<div class="space-y-2">
|
||||
<Report {item} />
|
||||
</div>
|
||||
|
||||
<Report {item} />
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { Material, toast } from 'mono-svelte'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import { isCommentReport, isPostReport } from '$lib/lemmy/item.js'
|
||||
import type {
|
||||
@@ -100,19 +100,48 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if item.type == 'comment'}
|
||||
<CommentItem community={true} comment={item.item} />
|
||||
{:else if item.type == 'post'}
|
||||
<Post post={item.item} />
|
||||
{:else if item.type == 'message'}
|
||||
<PrivateMessage
|
||||
message={{
|
||||
creator: item.reportee,
|
||||
private_message: item.item,
|
||||
recipient: item.creator,
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
<div class="flex flex-row">
|
||||
<div class="flex flex-col gap-1.5 flex-1">
|
||||
<span class="text-xs font-medium">Report from</span>
|
||||
<span class="font-bold">
|
||||
<UserLink avatar user={item.creator} />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
onclick={resolve}
|
||||
class="h-max self-end {item.resolved
|
||||
? '!text-green-600 dark:!text-green-400'
|
||||
: ''}"
|
||||
loading={resolving}
|
||||
disabled={resolving}
|
||||
rounding="pill"
|
||||
color="ghost"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={CheckCircle} micro={item.resolved} size="18" />
|
||||
{/snippet}
|
||||
{!item.resolved
|
||||
? $t('routes.moderation.resolve')
|
||||
: $t('routes.moderation.resolved')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Material rounding="xl" color="uniform" class="dark:bg-zinc-950">
|
||||
{#if item.type == 'comment'}
|
||||
<CommentItem community={true} comment={item.item} class="!p-0" />
|
||||
{:else if item.type == 'post'}
|
||||
<Post post={item.item} class="!p-0" />
|
||||
{:else if item.type == 'message'}
|
||||
<PrivateMessage
|
||||
message={{
|
||||
creator: item.reportee,
|
||||
private_message: item.item,
|
||||
recipient: item.creator,
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
</Material>
|
||||
|
||||
<div class="flex flex-row gap-4 items-center flex-wrap">
|
||||
<div>
|
||||
@@ -131,21 +160,4 @@
|
||||
<UserLink avatar user={item.resolver} />
|
||||
</div>
|
||||
{/if}
|
||||
<Button
|
||||
onclick={resolve}
|
||||
class="ml-auto {item.resolved
|
||||
? '!text-green-600 dark:!text-green-400'
|
||||
: ''}"
|
||||
loading={resolving}
|
||||
disabled={resolving}
|
||||
rounding="pill"
|
||||
color="ghost"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={CheckCircle} micro={item.resolved} size="18" />
|
||||
{/snippet}
|
||||
{!item.resolved
|
||||
? $t('routes.moderation.resolve')
|
||||
: $t('routes.moderation.resolved')}
|
||||
</Button>
|
||||
</div>
|
||||
Reference in new issue
Block a user