remove requiresAuth
This commit is contained in:
parent
1a9743e639
commit
b68b0900ab
3 changed files with 2 additions and 31 deletions
|
@ -5,7 +5,6 @@ import Icon from 'component/common/icon';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import { formatLbryUrlForWeb } from 'util/url';
|
import { formatLbryUrlForWeb } from 'util/url';
|
||||||
import * as PAGES from 'constants/pages';
|
|
||||||
import useCombinedRefs from 'effects/use-combined-refs';
|
import useCombinedRefs from 'effects/use-combined-refs';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
@ -34,7 +33,6 @@ type Props = {
|
||||||
onMouseLeave: ?(any) => any,
|
onMouseLeave: ?(any) => any,
|
||||||
pathname: string,
|
pathname: string,
|
||||||
emailVerified: boolean,
|
emailVerified: boolean,
|
||||||
requiresAuth: ?boolean,
|
|
||||||
myref: any,
|
myref: any,
|
||||||
dispatch: any,
|
dispatch: any,
|
||||||
'aria-label'?: string,
|
'aria-label'?: string,
|
||||||
|
@ -66,7 +64,6 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
iconColor,
|
iconColor,
|
||||||
activeClass,
|
activeClass,
|
||||||
emailVerified,
|
emailVerified,
|
||||||
requiresAuth,
|
|
||||||
myref,
|
myref,
|
||||||
dispatch, // <button> doesn't know what to do with dispatch
|
dispatch, // <button> doesn't know what to do with dispatch
|
||||||
pathname,
|
pathname,
|
||||||
|
@ -75,7 +72,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
...otherProps
|
...otherProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const disable = disabled || (user === null && requiresAuth);
|
const disable = disabled;
|
||||||
|
|
||||||
const combinedClassName = classnames(
|
const combinedClassName = classnames(
|
||||||
'button',
|
'button',
|
||||||
|
@ -183,31 +180,6 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requiresAuth && !emailVerified) {
|
|
||||||
let redirectUrl = `/$/${PAGES.AUTH}?redirect=${pathname}`;
|
|
||||||
|
|
||||||
if (authSrc) {
|
|
||||||
redirectUrl += `&src=${authSrc}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<NavLink
|
|
||||||
exact
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
}}
|
|
||||||
to={redirectUrl}
|
|
||||||
title={title || defaultTooltip}
|
|
||||||
disabled={disable}
|
|
||||||
className={combinedClassName}
|
|
||||||
activeClassName={activeClass}
|
|
||||||
aria-label={ariaLabel}
|
|
||||||
>
|
|
||||||
{content}
|
|
||||||
</NavLink>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return path ? (
|
return path ? (
|
||||||
<NavLink
|
<NavLink
|
||||||
exact
|
exact
|
||||||
|
|
|
@ -89,7 +89,6 @@ export default function SearchChannelField(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
ref={addTagRef}
|
ref={addTagRef}
|
||||||
requiresAuth
|
|
||||||
button="primary"
|
button="primary"
|
||||||
label={labelFoundAction}
|
label={labelFoundAction}
|
||||||
onClick={() => handleFoundChannelClick(claim)}
|
onClick={() => handleFoundChannelClick(claim)}
|
||||||
|
|
|
@ -41,7 +41,7 @@ function SyncToggle(props: Props) {
|
||||||
{!verifiedEmail && (
|
{!verifiedEmail && (
|
||||||
<div>
|
<div>
|
||||||
<p className="help">{__('An email address is required to sync your account.')}</p>
|
<p className="help">{__('An email address is required to sync your account.')}</p>
|
||||||
<Button requiresAuth button="primary" label={__('Add Email')} />
|
<Button button="primary" label={__('Add Email')} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</SettingsRow>
|
</SettingsRow>
|
||||||
|
|
Loading…
Reference in a new issue