Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
juhomakkonen committed Apr 11, 2024
1 parent 2c1097e commit 5e58eb7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/Forms/UserForm/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
* @param event
* @param setState
*/
const handlePostalCodes = (
const handlePostalCodeStates = (
event: { target: { value: string } },
setState: (a: boolean) => void,
) => {
Expand Down Expand Up @@ -242,7 +242,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
<select
{...register('postal_code', { required: false })}
role="listbox"
onChange={(event) => handlePostalCodes(event, setIsPostalCode)}
onChange={(event) => handlePostalCodeStates(event, setIsPostalCode)}
disabled={isPostalCodeOther}
aria-required="false"
aria-invalid={errors.postal_code ? true : false}
Expand Down Expand Up @@ -272,7 +272,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
{...register('postal_code_other', { required: false, maxLength: 10 })}
type="text"
maxLength={10}
onChange={(event) => handlePostalCodes(event, setIsPostalCodeOther)}
onChange={(event) => handlePostalCodeStates(event, setIsPostalCodeOther)}
disabled={isPostalCode}
aria-required="false"
aria-invalid={errors.postal_code_other ? true : false}
Expand Down Expand Up @@ -303,7 +303,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
required: false,
})}
role="listbox"
onChange={(event) => handlePostalCodes(event, setIsOptionalPostalCode)}
onChange={(event) => handlePostalCodeStates(event, setIsOptionalPostalCode)}
disabled={isOptionalPostalCodeOther}
aria-required="false"
aria-invalid={errors.optional_postal_code ? true : false}
Expand Down Expand Up @@ -333,7 +333,9 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
{...register('optional_postal_code_other', { required: false, maxLength: 10 })}
type="text"
maxLength={10}
onChange={(event) => handlePostalCodes(event, setIsOptionalPostalCodeOther)}
onChange={(event) =>
handlePostalCodeStates(event, setIsOptionalPostalCodeOther)
}
disabled={isOptionalPostalCode}
aria-required="false"
aria-invalid={errors.optional_postal_code_other ? true : false}
Expand Down

0 comments on commit 5e58eb7

Please sign in to comment.