From b4f0a94d36ab63e775a0d7813ceccda59395ce92 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Thu, 26 Mar 2020 19:14:14 +0100 Subject: [PATCH] add comments --- .../Editor/Workspace/screens/Comments/Dialog/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 1105f951e03..caa5af7b3e0 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 @@ -43,6 +43,7 @@ export const Dialog: React.FC = () => { const isCodeComment = comment.references[0] && comment.references[0].type === 'code'; + // this could rather be `getInitialPosition` const positions = getPositions( currentCommentPositions, isCodeComment, @@ -52,6 +53,7 @@ export const Dialog: React.FC = () => { // reset editing when comment changes React.useEffect(() => { setEditing(isNewComment); + // this could rather be `getAnimatedPosition` const updatedPositions = getPositions( currentCommentPositions, isCodeComment, @@ -70,10 +72,6 @@ export const Dialog: React.FC = () => { isNewComment, ]); - /** Position the dialog and transition in to give context */ - - /** Recheck the position when the dialog ref or the comment changes */ - if (!currentCommentPositions) { return null; }