feat(FooterLink): move FooterLink to the Footer widget layer, delete the one in shared/ui
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user