import { Input, message } from 'antd' import { useForm } from 'antd/lib/form/Form' import FormItem from 'antd/lib/form/FormItem' import { useAppContext } from '../../contexts/AppContext' import { Button } from '../../elements/Button' import { Form } from '../../elements/Form' import { User } from '../../types' type NewUserForm = Omit & { password1: string password2: string } export const NewUser = () => { const api = useAppContext() const [form] = useForm() const handleFinish = (user: NewUserForm) => { if (user.password1 !== user.password2) { message.error('passwords do not match') return } api.post(`/dj-rest-auth/registration`, user) } return (
) }