mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
refactor: replace classnames with class:list
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
---
|
||||
// Cspell:words astro classnames noopener noreferrer
|
||||
import cx from 'classnames';
|
||||
|
||||
// Cspell:words astro noopener noreferrer
|
||||
interface Props {
|
||||
class?: string;
|
||||
href?: string;
|
||||
@@ -11,11 +9,10 @@ interface Props {
|
||||
const { class: className, href = '#', ...props } = Astro.props;
|
||||
|
||||
const isExternal = (href as string).startsWith('http');
|
||||
const classes = cx('link', { external: isExternal }, className);
|
||||
---
|
||||
|
||||
<a
|
||||
class={classes}
|
||||
class:list={['link', { external: isExternal }, className]}
|
||||
href={href}
|
||||
rel={isExternal ? 'nofollow noopener noreferrer' : undefined}
|
||||
target={isExternal ? '_blank' : undefined}
|
||||
|
||||
Reference in New Issue
Block a user