From d358656f125baab1e3ca9ef70cfedc4df192a028 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Thu, 14 Dec 2023 14:37:40 +0100 Subject: [PATCH] chore: replace DownloadLink with preact component --- src/components/DownloadLink.astro | 23 ----------------------- src/components/DownloadLink.tsx | 21 +++++++++++++++++++++ src/components/index.ts | 1 + src/mdx-components.ts | 2 +- src/pages/cv.astro | 2 +- 5 files changed, 24 insertions(+), 25 deletions(-) delete mode 100644 src/components/DownloadLink.astro create mode 100644 src/components/DownloadLink.tsx diff --git a/src/components/DownloadLink.astro b/src/components/DownloadLink.astro deleted file mode 100644 index 3e43717..0000000 --- a/src/components/DownloadLink.astro +++ /dev/null @@ -1,23 +0,0 @@ ---- -import { Sprite } from 'astro-icon'; - -import { TextLink } from '../components'; - -export interface Props { - href: string; - text: string; -} - -const { href, text, ...props } = Astro.props; ---- - - - {text} - - - diff --git a/src/components/DownloadLink.tsx b/src/components/DownloadLink.tsx new file mode 100644 index 0000000..c7ae6ee --- /dev/null +++ b/src/components/DownloadLink.tsx @@ -0,0 +1,21 @@ +import type { FunctionalComponent, JSX } from 'preact'; + +import { TextLink } from '.'; +import { Download } from './icons'; + +interface Props extends JSX.HTMLAttributes { + href: string; + text: string; +} + +export const DownloadLink: FunctionalComponent = ({ href, text, ...props }) => ( + + {text} + + + +); diff --git a/src/components/index.ts b/src/components/index.ts index 1b4db1b..1dfe40c 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -10,6 +10,7 @@ export * from './ColorSwatch'; export * from './DisplayBox'; export * from './Divider'; export * from './DoughnutChart'; +export * from './DownloadLink'; export * from './Figure'; export * from './Flag'; export * from './Headline'; diff --git a/src/mdx-components.ts b/src/mdx-components.ts index a30b6c8..7a2a635 100644 --- a/src/mdx-components.ts +++ b/src/mdx-components.ts @@ -1,6 +1,5 @@ import { YouTube } from '@astro-community/astro-embed-youtube'; -import DownloadLink from './components/DownloadLink.astro'; import EmailLink from './components/EmailLink.astro'; import Image from './components/Image.astro'; import MarkdownImage from './components/MarkdownImage.astro'; @@ -19,6 +18,7 @@ import { ColorSwatch, DisplayBox, Divider, + DownloadLink, Figure, Flag, Headline, diff --git a/src/pages/cv.astro b/src/pages/cv.astro index 67b55c1..e2b1f59 100644 --- a/src/pages/cv.astro +++ b/src/pages/cv.astro @@ -3,10 +3,10 @@ import { animation, animationDelay } from '../data/site'; import GridLayout from '../layouts/GridLayout.astro'; import PageTitle from '../components/PageTitle.astro'; -import DownloadLink from '../components/DownloadLink.astro'; import EmailLink from '../components/EmailLink.astro'; import { Divider, + DownloadLink, Headline, ListItem, Subheadline,