Skip to content

Commit

Permalink
Hover effect on comment indicator (#4545)
Browse files Browse the repository at this point in the history
* Hover effect on comment indicator

* Only show comment cursor when you are inserting a comment
  • Loading branch information
gbalint authored Nov 22, 2023
1 parent f5507f4 commit e45e28e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion editor/src/components/canvas/controls/comment-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ const CommentIndicatorInner = React.memo(() => {
return (
<div
key={thread.id}
style={{
css={{
position: 'absolute',
top: point.y,
left: point.x,
width: 20,
'&:hover': {
transform: 'scale(1.15)',
transitionDuration: '0.1s',
},
}}
onClick={() => {
dispatch([switchEditorMode(EditorModes.commentMode(point))])
Expand Down
5 changes: 4 additions & 1 deletion editor/src/templates/editor-canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ function getDefaultCursorForMode(mode: Mode): CSSCursor {
case 'textEdit':
return CSSCursor.Select
case 'comment':
return CSSCursor.Comment
if (mode.location == null) {
return CSSCursor.Comment
}
return CSSCursor.Select
case 'follow':
return CSSCursor.Select
default:
Expand Down

0 comments on commit e45e28e

Please sign in to comment.