Skip to content

Commit 4a16482

Browse files
committed
refactor Footer link styles for reusability
1 parent f39a1cc commit 4a16482

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/Footer.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { FooterLink, FooterLinkSection } from "@/lib/types"
66

77
import Translation from "@/components/Translation"
88

9+
import { cn } from "@/lib/utils/cn"
910
import { scrollIntoView } from "@/lib/utils/scrollIntoView"
1011

1112
import { BaseLink } from "../../tailwind/Link"
@@ -298,6 +299,9 @@ const Footer = ({ lastDeployLocaleTimestamp }: FooterProps) => {
298299
},
299300
]
300301

302+
const footerLinkClassName =
303+
"text-body-medium no-underline hover:text-primary hover:after:text-primary"
304+
301305
return (
302306
<footer className="px-8 py-4">
303307
<div className="flex flex-wrap items-center justify-center gap-8 border-t border-body-light py-4 md:justify-between">
@@ -321,7 +325,7 @@ const Footer = ({ lastDeployLocaleTimestamp }: FooterProps) => {
321325
<ListItem key={linkIdx} className="mb-4">
322326
<BaseLink
323327
href={link.to}
324-
className="text-body-medium no-underline hover:text-primary hover:after:text-primary"
328+
className={footerLinkClassName}
325329
isPartiallyActive={false}
326330
>
327331
{link.text}
@@ -351,7 +355,7 @@ const Footer = ({ lastDeployLocaleTimestamp }: FooterProps) => {
351355
<ListItem key={text} className="px-2 text-center">
352356
<BaseLink
353357
href={to}
354-
className="w-full text-body-medium no-underline hover:text-primary hover:after:text-primary sm:w-auto"
358+
className={cn("w-full sm:w-auto", footerLinkClassName)}
355359
isPartiallyActive={false}
356360
>
357361
{text}

0 commit comments

Comments
 (0)