diff --git a/package.json b/package.json index 2111356..dec8e91 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "@types/jest": "^24.0.0", - "@types/node": "^12.0.0", + "@types/node": "^14.14.35", "@types/react-dom": "^16.9.8", "@types/react-select": "^3.0.14", "@types/styled-components": "^5.1.1", diff --git a/src/components/elements.tsx b/src/components/elements.tsx index 060b217..48d81de 100644 --- a/src/components/elements.tsx +++ b/src/components/elements.tsx @@ -70,7 +70,7 @@ const StyledButton = styled.button` interface IIconButtonProps { icon: string; - onClick: any; + onClick: (e: React.FormEvent) => void; } /** diff --git a/src/components/modal.tsx b/src/components/modal.tsx index 566dee3..aede217 100644 --- a/src/components/modal.tsx +++ b/src/components/modal.tsx @@ -52,7 +52,7 @@ interface IModalProps { * @param {IModalProps} props - The needed props for the modal */ const Modal = ({ element, icon, text, condition, title, onClose, children }: IModalProps) => { - const [modalHidden, setModalHidden] = useState(condition ?? true); + const [modalHidden, setModalHidden] = useState(condition ?? true); const closeModal = () => { if (onClose) onClose(); diff --git a/src/components/searchBar.tsx b/src/components/searchBar.tsx index 3e730e1..0e27036 100644 --- a/src/components/searchBar.tsx +++ b/src/components/searchBar.tsx @@ -56,9 +56,7 @@ const SearchBar = ({ providers }: ISearchBarProps) => { let [input, setInput] = useState(""); let [buttonsHidden, setButtonsHidden] = useState(true); - useEffect(() => { - setButtonsHidden(input === ""); - }, [input]); + useEffect(() => setButtonsHidden(input === ""), [input]); const handleSearchQuery = (e: React.FormEvent) => { var query: string = input || ""; diff --git a/src/components/settings.tsx b/src/components/settings.tsx index 1160c16..a765697 100644 --- a/src/components/settings.tsx +++ b/src/components/settings.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import styled from "styled-components"; -import Select, { Styles } from "react-select"; +import Select, { Styles, ValueType } from "react-select"; import { ISearchProviderProps } from "./searchBar"; import selectedTheme, { setTheme, IThemeProps } from "../lib/theme"; @@ -118,14 +118,13 @@ interface ISettingsProps { providers: Array | undefined; } - /** * Handles the settings-modal * @param {Array} themes - the list of themes a user can select between * @param {Array} providers - the list of search providers */ const Settings = ({ themes, providers }: ISettingsProps) => { - const [newTheme, setNewTheme] = useState(); + const [newTheme, setNewTheme] = useState(); if (themes && providers) { return ( @@ -137,8 +136,8 @@ const Settings = ({ themes, providers }: ISettingsProps) => {