diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-03 16:53:55 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-03 16:53:55 +0200 |
| commit | ee04742d1f0645908baa30e47845126c28848f50 (patch) | |
| tree | 1d80dca17437be6a351e932885e95c940833e571 /src/components/atoms/links/link.tsx | |
| parent | 83a029084f1bbfd78b7099d9bea3371d4533c6d9 (diff) | |
chore: add a CV page
Diffstat (limited to 'src/components/atoms/links/link.tsx')
| -rw-r--r-- | src/components/atoms/links/link.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/components/atoms/links/link.tsx b/src/components/atoms/links/link.tsx index 674c07b..c8ba273 100644 --- a/src/components/atoms/links/link.tsx +++ b/src/components/atoms/links/link.tsx @@ -12,6 +12,10 @@ export type LinkProps = { */ className?: string; /** + * True if it is a download link. Default: false. + */ + download?: boolean; + /** * True if it is an external link. Default: false. */ external?: boolean; @@ -33,21 +37,29 @@ export type LinkProps = { const Link: FC<LinkProps> = ({ children, className = '', + download = false, + external = false, href, lang, - external = false, }) => { + const downloadClass = download ? styles['link--download'] : ''; + return external ? ( <a href={href} hrefLang={lang} - className={`${styles.link} ${styles['link--external']} ${className}`} + className={`${styles.link} ${styles['link--external']} ${downloadClass} ${className}`} > {children} </a> ) : ( <NextLink href={href}> - <a className={`${styles.link} ${className}`}>{children}</a> + <a + hrefLang={lang} + className={`${styles.link} ${downloadClass} ${className}`} + > + {children} + </a> </NextLink> ); }; |
