You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
2.0 KiB
55 lines
2.0 KiB
import React, { FC, FocusEventHandler } from 'react'
|
|
import { Link } from 'react-router-dom'
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
import { faUpload, faIdCard } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
import CheckboxField from '../forms/checkbox-field'
|
|
import TextField from '../forms/text-field'
|
|
import SelectField from '../forms/select-field'
|
|
|
|
interface Props {
|
|
checkAvailability: FocusEventHandler<HTMLInputElement>
|
|
}
|
|
|
|
const CreateGroupForm: FC<Props> = ({ checkAvailability }) => {
|
|
const registrationOptions = {
|
|
open: 'Anyone can join',
|
|
approval: 'Users must be approved',
|
|
closed: 'Registration closed',
|
|
}
|
|
|
|
return (
|
|
<div className="container">
|
|
<TextField name="group-name" label="Community Name" onBlur={checkAvailability} />
|
|
<br />
|
|
|
|
<SelectField name="group-registration" label="Registration" options={registrationOptions} icon={faIdCard} />
|
|
<br />
|
|
|
|
<div className="field">
|
|
<label className="label">Community Image</label>
|
|
<div className="file is-primary">
|
|
<label className="file-label">
|
|
<input className="file-input" type="file" name="image" />
|
|
<span className="file-cta">
|
|
<span className="file-icon">
|
|
<FontAwesomeIcon icon={faUpload} />
|
|
</span>
|
|
<span className="file-label">
|
|
Choose an image...
|
|
</span>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
<p className="help">Image must be smaller than 5 MBs.</p>
|
|
</div>
|
|
<br />
|
|
|
|
<CheckboxField name="group-agree">
|
|
I agree to the Community <Link to="/terms">terms and conditions</Link>.
|
|
</CheckboxField>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default CreateGroupForm
|