import { Box, Input, Label, Button, Select, Text, Grid } from 'theme-ui'
import { useEffect, useRef, useState } from 'react'
import theme from '@hackclub/theme'
import Icon from '../icon'
import { keyframes } from '@emotion/react'
import debounce from 'lodash/debounce'
const hideAnimation = keyframes({
from: { display: 'flex' },
to: { display: 'none', opacity: 0, padding: 0, position: 'absolute' }
})
const spinAnimation = keyframes({
from: { transform: 'rotate(0deg)' },
to: { transform: 'rotate(360deg)' }
})
function Base({ children, action, target, method, onSubmit, id }) {
return (
{children}
)
}
function Field({
placeholder,
label,
name,
type,
value,
onChange,
required = true,
loading = false
}) {
return (
{loading && (
)}
)
}
export default function Signup() {
const [submitted, setSubmitted] = useState(false)
const [eventName, setEventName] = useState('')
const [userEmail, setUserEmail] = useState('')
const handleSubmit = async e => {
e.preventDefault()
await fetch('/api/fiscal-sponsorship/demo', {
method: 'POST',
body: JSON.stringify({
eventName,
userEmail,
eventCategory: 'hardware grant'
})
})
setSubmitted(true)
// clear form
setEventName('')
setUserEmail('')
}
return (
<>
setEventName(e.target.value)}
/>
setUserEmail(e.target.value)}
/>
{submitted && (
Submitted! Check your email for a sign in link.
)}
>
)
}