Skip to content

Commit

Permalink
Rewrote SignupForm to tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ipasic-softserve committed Jul 28, 2024
1 parent a13712e commit db50dbb
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { useState, useMemo } from 'react'
import {
useState,
useMemo,
FormEventHandler,
FocusEvent,
ChangeEvent
} from 'react'
import { useTranslation } from 'react-i18next'
import HashLink from '~/components/hash-link/HashLink'
import { useSelector } from 'react-redux'

import Box from '@mui/material/Box'
import FormControlLabel from '@mui/material/FormControlLabel'
Expand All @@ -13,14 +18,24 @@ import { guestRoutes } from '~/router/constants/guestRoutes'
import AppButton from '~/components/app-button/AppButton'

import { styles } from '~/containers/guest-home-page/signup-form/SignupForm.styles'
import { SignupParams, UseFormErrors, UseFormEventHandler } from '~/types'
import { useAppSelector } from '~/hooks/use-redux'

interface SignupFormProps {
handleSubmit: FormEventHandler<HTMLFormElement>
handleChange: UseFormEventHandler<SignupParams, ChangeEvent<HTMLInputElement>>
handleBlur: UseFormEventHandler<SignupParams, FocusEvent<HTMLInputElement>>
data: SignupParams
errors: UseFormErrors<SignupParams>
}

const SignupForm = ({
handleSubmit,
handleChange,
handleBlur,
data,
errors
}) => {
}: SignupFormProps) => {
const { t } = useTranslation()
const { privacyPolicy, termOfUse } = guestRoutes
const [isAgreementChecked, setIsAgreementChecked] = useState(false)
Expand All @@ -30,7 +45,7 @@ const SignupForm = ({
inputVisibility: confirmPasswordVisibility,
showInputText: showConfirmPassword
} = useInputVisibility(errors.confirmPassword)
const { authLoading } = useSelector((state) => state.appMain)
const { authLoading } = useAppSelector((state) => state.appMain)

const handleOnAgreementChange = () => {
setIsAgreementChecked((prev) => !prev)
Expand Down

0 comments on commit db50dbb

Please sign in to comment.