@@ -5,6 +5,7 @@ import React, { useRef, useLayoutEffect } from 'react';
55import { parseURI } from 'util/lbryURI' ;
66import Button from 'component/button' ;
77import Icon from 'component/common/icon' ;
8+ import useHover from 'effects/use-hover' ;
89
910import { useIsMobile } from 'effects/use-screensize' ;
1011import { ENABLE_UI_NOTIFICATIONS } from 'config' ;
@@ -50,6 +51,7 @@ export default function SubscribeButton(props: Props) {
5051 const buttonRef = useRef ( ) ;
5152 const prevWidthRef = useRef ( null ) ;
5253 const isMobile = useIsMobile ( ) ;
54+ let isHovering = useHover ( buttonRef ) ;
5355
5456 const uiNotificationsEnabled = ( user && user . experimental_ui ) || ENABLE_UI_NOTIFICATIONS ;
5557
@@ -94,9 +96,7 @@ export default function SubscribeButton(props: Props) {
9496 const subscriptionLabel = isSubscribed
9597 ? __ ( 'Following --[button label indicating a channel has been followed]--' )
9698 : __ ( 'Follow' ) ;
97- const unfollowOverride = false ;
98-
99- const label = isMobile && shrinkOnMobile ? '' : unfollowOverride || subscriptionLabel ;
99+ const label = isMobile && shrinkOnMobile ? '' : subscriptionLabel ;
100100 const titlePrefix = isSubscribed ? __ ( 'Unfollow this channel' ) : __ ( 'Follow this channel' ) ;
101101
102102 if ( ! preferEmbed && isSubscribed && ! permanentUrl && rawChannelName ) {
@@ -139,7 +139,7 @@ export default function SubscribeButton(props: Props) {
139139 ref = { buttonRef }
140140 iconColor = "red"
141141 className = { `button-following${ isSubscribed ? ' button-following--active' : '' } ` }
142- icon = { isSubscribed ? ICONS . SUBSCRIBED : ICONS . SUBSCRIBE }
142+ icon = { isSubscribed && isHovering ? ICONS . UNSUBSCRIBE : isSubscribed ? ICONS . SUBSCRIBED : ICONS . SUBSCRIBE }
143143 button = { 'alt' }
144144 requiresAuth = { IS_WEB }
145145 label = { label }
0 commit comments