Browse Source

Add target _blank to button component

pull/497/head
Jip Fr 2 years ago
parent
commit
7731938729
  1. 7
      src/components/Button.tsx

7
src/components/Button.tsx

@ -47,6 +47,13 @@ export function Button(props: Props) { @@ -47,6 +47,13 @@ export function Button(props: Props) {
history.push(href);
}
if (props.href && props.href.startsWith("https://"))
return (
<a className={classes} href={props.href} target="_blank" rel="noreferrer">
{content}
</a>
);
if (props.href)
return (
<a className={classes} onClick={() => goTo(props.href || "")}>

Loading…
Cancel
Save