add fully styled author edits ui and tested logic

This commit is contained in:
Tom
2023-05-23 14:56:25 +02:00
parent f6f59f684d
commit 8f0be5b398
4 changed files with 188 additions and 109 deletions
+7 -1
View File
@@ -7,6 +7,7 @@ import Draggable from 'react-draggable';
const EditModal = ({ isOpen, closeModal, originalCommentContent }) => {
const {
setEditedComment,
selectedStyle,
} = useGeneralStore(state => state);
@@ -27,6 +28,10 @@ const EditModal = ({ isOpen, closeModal, originalCommentContent }) => {
}, [setIsMobile]);
const handleSaveEdit = () => {
setEditedComment(commentRef.current.value);
closeModal();
};
return (
<StyledModal
@@ -47,13 +52,14 @@ const EditModal = ({ isOpen, closeModal, originalCommentContent }) => {
<div className="textarea-wrapper">
<textarea className="textarea"
rows="4"
style={{paddingTop: '0'}}
placeholder="Comment"
defaultValue={originalCommentContent}
wrap="soft"
ref={commentRef} />
</div>
<div>
<button id="next">Save</button>
<button id="next" onClick={handleSaveEdit}>Save</button>
</div>
</div>
</div>