import Icon from '@hackclub/icons' import { useRef, useState } from 'react' import { Box, Label, Input, Button, Text, Alert, Card, Heading, Grid, Flex, Checkbox } from 'theme-ui' import { Zoom } from 'react-reveal' const Loading = () => ( ) const Rsvp = () => { const [submitting, setSubmitting] = useState(false) const [submitted, setSubmitted] = useState(false) const formRef = useRef(null) const handleSubmit = async e => { e.preventDefault() setSubmitting(true) await fetch('/api/winter-rsvp', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ Name: e.target.name.value, Email: e.target.email.value, Age: e.target.age.checked }) }) formRef.current.reset() setSubmitting(false) setSubmitted(true) } return ( Get up to $250 to build a hardware project this winter. RSVP to join the event.

{submitted && ( Signed up! )}
) } export default Rsvp