mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
Compare commits
1 Commits
pdf-export
...
fix-123
| Author | SHA1 | Date | |
|---|---|---|---|
| ac47eb8dbe |
@@ -24,7 +24,12 @@ function CommentActions({
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Button size="compact-sm" loading={isLoading} onClick={onSave}>
|
||||
<Button
|
||||
size="compact-sm"
|
||||
loading={isLoading}
|
||||
onClick={onSave}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
>
|
||||
{t("Save")}
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
@@ -27,6 +27,9 @@ import { extractPageSlugId } from "@/lib";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useGetSpaceBySlugQuery } from "@/features/space/queries/space-query.ts";
|
||||
import { IconArrowUp, IconMessageOff } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { currentUserAtom } from "@/features/user/atoms/current-user-atom";
|
||||
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
|
||||
|
||||
function CommentListWithTabs() {
|
||||
const { t } = useTranslation();
|
||||
@@ -345,6 +348,7 @@ const PageCommentInput = ({ onSave, isLoading }) => {
|
||||
const [content, setContent] = useState("");
|
||||
const { ref, focused } = useFocusWithin();
|
||||
const commentEditorRef = useRef(null);
|
||||
const [currentUser] = useAtom(currentUserAtom);
|
||||
|
||||
const handleSave = useCallback(() => {
|
||||
onSave(null, content);
|
||||
@@ -363,19 +367,30 @@ const PageCommentInput = ({ onSave, isLoading }) => {
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<CommentEditor
|
||||
ref={commentEditorRef}
|
||||
onUpdate={setContent}
|
||||
onSave={handleSave}
|
||||
editable={true}
|
||||
placeholder={t("Add a comment...")}
|
||||
/>
|
||||
<Group wrap="nowrap" align="flex-start" gap="xs">
|
||||
<CustomAvatar
|
||||
size="sm"
|
||||
avatarUrl={currentUser?.user?.avatarUrl}
|
||||
name={currentUser?.user?.name}
|
||||
style={{ flexShrink: 0, marginTop: 10 }}
|
||||
/>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<CommentEditor
|
||||
ref={commentEditorRef}
|
||||
onUpdate={setContent}
|
||||
onSave={handleSave}
|
||||
editable={true}
|
||||
placeholder={t("Add a comment...")}
|
||||
/>
|
||||
</div>
|
||||
</Group>
|
||||
{focused && (
|
||||
<ActionIcon
|
||||
variant="filled"
|
||||
radius="xl"
|
||||
size="sm"
|
||||
onClick={handleSave}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
loading={isLoading}
|
||||
style={{ position: "absolute", right: 8, bottom: 30 }}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user