|
|
|
@ -9,6 +9,7 @@ const FormFields = ({ |
|
|
|
|
set, |
|
|
|
|
label, |
|
|
|
|
borderClassname, |
|
|
|
|
inputClassname, |
|
|
|
|
type, |
|
|
|
|
maxLength, |
|
|
|
|
max, |
|
|
|
@ -17,7 +18,7 @@ const FormFields = ({ |
|
|
|
|
onClick, |
|
|
|
|
}) => { |
|
|
|
|
const [value, setValue] = useState(defaultValue); |
|
|
|
|
|
|
|
|
|
console.log(value); |
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
onClick={onClick} |
|
|
|
@ -31,8 +32,8 @@ const FormFields = ({ |
|
|
|
|
className={ |
|
|
|
|
"text-xs absolute transition-all duration-300 pointer-events-none px-3 transform -translate-x-[7px]" + |
|
|
|
|
(value |
|
|
|
|
? `text-[#2483E1] bg-white top-[-10px]` |
|
|
|
|
: "text-[#0F0543] top-[10px]") |
|
|
|
|
? ` text-blue-600 bg-white top-[-10px]` |
|
|
|
|
: " text-gray-400 top-[10px]") |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
{label} |
|
|
|
@ -54,7 +55,7 @@ const FormFields = ({ |
|
|
|
|
e.target.value = value; |
|
|
|
|
}} |
|
|
|
|
className={`rtl w-full h-full px-4 py-2 outline-0 text-xs rounded-md text-[#0F0543] focus:bg-white border-[#E0E0E0] focus:border-[#2483E1] focus:ring-transparent
|
|
|
|
|
${value === "" ? "bg-red-200 " : "bg-[#F9F9F9] "} `}
|
|
|
|
|
${!value ? "bg-[#F9F9F9] " : "bg-white "} `}
|
|
|
|
|
onChange={(e) => setValue(e.target.value)} |
|
|
|
|
inputMode={type === "number" ? "numeric" : ""} |
|
|
|
|
/> |
|
|
|
|