We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0296a47 commit 3f86b5aCopy full SHA for 3f86b5a
src/pages/RegistrationForm.tsx
@@ -13,13 +13,17 @@ function RegistrationForm({ isStudent }: { isStudent: boolean }) {
13
const [loading, setLoading] = useState<boolean>(false);
14
15
const [isRegistering, setIsRegistering] = useState(false);
16
+ const [registrationsOpen, setRegistrationsOpen] = useState(true);
17
18
const userType = isStudent ? "student" : "mentor";
19
20
+
21
+ if(REGISTRATIONS_OPEN === false) setRegistrationsOpen(false);
22
23
useEffect(() => {
24
setIsRegistering(!authContext.isRegistered);
25
- if (isRegistering && !REGISTRATIONS_OPEN) {
26
+ if (isRegistering && !registrationsOpen) {
27
// Redirect if registrations are closed and is registering
28
navigate(ROUTER_PATHS.HOME);
29
}
0 commit comments