// create-group-form.tsx // Copyright (C) 2020 Dwayne Harris // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see . import React, { FC } from 'react' import { useDispatch } from 'react-redux' import { Link } from 'react-router-dom' import { faIdCard } from '@fortawesome/free-solid-svg-icons' import { checkGroupAvailability } from '../actions/registration' import { useTheme } from '../hooks' import CheckboxField from '../components/controls/checkbox-field' import TextField from '../components/controls/text-field' import SelectField from '../components/controls/select-field' import ImageField from '../components/controls/image-field' import CoverImageField from '../components/controls/cover-image-field' import IconImageField from '../components/controls/icon-image-field' import ThemeField from '../components/controls/theme-field' const CreateGroupForm: FC = () => { const theme = useTheme() const dispatch = useDispatch() const checkAvailability = (value: string) => { if (value.length > 3) { dispatch(checkGroupAvailability(value)) } } const registrationOptions = { open: 'Anyone can join', approval: 'Users must be approved', closed: 'Registration closed', } return (
checkAvailability(e.target.value)} /> I agree to the Communities terms and conditions.
) } export default CreateGroupForm