feat: add target blank as default to LinkButton

This commit is contained in:
Alex Wellnitz 2023-09-04 11:24:53 +02:00
parent 261a6f548b
commit 31a309b95c
2 changed files with 4 additions and 1 deletions

View File

@ -81,6 +81,7 @@ const { activeNav } = Astro.props;
}`}
ariaLabel="search"
title="Search"
newTarget={false}
>
<svg
xmlns="http://www.w3.org/2000/svg"

View File

@ -5,9 +5,10 @@ export interface Props {
ariaLabel?: string;
title?: string;
disabled?: boolean;
newTarget?: boolean;
}
const { href, className, ariaLabel, title, disabled = false } = Astro.props;
const { href, className, ariaLabel, title, disabled = false, newTarget = true } = Astro.props;
---
<a
@ -17,6 +18,7 @@ const { href, className, ariaLabel, title, disabled = false } = Astro.props;
aria-label={ariaLabel}
title={title}
aria-disabled={disabled}
target={ newTarget ? "_blank" : "_self"}
>
<slot />
</a>