This repository has been archived on 2025-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files
mylinks/admin/src/common/components/TextBox/TextBox.jsx

14 lines
664 B
JavaScript

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}/>
{props.icon && <FontAwesomeIcon icon={props.icon} className="textbox-icon"/>}
</div>
);
}