@@ -8,9 +8,15 @@ import { useAuthContext } from '@/providers/AuthProvider';
8
8
import { ProjectsSection } from '@/components/root/projects-section' ;
9
9
import { PromptForm , PromptFormRef } from '@/components/root/prompt-form' ;
10
10
import { ProjectContext } from '@/components/chat/code-engine/project-context' ;
11
-
11
+ import { SignInModal } from '@/components/sign-in-modal' ;
12
+ import { SignUpModal } from '@/components/sign-up-modal' ;
13
+ import { useRouter } from 'next/navigation' ;
12
14
export default function HomePage ( ) {
15
+ // States for AuthChoiceModal
13
16
const [ showAuthChoice , setShowAuthChoice ] = useState ( false ) ;
17
+ const router = useRouter ( ) ;
18
+ const [ showSignIn , setShowSignIn ] = useState ( false ) ;
19
+ const [ showSignUp , setShowSignUp ] = useState ( false ) ;
14
20
15
21
const promptFormRef = useRef < PromptFormRef > ( null ) ;
16
22
const { isAuthorized } = useAuthContext ( ) ;
@@ -19,9 +25,7 @@ export default function HomePage() {
19
25
const handleSubmit = async ( ) => {
20
26
if ( ! promptFormRef . current ) return ;
21
27
22
- // Get form data from the prompt form
23
28
const { message, isPublic, model } = promptFormRef . current . getPromptData ( ) ;
24
-
25
29
if ( ! message . trim ( ) ) return ;
26
30
27
31
try {
@@ -37,12 +41,11 @@ export default function HomePage() {
37
41
}
38
42
} catch ( error ) {
39
43
console . error ( 'Error creating project:' , error ) ;
40
- // Error handling is done via toast in ProjectContext
41
44
}
42
45
} ;
43
46
44
47
return (
45
- < div className = "pt-32 pb-24 px-6 " >
48
+ < div className = "pt-32 pb-24 px-6" >
46
49
< motion . div
47
50
className = "flex flex-col items-center"
48
51
initial = { { opacity : 0 , y : 20 } }
@@ -85,19 +88,28 @@ export default function HomePage() {
85
88
</ div >
86
89
</ motion . div >
87
90
88
- { /* Modals */ }
91
+ { /* Choice Modal */ }
89
92
< AuthChoiceModal
90
93
isOpen = { showAuthChoice }
91
94
onClose = { ( ) => setShowAuthChoice ( false ) }
92
95
onSignUpClick = { ( ) => {
93
96
setShowAuthChoice ( false ) ;
97
+ setTimeout ( ( ) => {
98
+ setShowSignUp ( true ) ;
99
+ } , 100 ) ;
94
100
} }
95
101
onSignInClick = { ( ) => {
96
102
setShowAuthChoice ( false ) ;
103
+ setTimeout ( ( ) => {
104
+ setShowSignIn ( true ) ;
105
+ } , 100 ) ;
97
106
} }
98
107
/>
99
108
100
- { /* Add this to your global CSS for the subtle pulse animation */ }
109
+ { /* SignInModal & SignUpModal */ }
110
+ < SignInModal isOpen = { showSignIn } onClose = { ( ) => setShowSignIn ( false ) } />
111
+ < SignUpModal isOpen = { showSignUp } onClose = { ( ) => setShowSignUp ( false ) } />
112
+
101
113
< style jsx global > { `
102
114
.animate-pulse-subtle {
103
115
animation: pulse-subtle 2s infinite;
0 commit comments