Skip to content

Commit 04ad273

Browse files
authored
Merge pull request #71 from devvsakib/development
added all type button issue #70
2 parents 9dd82f8 + cb7b61d commit 04ad273

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/components/Error/Error.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ const Error = ({ search, type }) => {
1717
});
1818

1919
const filteredErrorByType = filteredError.filter((error) => {
20-
return error.type.toLowerCase().includes(type.toLowerCase());
20+
if (type === "All") {
21+
return error;
22+
} return error.type.toLowerCase().includes(type.toLowerCase());
23+
2124
});
2225

2326
return (

src/components/Search/SearchInput.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from "react";
22
import { MdSearch, MdClear } from "react-icons/md";
33
import './css/style.css'
4-
const errorType = ["push", "commit", "merge", "pull", "add", "branch"]
4+
const errorType = ["All", "push", "commit", "merge", "pull", "add", "branch"]
55
import useWindowsize from "../../hooks/useWindowsize";
66

77
function SearchInput({ search, setSearch, setType }) {
@@ -55,7 +55,11 @@ function SearchInput({ search, setSearch, setType }) {
5555
errorType.map((item, i) => (
5656
<li key={i} className={`${item === "add" ? "bg-[#4024e0]" : item === "commit" ? "bg-[#1a5ba5]" : item === "push" ? "bg-[#1aa0a5]" : "bg-[#7e1aa5]"} w-full md:w-auto rounded-md text-white font-bold py-2 px-3 cursor-pointer`}
5757
onClick={() => { setType(item); setOpen(!open) }}
58-
>{item}</li>
58+
>{
59+
item
60+
}
61+
62+
</li>
5963
))
6064
}
6165
</ul>

0 commit comments

Comments
 (0)