site/components/slack/join-form.js
Lachlan Campbell eed9d5eb2d Redesign Slack page (#37)
* Redesign Slack page

* Fix homepage

* Add subtle arrow animation

* Continue polishing
2020-07-25 23:18:49 -04:00

50 lines
1.3 KiB
JavaScript

import { Card, Label, Input, Checkbox, Textarea } from 'theme-ui'
import useForm from '../../lib/use-form'
import Submit from '../submit'
const JoinForm = ({ sx = {} }) => {
const { status, formProps, useField } = useForm(
'https://v3.hackclub.com/api/som-join'
)
return (
<Card sx={{ maxWidth: 'narrow', mx: 'auto', label: { mb: 3 }, ...sx }}>
<form {...formProps}>
<Label>
Full name
<Input {...useField('name')} placeholder="Fiona Hackworth" required />
</Label>
<Label>
Email address
<Input
{...useField('email')}
placeholder="fiona@hackclub.com"
required
/>
</Label>
<Label variant="labelHoriz">
<Checkbox {...useField('teen', 'checkbox')} />
Are you a teenager?
</Label>
<Label>
Why do you want to join Hack Club?
<Textarea
{...useField('reason')}
placeholder="Write a few sentences."
required
/>
</Label>
<Submit
status={status}
labels={{
default: 'Request invitation',
error: 'Something went wrong',
success: 'Check your email!'
}}
/>
</form>
</Card>
)
}
export default JoinForm