1
1
import React from "react" ;
2
2
export default function CustomInput ( props ) {
3
- const { label, placeholder, width = 175 , name, setValue, value } = props ;
3
+ const { label, placeholder, width = 200 , name, setValue, value } = props ;
4
4
const errRef = React . useRef ( null ) ;
5
5
const parentRef = React . useRef ( null ) ;
6
6
const inputRef = React . useRef ( null ) ;
@@ -19,7 +19,7 @@ export default function CustomInput(props) {
19
19
const handelChange = ( e ) => {
20
20
errRef . current . innerHTML = "" ;
21
21
setNewInput ( e . target . value ) ;
22
-
22
+
23
23
setValue ( {
24
24
...value ,
25
25
[ newName ] : e . target . value ,
@@ -29,13 +29,13 @@ export default function CustomInput(props) {
29
29
//This function will and a new input to the
30
30
//getting the elements id
31
31
e . preventDefault ( ) ;
32
- if ( value [ newName ] && value [ newName ] !== "" ) {
32
+ if ( value [ newName ] && value [ newName ] !== "" ) {
33
33
setValue ( {
34
34
...value ,
35
35
[ name ] : [ ...value [ name ] , value [ newName ] ] ,
36
- [ newName ] :"" ,
36
+ [ newName ] : "" ,
37
37
} ) ;
38
- inputRef . current . value = "" ;
38
+ inputRef . current . value = "" ;
39
39
} else {
40
40
errRef . current . innerText = "Please enter valid name" ;
41
41
}
@@ -68,7 +68,7 @@ export default function CustomInput(props) {
68
68
< input
69
69
id = { index }
70
70
value = { value [ name ] [ index ] }
71
- className = "font-inter text-input"
71
+ className = "font-inter text-input text-white placeholder:text-[#828295] text-[12px] placeholder:italic "
72
72
style = { { width } }
73
73
placeholder = { item }
74
74
onChange = { handleUpdate }
@@ -78,7 +78,7 @@ export default function CustomInput(props) {
78
78
e . preventDefault ( ) ;
79
79
handelDelete ( item ) ;
80
80
} }
81
- className = "font-inter text-gray-500 absolute top-5 right-3 text-[12px]"
81
+ className = "font-inter absolute top-5 right-3 text-[12px] text-white placeholder:text-[#828295] placeholder:italic "
82
82
>
83
83
❌
84
84
</ button >
@@ -90,7 +90,7 @@ export default function CustomInput(props) {
90
90
type = "text"
91
91
value = { value [ newName ] }
92
92
ref = { inputRef }
93
- className = "font-inter text-input-custom "
93
+ className = "font-inter text-white placeholder:text-[#828295] text-[12px] placeholder:italic text-input-custom "
94
94
style = { { width } }
95
95
placeholder = { placeholder }
96
96
/>
0 commit comments