-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLoginPage.js
More file actions
81 lines (74 loc) · 2.28 KB
/
Copy pathLoginPage.js
File metadata and controls
81 lines (74 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React from "react";
import { useAuth0 } from "@auth0/auth0-react";
import { Navigate } from "react-router-dom";
import { HeroBackground } from "../components/HeroBackground";
import { useEffect, useState } from "react";
import Button from "../components/Button";
import "./LoginPage.css";
import Countdown from "react-countdown";
import CountdownRenderer from "../components/CountdownRenderer";
const LoginPage = () => {
const { loginWithRedirect, isAuthenticated } = useAuth0();
const [priorityCompleted, setPriorityCompleted] = useState(false);
useEffect(() => {
document.body.style.overflow = "hidden";
}, []);
if (isAuthenticated) {
return <Navigate to="/application" replace />;
}
return (
<>
<div className="hero">
<HeroBackground />
<h1 className="hero-text">Portal</h1>
<div className="buttons-container">
<Button
className="hero-button"
onClick={() => loginWithRedirect({ screen_hint: "signup" })}
>
Participant
</Button>
<Button
className="mentor-button"
variant="secondary"
onClick={() =>
window.open("https://forms.gle/iE2HH3dAPe3ubKwdA", "_blank")
}
>
Mentor/Judge
</Button>
</div>
{!priorityCompleted && (
<Countdown
date={new Date("2026-01-01T23:59:59-05:00")}
onComplete={() => setPriorityCompleted(true)}
renderer={({ days, hours, minutes, seconds }) => (
<CountdownRenderer
days={days}
hours={hours}
minutes={minutes}
seconds={seconds}
deadlineType="Priority applications"
/>
)}
/>
)}
{priorityCompleted && (
<Countdown
date={new Date("2026-01-16T23:59:59-05:00")}
renderer={({ days, hours, minutes, seconds }) => (
<CountdownRenderer
days={days}
hours={hours}
minutes={minutes}
seconds={seconds}
deadlineType="Regular applications"
/>
)}
/>
)}
</div>
</>
);
};
export default LoginPage;