fix(links): simplify TOP_ICON_LINKS rendering as standard anchors

This commit is contained in:
Poyraz
2026-06-27 15:20:56 +03:00
parent 66c8848760
commit 18f92d9a80
+19 -34
View File
@@ -159,29 +159,7 @@ export function LinksContent() {
<div className="grid gap-2 sm:grid-cols-2"> <div className="grid gap-2 sm:grid-cols-2">
{TOP_ICON_LINKS.map((item) => { {TOP_ICON_LINKS.map((item) => {
const href = item.id === "cv" ? `/resume-${locale}.pdf` : item.href; const href = item.id === "cv" ? `/resume-${locale}.pdf` : item.href;
const isStaticOrExternal = item.external || item.id === "rss" || item.id === "cv"; return (
const CardContent = (
<Card className="rounded-2xl border-border bg-muted/35 p-3 transition-all hover:-translate-y-0.5 hover:border-red-600/40 hover:bg-background">
<div className="flex items-center gap-3">
<span className="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-border bg-background text-muted-foreground">
<Icon icon={item.icon} width={18} height={18} />
</span>
<div className="min-w-0">
<Typography variant="large" className="truncate text-base">
{tNav.has(item.id) ? tNav(item.id) : item.label}
</Typography>
<Typography
variant="small"
className="truncate text-xs text-muted-foreground"
>
{formatHref(href)}
</Typography>
</div>
</div>
</Card>
);
return isStaticOrExternal ? (
<a <a
key={item.id} key={item.id}
href={href} href={href}
@@ -189,18 +167,25 @@ export function LinksContent() {
rel={item.id === "cv" || item.external ? "noreferrer" : undefined} rel={item.id === "cv" || item.external ? "noreferrer" : undefined}
className="block" className="block"
> >
{CardContent} <Card className="rounded-2xl border-border bg-muted/35 p-3 transition-all hover:-translate-y-0.5 hover:border-red-600/40 hover:bg-background">
<div className="flex items-center gap-3">
<span className="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-border bg-background text-muted-foreground">
<Icon icon={item.icon} width={18} height={18} />
</span>
<div className="min-w-0">
<Typography variant="large" className="truncate text-base">
{tNav.has(item.id) ? tNav(item.id) : item.label}
</Typography>
<Typography
variant="small"
className="truncate text-xs text-muted-foreground"
>
{formatHref(href)}
</Typography>
</div>
</div>
</Card>
</a> </a>
) : (
<Link
key={item.id}
href={href}
target={item.external ? "_blank" : undefined}
rel={item.external ? "noreferrer" : undefined}
className="block"
>
{CardContent}
</Link>
); );
})} })}
</div> </div>