misc: improve sidebar
This commit is contained in:
1 parent
bfb36a93f8
commit
783ecbcb5f
2 files changed
+17
-3
No files matched your search
@@ -36,14 +36,17 @@
|
||||
async function deletePost() {
|
||||
if (!$authData) return
|
||||
|
||||
const deleted = post.post.deleted
|
||||
|
||||
try {
|
||||
await getClient().deletePost({
|
||||
auth: $authData.token,
|
||||
deleted: true,
|
||||
deleted: !deleted,
|
||||
post_id: post.post.id,
|
||||
})
|
||||
post.post.deleted = !deleted
|
||||
toast({
|
||||
content: 'That post was deleted.',
|
||||
content: `That post was ${deleted ? 'restored' : 'deleted'}.`,
|
||||
type: ToastType.success,
|
||||
})
|
||||
} catch (err) {
|
||||
@@ -166,7 +169,7 @@
|
||||
{#if $user && isMutable(post, $user.local_user_view)}
|
||||
<MenuButton on:click={deletePost} color="dangerSecondary">
|
||||
<Icon src={Trash} width={16} mini />
|
||||
Delete
|
||||
{post.post.deleted ? 'Restore' : 'Delete'}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
{#if $user?.local_user_view.person.id != post.creator.id}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import {
|
||||
ArrowLeftOnRectangle,
|
||||
ChevronDoubleLeft,
|
||||
Cog6Tooth,
|
||||
Home,
|
||||
Icon,
|
||||
Plus,
|
||||
@@ -39,6 +40,16 @@
|
||||
<Icon src={Home} solid size="20" />
|
||||
<span class:hidden={!expanded}>Frontpage</span>
|
||||
</Button>
|
||||
<Button
|
||||
class="hover:bg-slate-200 {expanded ? '' : '!p-1.5'}"
|
||||
href="/settings"
|
||||
color="tertiary"
|
||||
alignment="left"
|
||||
>
|
||||
<Icon src={Cog6Tooth} solid size="20" />
|
||||
<span class:hidden={!expanded}>Settings</span>
|
||||
</Button>
|
||||
<hr class="border-slate-300 dark:border-zinc-800 my-1" />
|
||||
{#if $user}
|
||||
{#each $user.follows
|
||||
.map((f) => f.community)
|
||||
|
||||
Reference in new issue
Block a user