From 763b118a40969057babe5309dfda8a7fee6957ca Mon Sep 17 00:00:00 2001 From: saltrafael Date: Fri, 8 Oct 2021 09:38:08 -0300 Subject: [PATCH] Highlight livestream comment and menu button on hover --- ui/component/livestreamComment/view.jsx | 11 ++++++++--- ui/scss/component/_livestream.scss | 12 ++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/component/livestreamComment/view.jsx b/ui/component/livestreamComment/view.jsx index 8fccfa43b..ba926dc6e 100644 --- a/ui/component/livestreamComment/view.jsx +++ b/ui/component/livestreamComment/view.jsx @@ -11,6 +11,7 @@ import classnames from 'classnames'; import CommentMenuList from 'component/commentMenuList'; import Button from 'component/button'; import CreditAmount from 'component/common/credit-amount'; +import useHover from 'effects/use-hover'; type Props = { uri: string, @@ -43,14 +44,18 @@ function LivestreamComment(props: Props) { isPinned, } = props; - const commentByOwnerOfContent = claim && claim.signing_channel && claim.signing_channel.permanent_url === authorUri; + const commentRef = React.useRef(); + const isHovering = useHover(commentRef); + const commentByContentOwner = claim && claim.signing_channel && claim.signing_channel.permanent_url === authorUri; const { claimName } = parseURI(authorUri); return (
  • 0, + 'livestream-comment--hover': isHovering, })} + ref={commentRef} > {supportAmount > 0 && (
    @@ -78,7 +83,7 @@ function LivestreamComment(props: Props) { )} - {commentByOwnerOfContent && ( + {commentByContentOwner && ( @@ -88,7 +93,7 @@ function LivestreamComment(props: Props) {