dont open meme link in new tab
This commit is contained in:
parent
0fcdbc7858
commit
e921d58f73
2 changed files with 4 additions and 2 deletions
|
@ -39,6 +39,7 @@ 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
|
||||||
|
@ -72,6 +73,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
pathname,
|
pathname,
|
||||||
user,
|
user,
|
||||||
authSrc,
|
authSrc,
|
||||||
|
meme,
|
||||||
...otherProps
|
...otherProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
@ -147,7 +149,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="_blank"
|
target={meme ? '' : '_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" href={memes.url}>
|
<Button button="link" navigate={memes.url} meme>
|
||||||
{memes.text}
|
{memes.text}
|
||||||
</Button>
|
</Button>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
Loading…
Reference in a new issue