site/components/bank/apply/org-form.js
2023-04-06 15:21:06 -04:00

75 lines
No EOL
2.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useState, useEffect } from 'react'
import { Input, Textarea } from 'theme-ui'
import Checkbox from './checkbox'
import AddressInput from './address-input'
import Field from './field'
import AutofillColourFix from './autofill-colour-fix'
export default function OrganizationInfoForm({ requiredFields }) {
const [org, setOrg] = useState('organization')
useEffect(() => {
if (navigator.language === 'en-GB') setOrg('organisation')
}, [])
return (
<>
<Field name='eventName' label={`${org} name`} requiredFields={requiredFields}>
<Input
name='eventName'
id='eventName'
placeholder='Shelburne School Hackathon'
sx={{...AutofillColourFix}}
/>
</Field>
<Field
name='eventWebsite'
label={`${org} website`}
description='If you dont have one yet, you can leave this blank.'
requiredFields={requiredFields}
>
<Input
name='eventWebsite'
id='eventWebsite'
type='url'
placeholder='hackclub.com'
sx={{...AutofillColourFix}}
/>
</Field>
<Field name='eventLocation' label={`${org} location`} requiredFields={requiredFields}>
<AddressInput isPersonalAddressInput={false} name='eventLocation' />
</Field>
<Field
name='transparent'
label='Transparency mode'
col={false}
description={`
Transparent accounts balances and donations are public.
You choose who has access to personal details.
This can be changed later.
As an example, Hack Club's finances are transparent!
`}
requiredFields={requiredFields}
>
<Checkbox defaultChecked={true} name='transparent' />
</Field>
<Field
name='eventDescription'
label={`Tell us about your ${org}!`}
description='1 or 2 sentences will suffice'
requiredFields={requiredFields}
>
<Textarea
name='eventDescription'
id='eventDescription'
rows={3}
sx={{
resize: 'vertical',
width: '100%',
...AutofillColourFix
}}
/>
</Field>
</>
)
}