Skip to content

Commit 112c209

Browse files
committed
✨ Add Footer and Error components
1 parent 8cf5c59 commit 112c209

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

frontend/src/components/Common/AuthLayout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Logo from "/assets/images/fastapi-logo.svg"
2+
import { Footer } from "./Footer"
23

34
interface AuthLayoutProps {
45
children: React.ReactNode
@@ -18,6 +19,7 @@ export function AuthLayout({ children }: AuthLayoutProps) {
1819
<div className="flex flex-1 items-center justify-center">
1920
<div className="w-full max-w-xs">{children}</div>
2021
</div>
22+
<Footer />
2123
</div>
2224
</div>
2325
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Link } from "@tanstack/react-router"
2+
import { Button } from "@/components/ui/button"
3+
4+
const ErrorComponent = () => {
5+
return (
6+
<div
7+
className="flex min-h-screen items-center justify-center flex-col p-4"
8+
data-testid="error-component"
9+
>
10+
<div className="flex items-center z-10">
11+
<div className="flex flex-col ml-4 items-center justify-center p-4">
12+
<span className="text-6xl md:text-8xl font-bold leading-none mb-4">
13+
Error
14+
</span>
15+
<span className="text-2xl font-bold mb-2">Oops!</span>
16+
</div>
17+
</div>
18+
19+
<p className="text-lg text-muted-foreground mb-4 text-center z-10">
20+
Something went wrong. Please try again.
21+
</p>
22+
<Link to="/">
23+
<Button>Go Home</Button>
24+
</Link>
25+
</div>
26+
)
27+
}
28+
29+
export default ErrorComponent
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { FaGithub, FaLinkedinIn } from "react-icons/fa"
2+
import { FaXTwitter } from "react-icons/fa6"
3+
4+
const socialLinks = [
5+
{ icon: FaGithub, href: "https://github.com", label: "GitHub" },
6+
{ icon: FaXTwitter, href: "https://x.com", label: "X" },
7+
{ icon: FaLinkedinIn, href: "https://linkedin.com", label: "LinkedIn" },
8+
]
9+
10+
export function Footer() {
11+
const currentYear = new Date().getFullYear()
12+
13+
return (
14+
<footer className="border-t py-4 px-6">
15+
<div className="flex flex-col items-center justify-between gap-4 sm:flex-row">
16+
<p className="text-muted-foreground text-sm">
17+
© {currentYear} FastAPI. All rights reserved.
18+
</p>
19+
<div className="flex items-center gap-4">
20+
{socialLinks.map(({ icon: Icon, href, label }) => (
21+
<a
22+
key={label}
23+
href={href}
24+
target="_blank"
25+
rel="noopener noreferrer"
26+
aria-label={label}
27+
className="text-muted-foreground hover:text-foreground transition-colors"
28+
>
29+
<Icon className="h-5 w-5" />
30+
</a>
31+
))}
32+
</div>
33+
</div>
34+
</footer>
35+
)
36+
}

0 commit comments

Comments
 (0)