|
1 | | -import React, { useState } from "react"; |
2 | | -import { useNavigate } from "react-router-dom"; |
| 1 | +import React from "react"; |
3 | 2 |
|
4 | 3 | export default function Login() { |
5 | | - const navigate = useNavigate(); |
6 | | - const [email, setEmail] = useState(""); |
7 | | - const [password, setPassword] = useState(""); |
8 | | - |
9 | | - const handleLogin = (e) => { |
10 | | - e.preventDefault(); |
11 | | - |
12 | | - // Replace these with your admin credentials |
13 | | - if (email === "[email protected]" && password === "123") { |
14 | | - localStorage.setItem("user", email); |
15 | | - navigate("/"); |
16 | | - } else { |
17 | | - alert("Invalid credentials"); |
18 | | - } |
19 | | - }; |
20 | | - |
21 | 4 | return ( |
22 | | - <div |
23 | | - style={{ |
24 | | - display: "flex", |
25 | | - alignItems: "center", |
26 | | - justifyContent: "center", |
27 | | - height: "100vh", |
28 | | - flexDirection: "column", |
29 | | - background: "linear-gradient(to right, #f7faff, #eaf2ff)", |
30 | | - }} |
31 | | - > |
32 | | - <img src="/logo.png" alt="logo" style={{ height: 70, marginBottom: 20 }} /> |
33 | | - <h2 style={{ color: "#004aad" }}>Welcome to FAT-EIBL</h2> |
34 | | - <p style={{ marginBottom: 20, color: "#555" }}> |
35 | | - Finance Audit Tracker – Edme Insurance Brokers Limited |
36 | | - </p> |
37 | | - <form |
38 | | - onSubmit={handleLogin} |
39 | | - style={{ |
40 | | - background: "#fff", |
41 | | - padding: 30, |
42 | | - borderRadius: 10, |
43 | | - boxShadow: "0 2px 10px rgba(0,0,0,0.1)", |
44 | | - display: "flex", |
45 | | - flexDirection: "column", |
46 | | - gap: 10, |
47 | | - minWidth: 300, |
48 | | - }} |
49 | | - > |
50 | | - <input |
51 | | - type="email" |
52 | | - placeholder="Email" |
53 | | - value={email} |
54 | | - onChange={(e) => setEmail(e.target.value)} |
55 | | - required |
56 | | - style={{ padding: 10, borderRadius: 6, border: "1px solid #ccc" }} |
57 | | - /> |
58 | | - <input |
59 | | - type="password" |
60 | | - placeholder="Password" |
61 | | - value={password} |
62 | | - onChange={(e) => setPassword(e.target.value)} |
63 | | - required |
64 | | - style={{ padding: 10, borderRadius: 6, border: "1px solid #ccc" }} |
65 | | - /> |
66 | | - <button className="btn" type="submit"> |
67 | | - Login |
68 | | - </button> |
69 | | - </form> |
| 5 | + <div className="flex items-center justify-center h-screen bg-gray-50"> |
| 6 | + <div className="p-6 bg-white rounded-2xl shadow-lg text-center"> |
| 7 | + <h1 className="text-2xl font-bold text-blue-900 mb-2"> |
| 8 | + Welcome to FAT-EIBL |
| 9 | + </h1> |
| 10 | + <p className="text-gray-500 mb-4"> |
| 11 | + Finance Audit Tracker – Edme Insurance Brokers Limited |
| 12 | + </p> |
| 13 | + <form> |
| 14 | + <input |
| 15 | + type="email" |
| 16 | + placeholder="Email" |
| 17 | + className="border p-2 w-64 mb-3 rounded" |
| 18 | + /> |
| 19 | + <input |
| 20 | + type="password" |
| 21 | + placeholder="Password" |
| 22 | + className="border p-2 w-64 mb-3 rounded" |
| 23 | + /> |
| 24 | + <button |
| 25 | + type="submit" |
| 26 | + className="bg-blue-700 text-white px-4 py-2 rounded w-64" |
| 27 | + > |
| 28 | + Login |
| 29 | + </button> |
| 30 | + </form> |
| 31 | + </div> |
70 | 32 | </div> |
71 | 33 | ); |
72 | 34 | } |
0 commit comments