feat: add moderation tools (#33)

* feat: Add post submission removal

* feat: add comment submission removal

* feat: add report viewing and resolving

* misc: add notification dot

* misc: add locked thread badge

* feat: add thread locking

* feat: add initiating message conversations

* feat: add post pinning/unpinning

* misc: bump version

* fix: tweak lock colors

* fix: update post data on pin

* fix: return if reason is empty
This commit is contained in:
Xylight authored and GitHub committed 2023-07-27 15:53:31 -07:00
1 parent 53ef843cde
commit d3aae647a8
29 files changed
+835 -67

No files matched your search

+28 -3
View File
@@ -1,10 +1,24 @@
<script lang="ts">
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { Color } from '$lib/ui/colors'
import { createEventDispatcher } from 'svelte'
export let color: Color = Color.secondary
type ButtonColor = keyof typeof buttonColors
const buttonColors = {
secondary:
'hover:bg-black/10 hover:dark:bg-white/10 text-black dark:text-white fill-black dark:fill-white',
dangerSecondary: 'hover:bg-red-500 text-red-500 hover:text-white',
success: 'hover:bg-green-600 text-green-500 hover:text-white',
warning:
'hover:bg-yellow-500 dark:text-yellow-300 text-yellow-500 hover:text-black',
}
export let color: ButtonColor = 'secondary'
export let link = false
export let href = ''
export let loading = false
export let disabled = false
const click = createEventDispatcher()
</script>
@@ -13,7 +27,9 @@
{#if link}
<a
{href}
class="flex flex-row gap-2 items-center px-4 py-2 w-full text-sm transition-colors {color}"
class="flex flex-row gap-2 items-center px-4 py-2 w-full text-sm transition-colors {buttonColors[
color
]}"
>
<slot />
</a>
@@ -21,8 +37,17 @@
<button
on:click={(e) => click('click', e)}
type="button"
class="flex flex-row gap-2 items-center px-4 py-2 w-full text-sm transition-colors {color}"
class="flex flex-row gap-2 items-center px-4 py-2 w-full text-sm
transition-colors {buttonColors[
color
]} disabled:opacity-50 disabled:pointer-events-none"
{disabled}
>
{#if loading}
<Spinner width={16} />
{:else}
<slot name="icon" />
{/if}
<slot />
</button>
{/if}