aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-01-23 19:01:28 +0100
committerArmand Philippot <git@armandphilippot.com>2023-01-23 19:32:15 +0100
commit947830904239d51ec9e94971fed6346c1089911f (patch)
treec5ea2b6107b428e687562ee64c175fd0589adcb4 /src/components/atoms
parent74c08b59bb71222b397637c16f84c69451aff685 (diff)
chore: make Links and Images compliant with Next.js 13
Diffstat (limited to 'src/components/atoms')
-rw-r--r--src/components/atoms/buttons/button-link.stories.tsx3
-rw-r--r--src/components/atoms/buttons/button-link.tsx13
-rw-r--r--src/components/atoms/links/link.tsx13
-rw-r--r--src/components/atoms/links/nav-link.tsx8
4 files changed, 17 insertions, 20 deletions
diff --git a/src/components/atoms/buttons/button-link.stories.tsx b/src/components/atoms/buttons/button-link.stories.tsx
index 22d13f6..ff0a67f 100644
--- a/src/components/atoms/buttons/button-link.stories.tsx
+++ b/src/components/atoms/buttons/button-link.stories.tsx
@@ -8,6 +8,7 @@ export default {
title: 'Atoms/Buttons/ButtonLink',
component: ButtonLink,
args: {
+ external: false,
shape: 'rectangle',
},
argTypes: {
@@ -79,7 +80,7 @@ export default {
type: 'select',
},
description: 'The link kind.',
- options: ['primary', 'secondary'],
+ options: ['primary', 'secondary', 'tertiary'],
table: {
category: 'Options',
defaultValue: { summary: 'secondary' },
diff --git a/src/components/atoms/buttons/button-link.tsx b/src/components/atoms/buttons/button-link.tsx
index 989f737..7182d94 100644
--- a/src/components/atoms/buttons/button-link.tsx
+++ b/src/components/atoms/buttons/button-link.tsx
@@ -63,13 +63,12 @@ const ButtonLink: FC<ButtonLinkProps> = ({
{children}
</a>
) : (
- <Link href={target}>
- <a
- className={`${styles.btn} ${kindClass} ${shapeClass} ${className}`}
- {...props}
- >
- {children}
- </a>
+ <Link
+ {...props}
+ className={`${styles.btn} ${kindClass} ${shapeClass} ${className}`}
+ href={target}
+ >
+ {children}
</Link>
);
};
diff --git a/src/components/atoms/links/link.tsx b/src/components/atoms/links/link.tsx
index c8ba273..8991f38 100644
--- a/src/components/atoms/links/link.tsx
+++ b/src/components/atoms/links/link.tsx
@@ -53,13 +53,12 @@ const Link: FC<LinkProps> = ({
{children}
</a>
) : (
- <NextLink href={href}>
- <a
- hrefLang={lang}
- className={`${styles.link} ${downloadClass} ${className}`}
- >
- {children}
- </a>
+ <NextLink
+ className={`${styles.link} ${downloadClass} ${className}`}
+ href={href}
+ hrefLang={lang}
+ >
+ {children}
</NextLink>
);
};
diff --git a/src/components/atoms/links/nav-link.tsx b/src/components/atoms/links/nav-link.tsx
index 7c6fede..66ee570 100644
--- a/src/components/atoms/links/nav-link.tsx
+++ b/src/components/atoms/links/nav-link.tsx
@@ -24,11 +24,9 @@ export type NavLinkProps = {
*/
const NavLink: FC<NavLinkProps> = ({ href, label, logo }) => {
return (
- <Link href={href}>
- <a className={styles.link}>
- {logo}
- {label}
- </a>
+ <Link className={styles.link} href={href}>
+ {logo}
+ {label}
</Link>
);
};