+
+
{
{/* */}
{
}}
/>
-
+
+
-
+
+
{
{
}}
/>
+
-
[state.canSubmit, state.isSubmitting]}
- children={([canSubmit, isSubmitting]) => (
-
- )}
- />
+ [state.canSubmit, state.isSubmitting]}
+ children={([canSubmit, isSubmitting]) => (
+
+ )}
+ />
+
+
+
+ {/* Conditionally render the login page */}
+ {showLoginPage && (
+
+ )}
{displayModal ? (
@@ -434,6 +461,7 @@ const ClubRegistration: React.FC = () => {
""
)}
+ //
);
};
diff --git a/frontend/src/appComponents/Popup.tsx b/frontend/src/appComponents/Popup.tsx
index 8ec77a7..c15998b 100644
--- a/frontend/src/appComponents/Popup.tsx
+++ b/frontend/src/appComponents/Popup.tsx
@@ -1,9 +1,12 @@
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
+import ClubRegistration from './ClubRegistration';
-function Popup({ onClose }:any) {
+function Popup({ onClose }: any) {
+ const [showRegistrationPage, setShowRegistrationPage] = useState(false);
const [isOpen, setIsOpen] = useState(false); // Start with the popup closed
const navigate = useNavigate();
+
useEffect(() => {
// Show the popup after 3 seconds (3000 milliseconds)
const timeout = setTimeout(() => {
@@ -18,18 +21,25 @@ function Popup({ onClose }:any) {
onClose(); // Optional: Execute a function when closing
};
- // Close the popup when clicking outside of it
- const handleOverlayClick = (e:any) => {
+ const handleOverlayClick = (e: any) => {
if (e.target === e.currentTarget) {
handleClose();
}
};
+ const handleOpenRegistration = () => {
+ setShowRegistrationPage(true);
+ };
+
+ const handleCloseRegistration = () => {
+ setShowRegistrationPage(false);
+ };
+
if (!isOpen) return null;
return (
@@ -64,13 +74,12 @@ function Popup({ onClose }:any) {
+
+
+ {/* Render ClubRegistration only when showRegistrationPage is true */}
+ {showRegistrationPage && (
+
+ )}
);
}