diff --git a/frontend/src/app/(main)/page.tsx b/frontend/src/app/(main)/page.tsx index e6842819..1f942a76 100644 --- a/frontend/src/app/(main)/page.tsx +++ b/frontend/src/app/(main)/page.tsx @@ -8,9 +8,15 @@ import { useAuthContext } from '@/providers/AuthProvider'; import { ProjectsSection } from '@/components/root/projects-section'; import { PromptForm, PromptFormRef } from '@/components/root/prompt-form'; import { ProjectContext } from '@/components/chat/code-engine/project-context'; - +import { SignInModal } from '@/components/sign-in-modal'; +import { SignUpModal } from '@/components/sign-up-modal'; +import { useRouter } from 'next/navigation'; export default function HomePage() { + // States for AuthChoiceModal const [showAuthChoice, setShowAuthChoice] = useState(false); + const router = useRouter(); + const [showSignIn, setShowSignIn] = useState(false); + const [showSignUp, setShowSignUp] = useState(false); const promptFormRef = useRef(null); const { isAuthorized } = useAuthContext(); @@ -19,9 +25,7 @@ export default function HomePage() { const handleSubmit = async () => { if (!promptFormRef.current) return; - // Get form data from the prompt form const { message, isPublic, model } = promptFormRef.current.getPromptData(); - if (!message.trim()) return; try { @@ -37,12 +41,11 @@ export default function HomePage() { } } catch (error) { console.error('Error creating project:', error); - // Error handling is done via toast in ProjectContext } }; return ( -
+
- {/* Modals */} + {/* Choice Modal */} setShowAuthChoice(false)} onSignUpClick={() => { setShowAuthChoice(false); + setTimeout(() => { + setShowSignUp(true); + }, 100); }} onSignInClick={() => { setShowAuthChoice(false); + setTimeout(() => { + setShowSignIn(true); + }, 100); }} /> - {/* Add this to your global CSS for the subtle pulse animation */} + {/* SignInModal & SignUpModal */} + setShowSignIn(false)} /> + setShowSignUp(false)} /> +