Skip to content

Commit c99316f

Browse files
committed
✨ feat[login]: enhance login page UI and redirect logic for authenticated users
1 parent 2edfa47 commit c99316f

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

front-end/src/pages/Login/index.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,28 @@ const Login: React.FC<Props> = () => {
77
const { authState, login } = useAuthContext();
88

99
useEffect(() => {
10-
if (!authState.isLoggedin) {
11-
login();
10+
if (authState.isLoggedin) {
11+
window.location.href = "/";
1212
}
13-
}, []);
14-
return <></>;
13+
// eslint-disable-next-line react-hooks/exhaustive-deps
14+
}, [authState.isLoggedin]);
15+
16+
return (
17+
<div className="flex items-center justify-center h-screen bg-gradient-to-tr from-gray-800 via-gray-900 to-black text-white">
18+
<div className="text-center p-8 bg-gray-800 bg-opacity-90 rounded-xl shadow-2xl border border-gray-700">
19+
<h1 className="text-4xl font-extrabold mb-6 text-gray-100">Welcome to Team3 Task Reports</h1>
20+
<p className="text-lg mb-8 text-gray-300">Streamline your tasks and stay on top of your work.</p>
21+
<button
22+
className="bg-[#5865F2] hover:bg-[#4752C4] text-white font-semibold py-3 px-8 rounded-md shadow-lg transition-transform transform hover:scale-105"
23+
onClick={() => {
24+
login(); // Call the login logic
25+
}}
26+
>
27+
Login with Discord
28+
</button>
29+
</div>
30+
</div>
31+
);
1532
};
1633

1734
export default Login;

0 commit comments

Comments
 (0)