chore: replace UpLink with preact component

This commit is contained in:
Stefan Imhoff
2023-12-14 12:14:02 +01:00
parent f0392b075a
commit 6fe4b69e39
4 changed files with 23 additions and 21 deletions

View File

@@ -3,7 +3,7 @@ import Legal from './Legal.astro';
import RSSLink from './RSSLink.astro';
import SocialLinks from './SocialLinks.astro';
import Subnavigation from './Subnavigation.astro';
import UpLink from './UpLink.astro';
import { UpLink } from '.';
---
<footer

View File

@@ -1,20 +0,0 @@
---
import { Sprite } from 'astro-icon';
import { Link } from '.';
---
<div class="flex flex-1 justify-end">
<Link
id="up-link"
class="transition-transform duration-500 ease-in-out hover:-translate-y-1 focus:-translate-y-1"
href="#top"
>
<button
aria-label="Back to top"
class="flex h-clickarea w-clickarea cursor-pointer items-center justify-center"
>
<Sprite name="ri:arrow-up-line" class="h-icon-small w-icon-small" />
</button>
</Link>
</div>

21
src/components/UpLink.tsx Normal file
View File

@@ -0,0 +1,21 @@
import type { FunctionalComponent } from 'preact';
import { Link } from '.';
import { ArrowUp } from './icons';
export const UpLink: FunctionalComponent = ({ ...props }) => (
<div class="flex flex-1 justify-end" {...props}>
<Link
id="up-link"
class="transition-transform duration-500 ease-in-out hover:-translate-y-1 focus:-translate-y-1"
href="#top"
>
<button
aria-label="Back to top"
class="flex h-clickarea w-clickarea cursor-pointer items-center justify-center"
>
<ArrowUp class="icon h-icon w-icon" />
</button>
</Link>
</div>
);

View File

@@ -30,4 +30,5 @@ export * from './Text';
export * from './TextLink';
export * from './Title';
export * from './UnorderedList';
export * from './UpLink';
export * from './Verse';