1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Add target _blank to button component

This commit is contained in:
Jip Fr 2023-10-24 13:27:10 +02:00
parent faed749691
commit 7731938729

View file

@ -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 || "")}>