feat: Add post and comment editing (#12)
* feat: Add editing * feat: Add comment badges * fix: make loading more consistent * misc: remove prop drilling * feat: Add post editing * misc: update version * feat: Add comment deletion
This commit is contained in:
1 parent
0327ae4aed
commit
7b1ad247f9
16 files changed
+417
-192
No files matched your search
@@ -7,6 +7,9 @@
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import Modal from '$lib/components/ui/modal/Modal.svelte'
|
||||
import PostForm from '$lib/components/lemmy/post/PostForm.svelte'
|
||||
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
|
||||
|
||||
export let post: PostView
|
||||
</script>
|
||||
@@ -80,5 +83,16 @@
|
||||
{post.post.body}
|
||||
</p>
|
||||
{/if}
|
||||
<PostActions {post} />
|
||||
<PostActions
|
||||
{post}
|
||||
on:edit={(e) => {
|
||||
post.post.name = e.detail.post.name
|
||||
post.post.body = e.detail.post.body
|
||||
post.post.url = e.detail.post.url
|
||||
toast({
|
||||
content: 'The post was edited successfully.',
|
||||
type: ToastType.success,
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</Card>
|
||||
Reference in new issue
Block a user