Skip to content

Commit

Permalink
Only show Resolve/Unresolve button in comments tab on mouse hover (#4649
Browse files Browse the repository at this point in the history
)

* Only show Resolve/Unresolve button on mouse hover

* Revert "Only show Resolve/Unresolve button on mouse hover"

This reverts commit e7fd922.

* Use css not javascript

* Remove unnecessary rule
  • Loading branch information
gbalint authored Dec 13, 2023
1 parent 9b520e4 commit dcdb394
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion editor/src/components/inspector/sections/comment-section.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/** @jsxRuntime classic */
/** @jsx jsx */
import { jsx } from '@emotion/react'
import '@liveblocks/react-comments/styles.css'
import React from 'react'
import {
Expand Down Expand Up @@ -179,6 +182,7 @@ const ThreadPreview = React.memo(({ thread }: ThreadPreviewProps) => {
return (
<div
ref={ref}
className={'thread-preview'}
key={comment.id}
onClick={onClick}
style={{
Expand Down Expand Up @@ -240,7 +244,18 @@ const ThreadPreview = React.memo(({ thread }: ThreadPreviewProps) => {
)}
{unless(repliesCount > 0, <div />)}
{when(readByMe === 'unread', 'Unread')}
<Button highlight spotlight style={{ padding: '0 6px' }} onClick={onResolveThread}>
<Button
highlight
spotlight
css={{
visibility: 'hidden',
'.thread-preview:hover &': {
visibility: 'visible',
},
padding: '0 6px',
}}
onClick={onResolveThread}
>
{thread.metadata.resolved ? 'Unresolve' : 'Resolve'}
</Button>
</div>
Expand Down

0 comments on commit dcdb394

Please sign in to comment.