Skip to content

Commit a46b560

Browse files
committed
try once more
1 parent f8911bf commit a46b560

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed

src/assets/Pages/login.jsx

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { signInWithEmailAndPassword } from "firebase/auth";
2-
import { useState } from "react";
2+
import { useState } from "react";
33
import { auth } from "./firebase";
44
import { toast } from "react-toastify";
5-
import Navbar from '../Components/Navbar'
5+
import { Link } from 'react-router-dom'; // Import Link for routing
6+
import Navbar from '../Components/Navbar';
7+
68
function Login() {
79
const [email, setEmail] = useState("");
810
const [password, setPassword] = useState("");
@@ -18,52 +20,52 @@ function Login() {
1820
});
1921
} catch (error) {
2022
console.log(error.message);
21-
2223
toast.error(error.message, {
2324
position: "bottom-center",
2425
});
2526
}
2627
};
2728

2829
return (
29-
<>
30-
<Navbar></Navbar>
31-
<form onSubmit={handleSubmit} className="container mt-5 w-25">
32-
<h3 className="text-center mb-2">Login</h3>
30+
<>
31+
<Navbar />
32+
<form onSubmit={handleSubmit} className="container mt-5 w-25">
33+
<h3 className="text-center mb-2">Login</h3>
34+
35+
<div data-mdb-input-init className="form-outline mb-4">
36+
<label>Email address</label>
37+
<input
38+
type="email"
39+
className="form-control"
40+
placeholder="Enter email"
41+
value={email}
42+
onChange={(e) => setEmail(e.target.value)}
43+
/>
44+
</div>
3345

34-
<div data-mdb-input-init className="form-outline mb-4">
35-
<label>Email address</label>
36-
<input
37-
type="email"
38-
className="form-control"
39-
placeholder="Enter email"
40-
value={email}
41-
onChange={(e) => setEmail(e.target.value)}
42-
/>
43-
</div>
46+
<div data-mdb-input-init className="form-outline mb-4">
47+
<label>Password</label>
48+
<input
49+
type="password"
50+
className="form-control"
51+
placeholder="Enter password"
52+
value={password}
53+
onChange={(e) => setPassword(e.target.value)}
54+
/>
55+
</div>
4456

45-
<div data-mdb-input-init className="form-outline mb-4">
46-
<label>Password</label>
47-
<input
48-
type="password"
49-
className="form-control"
50-
placeholder="Enter password"
51-
value={password}
52-
onChange={(e) => setPassword(e.target.value)}
53-
/>
54-
</div>
57+
<div className="d-grid">
58+
<button type="submit" className="btn btn-primary mb-3">
59+
Submit
60+
</button>
61+
</div>
5562

56-
<div className="d-grid">
57-
<button type="submit" className="btn btn-primary mb-3">
58-
Submit
59-
</button>
60-
</div>
61-
<p className="forgot-password text-right">
62-
New user? <a href="/register">Register Here</a>
63-
</p>
64-
</form>
63+
<p className="forgot-password text-right">
64+
New user? <Link to="/register">Register Here</Link> {/* Replaced <a> with <Link> */}
65+
</p>
66+
</form>
6567
</>
6668
);
6769
}
6870

69-
export default Login;
71+
export default Login;

0 commit comments

Comments
 (0)