Skip to content

Commit a728c93

Browse files
author
Darío Espinoza
committed
feat: Refactor AnchorLang component for improved styling and hover effects
1 parent 3495b92 commit a728c93

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

islands/AnchorLang.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ interface AnchorLangProps {
44
}
55
const AnchorLang = ({ lang: currentLang, languages }: AnchorLangProps) => {
66
return (
7-
<ul class="fixed bottom-10 right-10 z-50 bg-slate-300/40 dark:bg-slate-700/40 backdrop-blur-sm rounded-lg px-2 py-1.5">
7+
<ul className="fixed bottom-10 right-10 z-50 bg-slate-300/40 dark:bg-slate-700/40 backdrop-blur-sm rounded-lg px-1 py-1.5 group">
88
{languages.map((lang: string, index: number) => {
99
const isActive = lang === (currentLang ?? "es");
10-
<li key={index}>
11-
<a
12-
href={`/${lang}`}
13-
class="flex flex-col justify-center items-center"
14-
>
15-
<span
16-
class={`${
17-
isActive ? "bg-white/70 dark:bg-black/70" : ""
18-
} text-black/60 dark:text-white/60 inline-flex text-xl px-2 py-1.5 font-bold rounded-md justify-center items-center aspect-video max-w-min`}
10+
return (
11+
<li key={index} className="mb-2">
12+
<a
13+
href={`/${lang}`}
14+
className="flex flex-col justify-center items-center"
1915
>
20-
{lang}
21-
</span>
22-
</a>
23-
</li>;
16+
<span
17+
className={`${
18+
isActive ? "bg-white/70 dark:bg-black/70" : "group-hover:bg-white/30 dark:group-hover:bg-black/30"
19+
} text-black/60 dark:text-white/60 inline-flex text-xl px-2 py-1.5 font-bold rounded-md justify-center items-center aspect-video max-w-min`}
20+
>
21+
{lang}
22+
</span>
23+
</a>
24+
</li>
25+
);
2426
})}
2527
</ul>
2628
);

0 commit comments

Comments
 (0)