Skip to content

Commit de14f5d

Browse files
committed
Add broken heart
1 parent b0d7c76 commit de14f5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/component/subscribeButton/view.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import React, { useRef, useLayoutEffect } from 'react';
55
import { parseURI } from 'util/lbryURI';
66
import Button from 'component/button';
77
import Icon from 'component/common/icon';
8+
import useHover from 'effects/use-hover';
89

910
import { useIsMobile } from 'effects/use-screensize';
1011
import { 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

Comments
 (0)