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" ariaLabel="search"
title="Search" title="Search"
newTarget={false}
> >
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

View File

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