feat(FooterLink): move FooterLink to the Footer widget layer, delete the one in shared/ui

This commit is contained in:
Ilia Mashkov
2026-04-23 13:07:16 +03:00
parent 2ae24912f7
commit 3594033bcb
5 changed files with 28 additions and 131 deletions
+2 -1
View File
@@ -6,8 +6,8 @@
<script lang="ts">
import { cn } from '$shared/lib';
import type { ResponsiveManager } from '$shared/lib/helpers';
import { FooterLink } from '$shared/ui';
import { getContext } from 'svelte';
import FooterLink from './FooterLink.svelte';
const responsive = getContext<ResponsiveManager>('responsive');
const isVertical = $derived(responsive?.isDesktop || responsive?.isDesktopLarge);
@@ -41,6 +41,7 @@ const currentYear = new Date().getFullYear();
target="_blank"
rel="noopener noreferrer"
class={cn('border border-subtle', isVertical ? 'text-2xs' : 'text-4xs')}
iconClass={isVertical ? 'rotate-90' : ''}
/>
</div>
</footer>
+55
View File
@@ -0,0 +1,55 @@
<!--
Component: FooterLink
Specific footer link implementation that uses the generic Link component
and adds the default arrow icon.
-->
<script lang="ts">
import { cn } from '$shared/lib';
import { Link } from '$shared/ui';
import ArrowUpRightIcon from '@lucide/svelte/icons/arrow-up-right';
import type { HTMLAnchorAttributes } from 'svelte/elements';
interface Props extends HTMLAnchorAttributes {
/**
* Link text
*/
text: string;
/**
* CSS classes for the default icon
*/
iconClass?: string;
/**
* Link URL
*/
href: string;
/**
* CSS classes
*/
class?: string;
}
let {
text,
iconClass,
href,
class: className,
...rest
}: Props = $props();
</script>
<Link
{href}
class={className}
{...rest}
>
<span>{text}</span>
{#snippet icon()}
<ArrowUpRightIcon
size={10}
class={cn(
'fill-body group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200',
iconClass,
)}
/>
{/snippet}
</Link>