diff --git a/frontend-react/src/components/Input_area.js b/frontend-react/src/components/Input_area.js deleted file mode 100644 index 423321bc4f0594c7db3196a63e3f9493d66e6d9c..0000000000000000000000000000000000000000 --- a/frontend-react/src/components/Input_area.js +++ /dev/null @@ -1,38 +0,0 @@ -import React, {useRef, useState} from 'react'; -import '../styles/style.css'; - -const InputArea = (props) => { - - const [value, setValue] = useState("") - const textareaRef = useRef(null); - const handleKeyDown = (event) => { - if (event.key === 'Enter') { - event.preventDefault(); - return false; - } - }; - - // Function to handle sending messages - function HandleSend(){ - if (value !== "") { - props.send_button(value, "right"); - setValue("") - } - - } - - return ( - <div className="header_bottom" id="input"> - <textarea id="input_area" ref={textareaRef} onKeyDown={handleKeyDown} placeholder="say HEY to start" value={value} onChange={event => setValue(event.target.value)}></textarea> - <button className="send_button" type="submit" id="send" onClick={HandleSend}>Send</button> - </div> - ); -}; - -document.addEventListener('keydown', function(event) { - if (event.key === 'Enter') { - document.getElementById('send').click(); - } -}); - -export default InputArea;