From f7920df2ed292361b96e5e470b6fc9e24fe986de Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 28 Aug 2020 09:27:29 +0300 Subject: [PATCH] Tasks: always show searchbar. Partial fix for #156. --- src/components/Tasks/Toolbar.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/components/Tasks/Toolbar.tsx b/src/components/Tasks/Toolbar.tsx index 2046176..75ffa07 100644 --- a/src/components/Tasks/Toolbar.tsx +++ b/src/components/Tasks/Toolbar.tsx @@ -8,7 +8,6 @@ import MoreVertIcon from "@material-ui/icons/MoreVert"; import MenuItem from "@material-ui/core/MenuItem"; import SortIcon from "@material-ui/icons/Sort"; import SearchIcon from "@material-ui/icons/Search"; -import CloseIcon from "@material-ui/icons/Close"; import TextField from "@material-ui/core/TextField"; import { makeStyles } from "@material-ui/core/styles"; import { Transition } from "react-transition-group"; @@ -57,23 +56,16 @@ interface PropsType { export default function Toolbar(props: PropsType) { const { showCompleted, setShowCompleted, searchTerm, setSearchTerm, showHidden, setShowHidden } = props; - const [showSearchField, setShowSearchField] = React.useState(false); const [sortAnchorEl, setSortAnchorEl] = React.useState(null); const [optionsAnchorEl, setOptionsAnchorEl] = React.useState(null); + const showSearchField = true; const classes = useStyles(); const dispatch = useDispatch(); const taskSettings = useSelector((state: StoreState) => state.settings.taskSettings); const { sortBy } = taskSettings; - const toggleSearchField = () => { - if (showSearchField) { - setSearchTerm(""); - } - setShowSearchField(!showSearchField); - }; - const handleSortChange = (sort: string) => { dispatch(setSettings({ taskSettings: { ...taskSettings, sortBy: sort } })); setSortAnchorEl(null); @@ -109,12 +101,6 @@ export default function Toolbar(props: PropsType) { )} -
- - {showSearchField ? : } - -
-
); -} \ No newline at end of file +}