import { getCookie, hasCookie } from 'cookies-next' import { Box, Card, Grid, Input, Label, Link, Select, Text, Textarea } from 'theme-ui' import useForm from '../../lib/use-form' import Submit from '../submit' import { withRouter } from 'next/router' const JoinForm = ({ sx = {}, router }) => { const useWaitlist = process.env.NEXT_PUBLIC_OPEN !== 'true' const { status, formProps, useField } = useForm('/api/join/', null, { clearOnSubmit: 60000, method: 'POST', initData: hasCookie('continent') ? { continent: getCookie('continent'), reason: router.query.reason, event: router.query.event } : { reason: router.query.reason, event: router.query.event } }) const eventReferrer = useField('event').value const isAdult = useField('year').value === 'tertiary' return (
{eventReferrer && ( {eventReferrer === 'onboard' ? "We can't wait to see your PCB!" : `We can't wait to see you at ${eventReferrer}!`}
In the meantime, we'll be hanging around in the Slack
)}