Commit 4986adae authored by Darrick Yong's avatar Darrick Yong

fix formatting

parent cb28455f
...@@ -3,12 +3,10 @@ import { connect } from "react-redux"; ...@@ -3,12 +3,10 @@ import { connect } from "react-redux";
import Select from "../atoms/Select"; import Select from "../atoms/Select";
import Input from "../atoms/Input"; import Input from "../atoms/Input";
import Button from "../atoms/Button"; import Button from "../atoms/Button";
import Error from "../atoms/Error";
const Search = ({ orders, setOrdersToShow, setFiltersOn }) => { const Search = ({ orders, setOrdersToShow, setFiltersOn }) => {
const [searchInput, setSearchInput] = useState(""); const [searchInput, setSearchInput] = useState("");
const [searchBy, setSearchBy] = useState(""); const [searchBy, setSearchBy] = useState("");
const [error, setError] = useState("");
const [inputError, setInputError] = useState(false); const [inputError, setInputError] = useState(false);
const [byError, setByError] = useState(false); const [byError, setByError] = useState(false);
...@@ -42,14 +40,14 @@ const Search = ({ orders, setOrdersToShow, setFiltersOn }) => { ...@@ -42,14 +40,14 @@ const Search = ({ orders, setOrdersToShow, setFiltersOn }) => {
} }
setSearchInput(""); setSearchInput("");
setFiltersOn(false); setFiltersOn(false);
} }
}; };
const handleInputBlur = (e) => { const handleInputBlur = (e) => {
if (!e.target.value.length) { if (!e.target.value.length) {
setInputError(true); setInputError(true);
} }
} };
const handleSearchEnter = (e) => { const handleSearchEnter = (e) => {
if (e.key === "Enter") { if (e.key === "Enter") {
...@@ -82,7 +80,6 @@ const Search = ({ orders, setOrdersToShow, setFiltersOn }) => { ...@@ -82,7 +80,6 @@ const Search = ({ orders, setOrdersToShow, setFiltersOn }) => {
onKeyPress={handleSearchEnter} onKeyPress={handleSearchEnter}
/> />
<Button className="search-btn" text="Search" onClick={search} /> <Button className="search-btn" text="Search" onClick={search} />
{/* {error.length ? <Error text={error} /> : null} */}
</div> </div>
); );
}; };
...@@ -91,7 +88,6 @@ const mapStateToProps = (state) => ({ ...@@ -91,7 +88,6 @@ const mapStateToProps = (state) => ({
orders: state.entities.orders, orders: state.entities.orders,
}); });
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({});
});
export default connect(mapStateToProps, mapDispatchToProps)(Search); export default connect(mapStateToProps, mapDispatchToProps)(Search);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment