feat: paste to upload image

This commit is contained in:
DIYgod 2022-09-19 22:31:44 +01:00
parent b883c1b948
commit 0d9c0a3b08
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
2 changed files with 7 additions and 1 deletions

View File

@ -85,6 +85,12 @@ export const useEditor = ({
const file = e.dataTransfer?.items[0]?.getAsFile()
if (!file) return
onDropFile?.(file, view)
},
paste(e) {
const file = e.clipboardData?.files[0]
if (!file) return
onDropFile?.(file, view)
},
}),

View File

@ -182,7 +182,7 @@ export default function Home({ region }: { region: string | null }) {
We believe freedom of expression is a universal right. In your
long-form writing, you should be able to express your thoughts
freely; without fear of your post being removed or censored.
Xlog ensures that whatever you write, it will be immutable and
xLog ensures that whatever you write, it will be immutable and
permanently stored.
</div>
<div className="my-10 text-zinc-500">