From 90b24dd9156618cdd378c7a7c4f1a90d125ee310 Mon Sep 17 00:00:00 2001 From: Siddhant Rai Date: Tue, 16 Jul 2024 18:20:13 +0530 Subject: [PATCH] fix: removed unused TextArea component --- frontend/src/components/TextArea.tsx | 58 ---------------------------- 1 file changed, 58 deletions(-) delete mode 100644 frontend/src/components/TextArea.tsx diff --git a/frontend/src/components/TextArea.tsx b/frontend/src/components/TextArea.tsx deleted file mode 100644 index 43e91e79..00000000 --- a/frontend/src/components/TextArea.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React, { useEffect, useRef } from 'react'; -import { TextAreaProps } from './types'; - -const TextArea = ({ - value, - isAutoFocused, - id, - maxLength, - name, - placeholder, - className, - children, - onChange, - onPaste, - onKeyDown, -}: TextAreaProps) => { - const textAreaRef = useRef(null); - - useEffect(() => { - const autoResizeTextArea = () => { - if (textAreaRef.current) { - textAreaRef.current.style.height = 'auto'; - - const maxHeight = 96; - const currentContentHeight = textAreaRef.current.scrollHeight; - - const newHeight = Math.min(maxHeight, currentContentHeight); - - textAreaRef.current.style.height = `${newHeight}px`; - } - }; - - autoResizeTextArea(); - }, [value]); - - return ( - - ); -}; - -export default TextArea;