passing meme actually isnt required
This commit is contained in:
parent
632cce4dbb
commit
63a4a597a9
2 changed files with 5 additions and 5 deletions
|
@ -39,7 +39,6 @@ type Props = {
|
||||||
dispatch: any,
|
dispatch: any,
|
||||||
'aria-label'?: string,
|
'aria-label'?: string,
|
||||||
user: ?User,
|
user: ?User,
|
||||||
meme: ?boolean,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// use forwardRef to allow consumers to pass refs to the button content if they want to
|
// use forwardRef to allow consumers to pass refs to the button content if they want to
|
||||||
|
@ -73,7 +72,6 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
pathname,
|
pathname,
|
||||||
user,
|
user,
|
||||||
authSrc,
|
authSrc,
|
||||||
meme,
|
|
||||||
...otherProps
|
...otherProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
@ -147,7 +145,9 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
|
|
||||||
// check if the link is for odysee.com
|
// check if the link is for odysee.com
|
||||||
function isAnOdyseeLink(urlString) {
|
function isAnOdyseeLink(urlString) {
|
||||||
return urlString && (urlString.indexOf('https://odysee.com') !== -1 || urlString.indexOf('http://odysee.com') !== -1);
|
return (
|
||||||
|
urlString && (urlString.indexOf('https://odysee.com') !== -1 || urlString.indexOf('http://odysee.com') !== -1)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's an internal link we won't open a new tab
|
// if it's an internal link we won't open a new tab
|
||||||
|
@ -157,7 +157,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
// TODO: replace the below with an outbound link tracker for matomo
|
// TODO: replace the below with an outbound link tracker for matomo
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
target={meme && isAnInternalLink ? '' : '_blank'}
|
target={isAnInternalLink ? '' : '_blank'}
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
href={href || navigate}
|
href={href || navigate}
|
||||||
className={combinedClassName}
|
className={combinedClassName}
|
||||||
|
|
|
@ -5,7 +5,7 @@ const memes = require('memes');
|
||||||
export default function Meme() {
|
export default function Meme() {
|
||||||
return (
|
return (
|
||||||
<h1 className="home__meme">
|
<h1 className="home__meme">
|
||||||
<Button button="link" navigate={memes.url} meme>
|
<Button button="link" navigate={memes.url}>
|
||||||
{memes.text}
|
{memes.text}
|
||||||
</Button>
|
</Button>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
Loading…
Add table
Reference in a new issue