only show bell for users with notifications on

This commit is contained in:
Sean Yesmunt 2020-11-02 14:16:31 -05:00
parent 25085fe881
commit c94d22994f
2 changed files with 6 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import {
} from 'redux/selectors/subscriptions';
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications';
import { selectUser } from 'redux/selectors/user';
import SubscribeButton from './view';
const select = (state, props) => ({
@ -14,6 +15,7 @@ const select = (state, props) => ({
firstRunCompleted: selectFirstRunCompleted(state),
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
user: selectUser(state),
});
export default connect(select, {

View file

@ -21,6 +21,7 @@ type Props = {
doToast: ({ message: string }) => void,
shrinkOnMobile: boolean,
notificationsDisabled: boolean,
user: ?User,
};
export default function SubscribeButton(props: Props) {
@ -33,12 +34,14 @@ export default function SubscribeButton(props: Props) {
doToast,
shrinkOnMobile = false,
notificationsDisabled,
user,
} = props;
const buttonRef = useRef();
const isMobile = useIsMobile();
let isHovering = useHover(buttonRef);
isHovering = isMobile ? true : isHovering;
const uiNotificationsEnabled = user && user.experimental_ui;
const { channelName } = parseURI(permanentUrl);
const claimName = '@' + channelName;
@ -77,7 +80,7 @@ export default function SubscribeButton(props: Props) {
}
}}
/>
{isSubscribed && (
{isSubscribed && uiNotificationsEnabled && (
<Button
button="alt"
icon={notificationsDisabled ? ICONS.BELL : ICONS.BELL_ON}