From da0638462d25476bbeeea9b8bec303aef9afbd96 Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Sat, 19 Sep 2020 16:46:33 +0300
Subject: [PATCH] connect comment bubble

---
 .../src/components/comments/CommentBubbleComponent.js    | 9 ++++-----
 .../src/components/comments/ConnectedComment.js          | 6 +++++-
 wax-prosemirror-layouts/src/layouts/EditoriaLayout.js    | 3 ++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js b/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js
index 79b2a117e..ec73efbe7 100644
--- a/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js
+++ b/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js
@@ -2,6 +2,7 @@
 import React, { useLayoutEffect, useContext } from 'react';
 import { Commands, DocumentHelpers } from 'wax-prosemirror-utilities';
 import { WaxContext } from 'wax-prosemirror-core';
+import CommentBubble from '../../ui/comments/CommentBubble';
 
 const CommentBubbleComponent = ({
   setPosition,
@@ -41,13 +42,11 @@ const CommentBubbleComponent = ({
   return (
     !isSelectionComment() &&
     showComment(activeViewId) && (
-      <button
-        onMouseDown={event => {
+      <CommentBubble
+        onClick={event => {
           createComment(event);
         }}
-      >
-        create
-      </button>
+      />
     )
   );
 };
diff --git a/wax-prosemirror-components/src/components/comments/ConnectedComment.js b/wax-prosemirror-components/src/components/comments/ConnectedComment.js
index 77b064538..10a9cc5bb 100644
--- a/wax-prosemirror-components/src/components/comments/ConnectedComment.js
+++ b/wax-prosemirror-components/src/components/comments/ConnectedComment.js
@@ -9,7 +9,11 @@ import CommentBox from '../../ui/comments/CommentBox';
 
 const ConnectedCommentStyled = styled.div`
   position: absolute;
+  margin-left: ${props => (props.active ? `${-20}px` : `${50}px`)};
   width: 200px;
+  @media (max-width: 600px) {
+    margin-left: 15px;
+  }
 `;
 
 export default ({ comment, top, commentId, recalculateTops }) => {
@@ -114,7 +118,7 @@ export default ({ comment, top, commentId, recalculateTops }) => {
   };
 
   return (
-    <ConnectedCommentStyled data-box={commentId} style={styles}>
+    <ConnectedCommentStyled data-box={commentId} style={styles} active={active}>
       <CommentBox
         key={commentId}
         active={active}
diff --git a/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js b/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js
index def51c29a..e3e301981 100644
--- a/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js
+++ b/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js
@@ -110,13 +110,14 @@ const WaxSurfaceScroll = styled.div`
 const MainMenuContainer = styled.div`
   background: #fff;
   min-height: 52px;
-  /* line-height: 32px; */
+  line-height: 32px;
   position: relative;
   user-select: none;
   border-bottom: 2px solid #ecedf1;
   @media (max-width: 600px) {
     font-size: 10px;
     min-height: 72px;
+    line-height: 32px;
   }
 `;
 const MainMenuInner = styled.div`
-- 
GitLab