feat: add and close #169

This commit is contained in:
Xyphyn committed 2023-10-14 11:31:09 -07:00
1 parent ea594e0061
commit 108169f5a9
9 files changed
+89 -44

No files matched your search

+10
View File
@@ -1,9 +1,19 @@
<script>
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import { profile } from '$lib/auth'
import MultiSelect from '$lib/components/input/Switch.svelte'
import { Badge } from 'mono-svelte'
</script>
{#if $profile?.user?.notifications.applications ?? 0 > 0}
<span class="flex flex-row text-red-500 gap-2">
<Badge color="red-subtle" class="w-max">
{$profile?.user?.notifications.applications}
</Badge> unread applications
</span>
{/if}
<div class="flex flex-col gap-4 h-full">
<MultiSelect
headless
@@ -7,8 +7,8 @@
import type { RegistrationApplicationView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Check, Icon, XMark } from 'svelte-hero-icons'
import RelativeDate from '$lib/components/util/RelativeDate.svelte';
import { publishedToDate } from '$lib/components/util/date';
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date'
export let application: RegistrationApplicationView
@@ -37,6 +37,8 @@
})
application.creator_local_user.accepted_application = approve
application.admin = $profile.user!.local_user_view.person
$profile.user!.notifications.applications -= 1
} catch (err) {
toast({
content: err as any,
@@ -52,7 +54,9 @@
<Material class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<span class="text-slate-600 dark:text-zinc-400">
<RelativeDate date={publishedToDate(application.registration_application.published)} />
<RelativeDate
date={publishedToDate(application.registration_application.published)}
/>
</span>
<SectionTitle>User</SectionTitle>
@@ -79,8 +83,8 @@
<div class="ml-auto">
<Button
size="square-md"
class="hover:bg-slate-200 {!application.creator_local_user
.accepted_application
class="hover:bg-slate-200 {application.creator_local_user
.accepted_application === false && application.admin
? '!text-red-500'
: ''}"
aria-label="Deny"
-1
View File
@@ -134,7 +134,6 @@
Captcha enabled
</Checkbox>
{#if formData.captcha_enabled}
{console.log(formData.captcha_difficulty)}
<Select bind:value={formData.captcha_difficulty} />
{/if}
{/if}
+1 -1
View File
@@ -32,7 +32,7 @@
const response = await getClient().markAllAsRead()
$profile.user.unreads = 0
$profile.user.notifications.inbox = 0
goto($page.url, {
invalidateAll: true,
+1 -1
View File
@@ -49,7 +49,7 @@
}
item.read = isRead
if ($profile.user) $profile.user.unreads += isRead ? -1 : 1
if ($profile.user) $profile.user.notifications.inbox += isRead ? -1 : 1
loading = false
}
+1 -1
View File
@@ -19,7 +19,7 @@
</script>
<div class="mb-4 flex flex-col gap-4">
<h1 class="font-bold text-3xl">Reports</h1>
<h1 class="font-bold text-3xl">Moderation</h1>
<div class="flex flex-row gap-2 flex-wrap items-center">
<Select
bind:value={data.type}
+1 -6
View File
@@ -76,12 +76,7 @@
}
}
const reports = await getClient().getReportCount({})
$profile.user.reports =
reports.comment_reports +
reports.post_reports +
(reports.private_message_reports ?? 0)
$profile.user.notifications.reports += item.resolved ? 1 : -1
} catch (err) {
toast({
content: err as any,