From 0d9c0a3b0899ec4f673e82f5c061ce96ab624e18 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 19 Sep 2022 22:31:44 +0100 Subject: [PATCH] feat: paste to upload image --- src/components/ui/Editor.tsx | 6 ++++++ src/pages/index.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/ui/Editor.tsx b/src/components/ui/Editor.tsx index befbe302..962aa123 100644 --- a/src/components/ui/Editor.tsx +++ b/src/components/ui/Editor.tsx @@ -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) }, }), diff --git a/src/pages/index.tsx b/src/pages/index.tsx index d85d46a6..769ed278 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -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.