Created the TextBox.jsx

This commit is contained in:
2022-12-27 15:20:40 +01:00
parent f70d649ae7
commit 99ca1a11d6

View File

@ -0,0 +1,14 @@
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import "./styles.sass";
export const TextBox = (props) => {
const handleAnimation = () => props.useRef ? props.useRef.current.classList.value = "textbox-wrapper" : "";
return (
<div className="textbox-wrapper" ref={props.useRef} onAnimationEnd={handleAnimation}>
<input className="textbox-input" placeholder={props.placeholder} value={props.value}
onChange={props.onUpdate} type={props.type || "text"} autoComplete={props.autoComplete}/>
<FontAwesomeIcon icon={props.icon} className="textbox-icon"/>
</div>
);
}