{
+ const $ = ref.current
+ if (!$) return
+
+ const selection = window.getSelection()
+ if (!selection) return
+ const selectedText = selection.toString()
+ if (selectedText.length === 0) return
+ const { top, left } = $.getBoundingClientRect()
+ setShow(true)
+ setSelectedText(selectedText)
+ setPos({
+ x: e.clientX - left + 10,
+ y: e.clientY - top + 10,
+ })
+ }}
+ >
+ {children}
+
+
+ {show && (
+
+ {
+ present({
+ title: '评论',
+ content: (rest) => (
+ ${selectedText
+ ?.split('\n')
+ .join('')}\n\n`}
+ {...rest}
+ />
+ ),
+ })
+ }}
+ >
+ 引用评论
+
+
+ )}
+
+
+ )
+}
diff --git a/src/styles/tailwindcss.css b/src/styles/tailwindcss.css
index 3b6e3bcdf0..5116b3e4a7 100644
--- a/src/styles/tailwindcss.css
+++ b/src/styles/tailwindcss.css
@@ -62,6 +62,12 @@ textarea {
font-size: 16px;
}
+@screen lg {
+ input,
+ textarea {
+ font-size: 1rem;
+ }
+}
@layer components {
.scrollbar-none::-webkit-scrollbar {
width: 0 !important;