refactor page editor

This commit is contained in:
Philipinho
2023-11-24 18:03:53 +00:00
parent 21abde1054
commit 2a3db4e7cb
11 changed files with 173 additions and 141 deletions

View File

@ -4,7 +4,7 @@ import classes from './comment.module.css';
import { useAtomValue } from 'jotai';
import { timeAgo } from '@/lib/time';
import CommentEditor from '@/features/comment/components/comment-editor';
import { editorAtom } from '@/features/editor/atoms/editorAtom';
import { editorAtoms } from '@/features/editor/atoms/editor-atoms';
import CommentActions from '@/features/comment/components/comment-actions';
import CommentMenu from '@/features/comment/components/comment-menu';
import { useHover } from '@mantine/hooks';
@ -22,7 +22,7 @@ function CommentListItem({ comment }: CommentListItemProps) {
const [isEditing, setIsEditing] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const editor = useAtomValue(editorAtom);
const editor = useAtomValue(editorAtoms);
const [content, setContent] = useState(comment.content);
const updateCommentMutation = useUpdateCommentMutation();
const deleteCommentMutation = useDeleteCommentMutation(comment.pageId);