Skip to content

Commit 084cc4f

Browse files
footer
1 parent 0651cc7 commit 084cc4f

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

src/components/footer/Footer.tsx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use client'
2+
3+
const Footer = () => {
4+
const date = new Date()
5+
const year = date.getFullYear()
6+
7+
const handleKeyDown = (e: React.KeyboardEvent<HTMLAnchorElement>) => {
8+
if (e.key === ' ') {
9+
e.preventDefault()
10+
window.open(
11+
'https://github.com/StackOverflowIsBetterThanAnyAI/infinite-scroll-feed'
12+
)
13+
}
14+
}
15+
16+
return (
17+
<footer
18+
className="flex flex-col gap-y-2 w-full max-w-5xl text-pretty text-center text-small text-zinc-100 pb-2 pt-6 px-4 mb-1 mt-auto"
19+
data-testid="footer"
20+
>
21+
<span>
22+
Copyright &#169; {year} Michael Münzenhofer. All Rights
23+
Reserved.
24+
</span>
25+
<a
26+
href="https://github.com/StackOverflowIsBetterThanAnyAI/infinite-scroll-feed"
27+
onKeyDown={(e) => handleKeyDown(e)}
28+
target="_blank"
29+
rel="noopener noreferrer"
30+
aria-label="GitHub Repository (opens in new tab)"
31+
title="GitHub Repository (opens in new tab)"
32+
className="w-fit flex items-center gap-1 px-4 py-1 rounded-sm m-auto underline
33+
hover:bg-stone-700 active:bg-stone-600"
34+
data-testid="footer-github-link"
35+
>
36+
<svg
37+
xmlns="http://www.w3.org/2000/svg"
38+
viewBox="0 0 24 24"
39+
height={12}
40+
fill="currentColor"
41+
className="text-zinc-100"
42+
aria-hidden="true"
43+
focusable="false"
44+
>
45+
<path d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" />
46+
</svg>
47+
<span>GitHub Repository</span>
48+
</a>
49+
</footer>
50+
)
51+
}
52+
53+
export default Footer

0 commit comments

Comments
 (0)