Skip to content
/ site Public

Commit 339cca4

Browse files
3kh0evanxdsouza
andcommittedMay 24, 2026··
improve footer accessibility and dynamic copyright year (#2018)
Rebasing PR #2018 Co-Authored-By: EVAN XAVIER DSOUZA <[email protected]>om>t;
1 parent 8f34c06 commit 339cca4

1 file changed

Lines changed: 33 additions & 29 deletionsions

File tree

 bsp;

‎components/Footer.tsx‎

Lines changed: 33 additions & 29 deletionsions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ const icons = [
5050

5151
const sha = process.env.NEXT_PUBLIC_COMMIT_SHA ?? "dev";
5252

53-
function ext(href: string) {
54-
return href.startsWith("http") || href.startsWith("mailto:");
53+
function isExternal(href: string) {
54+
return href.startsWith("http");
5555
}
5656

5757
function LinkCol({ title, links }: { title: string; links: { label: string; href: string }[] }) {
@@ -68,21 +68,21 @@ function LinkCol({ title, links }: { title: string; links: { label: string; href
6868
gap: 14,
6969
}}
7070
>gt;
71-
{links.map((link) =>gt; (
72-
li key={link.label}>gt;
73-
{ext(link.href) ? (
71+
{links.map((l) =>gt; (
72+
li key={l.label}>gt;
73+
{isExternal(l.href) ? (
7474
a
75-
href={link.href}
75+
href={l.href}
7676
target="_blank"
7777
rel="noopener noreferrer"
7878
className="footer-link"
7979
style={footerLinkStyles}
8080
>gt;
81-
{link.label}
81+
{l.label}
8282
a>gt;
8383
) : (
84-
Link href={link.href} className="footer-link" style={footerLinkStyles}>gt;
85-
{link.label}
84+
Link href={l.href} className="footer-link" style={footerLinkStyles}>gt;
85+
{l.label}
8686
Link>gt;
8787
)}
8888
li>gt;
@@ -93,6 +93,8 @@ function LinkCol({ title, links }: { title: string; links: { label: string; href
9393
}
9494

9595
export function Footer() {
96+
const year = new Date().getFullYear();
97+
9698
return (
9799
footer
98100
className="site-footer"
@@ -112,10 +114,9 @@ export function Footer() {
112114
Image
113115
className="site-footer-illustration"
114116
src="/assets/footer.webp"
115-
alt="footer illustration"
116-
loading="lazy"
117-
width={2048}
118-
height={1680}
117+
alt=""
118+
width={680}
119+
height={558}
119120
style={{
120121
position: "absolute",
121122
right: 0,
@@ -144,13 +145,15 @@ export function Footer() {
144145
style={{ display: "flex", flexDirection: "column", gap: 0, flexShrink: 0, width: 280 }}
145146
>gt;
146147
div style={{ marginBottom: 28 }}>gt;
147-
Image
148-
src="/assets/hackClubFlag.svg"
149-
alt="Hack Club"
150-
width={200}
151-
height={70}
152-
style={{ display: "block", objectFit: "contain" }}
153-
/>gt;
148+
Link href="/">gt;
149+
Image
150+
src="/assets/hackClubFlag.svg"
151+
alt="Hack Club"
152+
width={200}
153+
height={70}
154+
style={{ display: "block", objectFit: "contain" }}
155+
/>gt;
156+
Link>gt;
154157
div>gt;
155158
p
156159
style={{
@@ -166,6 +169,7 @@ export function Footer() {
166169
p>gt;
167170
a
168171
href="tel:18556254225"
172+
aria-label="Call Hack Club toll-free at 1-855-625-4225"
169173
style={{
170174
fontWeight: 400,
171175
fontSize: 20,
@@ -180,13 +184,13 @@ export function Footer() {
180184
1-855-625-HACK (call toll-free)
181185
a>gt;
182186
div style={{ display: "flex", gap: 12 }}>gt;
183-
{icons.map((icon) =>gt; (
187+
{icons.map((i) =>gt; (
184188
a
185-
key={icon.label}
186-
href={icon.href}
187-
target={ext(icon.href) ? "_blank" : undefined}
188-
rel={ext(icon.href) ? "noopener noreferrer" : undefined}
189-
aria-label={icon.label}
189+
key={i.label}
190+
href={i.href}
191+
target={isExternal(i.href) ? "_blank" : undefined}
192+
rel={isExternal(i.href) ? "noopener noreferrer" : undefined}
193+
aria-label={i.label}
190194
className="footer-social-link"
191195
style={{
192196
display: "flex",
@@ -201,7 +205,7 @@ export function Footer() {
201205
color: "#fff",
202206
}}
203207
>gt;
204-
Icon glyph={icon.glyph} size={48} />gt;
208+
Icon glyph={i.glyph} size={48} />gt;
205209
a>gt;
206210
))}
207211
div>gt;
@@ -223,7 +227,7 @@ export function Footer() {
223227
lineHeight: 1.5,
224228
}}
225229
>gt;
226-
© 2026 Hack Club. Registered under{" "}
230+
© {year} Hack Club. Registered under{" "}
227231
a
228232
href="https://the.hackfoundation.org/"
229233
target="_blank"
@@ -250,7 +254,7 @@ export function Footer() {
250254
.footer-social-link:hover, .footer-social-link:focus-visible { opacity: 1 !important; }
251255
@media (max-width: 767px) {
252256
.site-footer { padding-top: 120px !important; }
253-
.site-footer-illustration { width: min(320px, 72vw) !important; height: auto !important; transform: translateY(-40%) !important; }
257+
.site-footer-illustration { width: min(320px, 72vw) !important; transform: translateY(-40%) !important; }
254258
}
255259
`}style>gt;
256260
footer>gt;

0 commit comments

Comments
 (sp;(0)
Please sign in to comment.