diff --git a/src/ui/component/blockButton/view.jsx b/src/ui/component/blockButton/view.jsx index 62e75e1ea..19569f432 100644 --- a/src/ui/component/blockButton/view.jsx +++ b/src/ui/component/blockButton/view.jsx @@ -30,6 +30,7 @@ export default function BlockButton(props: Props) { icon={ICONS.BLOCK} button={'alt'} label={blockedOverride || blockLabel} + requiresAuth={IS_WEB} onClick={e => { e.stopPropagation(); if (!channelIsBlocked) { diff --git a/src/ui/component/button/index.js b/src/ui/component/button/index.js index 05ac0e39a..79c8c0aff 100644 --- a/src/ui/component/button/index.js +++ b/src/ui/component/button/index.js @@ -1,3 +1,13 @@ import Button from './view'; +import React, { forwardRef } from 'react'; +import { connect } from 'react-redux'; +import { selectUserVerifiedEmail } from 'lbryinc'; -export default Button; +const mapStateToProps = state => ({ + pathname: state.router.location.pathname, + emailVerified: selectUserVerifiedEmail(state), +}); + +const ConnectedButton = connect(mapStateToProps)(Button); + +export default forwardRef((props, ref) => ); diff --git a/src/ui/component/button/view.jsx b/src/ui/component/button/view.jsx index 27f26c660..564310e24 100644 --- a/src/ui/component/button/view.jsx +++ b/src/ui/component/button/view.jsx @@ -6,6 +6,7 @@ import classnames from 'classnames'; import { NavLink } from 'react-router-dom'; import { formatLbryUriForWeb } from 'util/uri'; import { OutboundLink } from 'react-ga'; +import * as PAGES from 'constants/pages'; type Props = { id: ?string, @@ -30,6 +31,11 @@ type Props = { onClick: ?(any) => any, onMouseEnter: ?(any) => any, onMouseLeave: ?(any) => any, + pathname: string, + emailVerified: boolean, + requiresAuth: ?boolean, + myref: any, + dispatch: any, }; // use forwardRef to allow consumers to pass refs to the button content if they want to @@ -55,9 +61,15 @@ const Button = forwardRef((props: Props, ref: any) => { iconColor, constrict, activeClass, + emailVerified, + requiresAuth, + myref, + dispatch, //