From 9a3d85a9ef0f7154dc876d7f89a20dee4f6167d8 Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Fri, 27 Mar 2020 15:31:22 +0100 Subject: [PATCH] add code button --- .../screens/Comments/Dialog/index.tsx | 107 ++++++++++++------ .../Comments/components/CodeButton.tsx | 31 +++++ 2 files changed, 101 insertions(+), 37 deletions(-) create mode 100644 packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/components/CodeButton.tsx diff --git a/packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/index.tsx b/packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/index.tsx index ce0ce1348de..e174dc628ca 100644 --- a/packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/index.tsx +++ b/packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/index.tsx @@ -20,6 +20,7 @@ import { EditComment } from '../components/EditComment'; import { Markdown } from './Markdown'; import { Reply } from './Reply'; import { useScrollTop } from './use-scroll-top'; +import { CodeButton } from '../components/CodeButton'; export const CommentDialog = props => ReactDOM.createPortal(, document.body); @@ -32,7 +33,7 @@ export const Dialog: React.FC = () => { const comment = state.comments.currentComment; - // This comment doens't exist in the database, it's an optimistic comment + // This comment doesn't exist in the database, it's an optimistic comment const isNewComment = comment.id === OPTIMISTIC_COMMENT_ID; const [editing, setEditing] = useState(isNewComment); @@ -166,26 +167,42 @@ const DialogAddComment = ({ comment, onSave }) => { onClick={closeDialog} /> -