Skip to content

Commit 895fa61

Browse files
committed
Add back button to login and register
1 parent 802a720 commit 895fa61

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

src/app/login/page.jsx

+14-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { signInWithEmailAndPassword } from "firebase/auth";
66
import { auth } from "@/firebase/config";
77
import { useRouter } from "next/navigation";
88
import Link from "next/link";
9-
import { FaEnvelope, FaLock } from "react-icons/fa";
9+
import { FaEnvelope, FaLock, FaArrowLeft } from "react-icons/fa";
1010

11-
export default function LoginPage() {
11+
export default function Login() {
1212
const [email, setEmail] = useState("");
1313
const [password, setPassword] = useState("");
1414
const [error, setError] = useState("");
@@ -25,15 +25,24 @@ export default function LoginPage() {
2525
router.push("/dashboard");
2626
} catch (err) {
2727
console.error("Login error:", err);
28-
setError(err.message || "Failed to sign in. Please check your credentials.");
28+
setError("Failed to log in. Please check your credentials.");
29+
} finally {
30+
setLoading(false);
2931
}
30-
31-
setLoading(false);
3232
};
3333

3434
return (
3535
<div className="min-h-screen flex items-center justify-center bg-gray-900 py-12 px-4 sm:px-6 lg:px-8">
3636
<div className="max-w-md w-full space-y-8">
37+
{/* Back Button */}
38+
<Link
39+
href="/"
40+
className="inline-flex items-center text-gray-400 hover:text-white transition-colors"
41+
>
42+
<FaArrowLeft className="w-4 h-4 mr-2" />
43+
<span>Back to Home</span>
44+
</Link>
45+
3746
<div>
3847
<h2 className="mt-6 text-center text-3xl font-extrabold text-white">
3948
Sign in to your account

src/app/page.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function Home() {
1414
</h1>
1515
<p className="text-xl text-gray-400 max-w-2xl">
1616
Advanced (not really) encryption tools for your sensitive information.
17-
Military-grade (def not) security made simple and accessible.
17+
Military-grade (def not) security made simple.
1818
</p>
1919
</div>
2020

src/app/register/page.jsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createUserWithEmailAndPassword } from "firebase/auth";
66
import { auth } from "@/firebase/config";
77
import { useRouter } from "next/navigation";
88
import Link from "next/link";
9-
import { FaEnvelope, FaLock } from "react-icons/fa";
9+
import { FaEnvelope, FaLock, FaArrowLeft } from "react-icons/fa";
1010

1111
const basePath = "/crypt-webapp";
1212

@@ -43,6 +43,14 @@ export default function RegisterPage() {
4343
return (
4444
<div className="min-h-screen flex items-center justify-center bg-gray-900 py-12 px-4 sm:px-6 lg:px-8">
4545
<div className="max-w-md w-full space-y-8">
46+
<Link
47+
href="/"
48+
className="inline-flex items-center text-gray-400 hover:text-white transition-colors"
49+
>
50+
<FaArrowLeft className="w-4 h-4 mr-2" />
51+
<span>Back to Home</span>
52+
</Link>
53+
4654
<div>
4755
<h2 className="mt-6 text-center text-3xl font-extrabold text-white">
4856
Create an account

0 commit comments

Comments
 (0)