Skip to content

Commit f3b7df3

Browse files
committed
refactor: replace Field component with TextField in FormContact
1 parent 1846911 commit f3b7df3

File tree

1 file changed

+3
-8
lines changed
  • web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails

1 file changed

+3
-8
lines changed

web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/FormContact.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Dispatch, SetStateAction, useMemo, useEffect } from "react";
22

3-
import { Field } from "@kleros/ui-components-library";
3+
import { TextField } from "@kleros/ui-components-library";
44
import { isEmpty } from "src/utils";
55

66
interface IForm {
@@ -28,11 +28,6 @@ const FormContact: React.FC<IForm> = ({
2828
setContactIsValid(validator.test(contactInput));
2929
}, [contactInput, setContactIsValid, validator]);
3030

31-
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
32-
event.preventDefault();
33-
setContactInput(event.target.value);
34-
};
35-
3631
const fieldVariant = useMemo(() => {
3732
if (isEmpty(contactInput) || !isEditing) {
3833
return undefined;
@@ -43,11 +38,11 @@ const FormContact: React.FC<IForm> = ({
4338
return (
4439
<>
4540
<label className="flex justify-between mb-[10px]">{contactLabel}</label>
46-
<Field
41+
<TextField
4742
className="flex flex-col items-center w-full"
4843
variant={fieldVariant}
4944
value={contactInput}
50-
onChange={handleInputChange}
45+
onChange={(value) => setContactInput(value)}
5146
placeholder={contactPlaceholder}
5247
/>
5348
</>

0 commit comments

Comments
 (0)