From bacfa32fa074b91640c65603b293b4f69b982cce Mon Sep 17 00:00:00 2001 From: Cláudio Date: Sun, 31 Jan 2021 20:18:54 -0300 Subject: Commit for #539 - validating to avoid empty comments - comment button now is green --- webui/src/pages/bug/CommentInput.tsx | 96 ------------------------------------ 1 file changed, 96 deletions(-) delete mode 100644 webui/src/pages/bug/CommentInput.tsx (limited to 'webui/src/pages/bug/CommentInput.tsx') diff --git a/webui/src/pages/bug/CommentInput.tsx b/webui/src/pages/bug/CommentInput.tsx deleted file mode 100644 index 540a53f7..00000000 --- a/webui/src/pages/bug/CommentInput.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import React, { useState, useEffect } from 'react'; - -import Tab from '@material-ui/core/Tab'; -import Tabs from '@material-ui/core/Tabs'; -import TextField from '@material-ui/core/TextField'; -import { makeStyles } from '@material-ui/core/styles'; - -import Content from 'src/components/Content'; - -const useStyles = makeStyles((theme) => ({ - container: { - margin: theme.spacing(2, 0), - padding: theme.spacing(0, 2, 2, 2), - }, - textarea: {}, - tabContent: { - margin: theme.spacing(2, 0), - }, - preview: { - borderBottom: `solid 3px ${theme.palette.grey['200']}`, - minHeight: '5rem', - }, - actions: { - display: 'flex', - justifyContent: 'flex-end', - }, -})); - -type TabPanelProps = { - children: React.ReactNode; - value: number; - index: number; -} & React.HTMLProps; -function TabPanel({ children, value, index, ...props }: TabPanelProps) { - return ( - - ); -} - -const a11yProps = (index: number) => ({ - id: `editor-tab-${index}`, - 'aria-controls': `editor-tabpanel-${index}`, -}); - -type Props = { - loading: boolean; - onChange: (comment: string) => void; -}; - -function CommentInput({ loading, onChange }: Props) { - const [input, setInput] = useState(''); - const [tab, setTab] = useState(0); - const classes = useStyles(); - - useEffect(() => { - onChange(input); - }, [input, onChange]); - - return ( -
- setTab(t)}> - - - -
- - setInput(e.target.value)} - disabled={loading} - /> - - - - -
-
- ); -} - -export default CommentInput; -- cgit