mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
removed almost all node sagas
This commit is contained in:
parent
f76a5a4798
commit
168ba8cc04
30 changed files with 268 additions and 448 deletions
|
@ -18,12 +18,13 @@ interface IProps {
|
|||
nodeId: number;
|
||||
comment: IComment;
|
||||
canEdit: boolean;
|
||||
saveComment: (data: IComment) => Promise<unknown>;
|
||||
onDelete: (id: IComment['id'], isLocked: boolean) => void;
|
||||
onShowImageModal: (images: IFile[], index: number) => void;
|
||||
}
|
||||
|
||||
const CommentContent: FC<IProps> = memo(
|
||||
({ comment, canEdit, nodeId, onDelete, onShowImageModal }) => {
|
||||
({ comment, canEdit, nodeId, saveComment, onDelete, onShowImageModal }) => {
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
|
||||
const startEditing = useCallback(() => setIsEditing(true), [setIsEditing]);
|
||||
|
@ -58,7 +59,14 @@ const CommentContent: FC<IProps> = memo(
|
|||
);
|
||||
|
||||
if (isEditing) {
|
||||
return <CommentForm nodeId={nodeId} comment={comment} onCancelEdit={stopEditing} />;
|
||||
return (
|
||||
<CommentForm
|
||||
saveComment={saveComment}
|
||||
nodeId={nodeId}
|
||||
comment={comment}
|
||||
onCancelEdit={stopEditing}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue