3
3
import { useRef } from "react" ;
4
4
import { useState } from "react" ;
5
5
import { AnimatePresence , motion } from "motion/react" ;
6
+ import { Dialog , DialogBackdrop , DialogPanel } from "@headlessui/react" ;
6
7
7
8
export function SignUpForm ( ) {
8
9
return (
@@ -29,6 +30,7 @@ export function HeroActions() {
29
30
let input = useRef < HTMLInputElement > ( null ) ;
30
31
let getCourseButton = useRef ( null ) ;
31
32
let containerRef = useRef < HTMLInputElement > ( null ) ;
33
+ let [ isDialogOpen , setIsDialogOpen ] = useState ( false ) ;
32
34
33
35
const handleBlur = ( e : React . FocusEvent < HTMLInputElement > ) => {
34
36
if ( ! input . current ) return ;
@@ -155,6 +157,7 @@ export function HeroActions() {
155
157
< AnimatePresence initial = { false } >
156
158
{ signUpState === "closed" && (
157
159
< motion . button
160
+ onClick = { ( ) => setIsDialogOpen ( true ) }
158
161
layout
159
162
transition = { { duration : 0.3 } }
160
163
className = "inline-flex flex-nowrap items-baseline gap-1.5 self-center rounded-full bg-white/25 px-4 py-2 pl-3 text-sm/6 font-semibold whitespace-nowrap text-white hover:bg-white/30"
@@ -180,6 +183,16 @@ export function HeroActions() {
180
183
</ motion . button >
181
184
) }
182
185
</ AnimatePresence >
186
+ < Dialog open = { isDialogOpen } onClose = { ( ) => setIsDialogOpen ( false ) } >
187
+ < DialogBackdrop className = "fixed inset-0 bg-black/85" />
188
+ < div className = "fixed inset-0 grid place-items-center" >
189
+ < DialogPanel >
190
+ < video controls className = "rounded-2xl" >
191
+ < source src = "https://assets.tailwindcss.com/build-uis-that-dont-suck/intro.mp4" type = "video/mp4" />
192
+ </ video >
193
+ </ DialogPanel >
194
+ </ div >
195
+ </ Dialog >
183
196
</ div >
184
197
) ;
185
198
}
0 commit comments