Skip to content

Commit

Permalink
Project Section no result fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Mishra committed Nov 14, 2021
1 parent 9b651e6 commit 6fb1262
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/projects/allProjects/Projects.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
background: #000000;
scroll-behavior: smooth;
padding-bottom: 20px;
height: 100%;
width: 100%;
}

.Container-arrows {
Expand Down Expand Up @@ -74,6 +76,20 @@
display: flex;
}

.empty_text {
position: fixed;
width: 100%;
height: 100%;
background-color: black;
}

.empty_text h1 {
text-align: center;
color: white;
padding-top: 100px;
font-size: xx-large;
}

/* Custom Scroll bar */
.proj_slides::-webkit-scrollbar {
background: transparent;
Expand Down
33 changes: 33 additions & 0 deletions src/components/projects/allProjects/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,37 @@ import "react-icons/fi";
const Projects = () => {
let [proj_type, setproj_type] = useState("all");
let [proj_org, setproj_org] = useState("all");
const [empty, setEmpty] = useState(false);
const handleChange = (e) => {

let empty = true
for(let i=0; i<SlideData.length; i++)
{

if (SlideData[i].tags.includes(e.target.value) && SlideData[i].org_tag.includes(proj_org))
{
empty = false;
break;
}
}
setEmpty(empty);

setproj_type(e.target.value);
};
const handleOrg = (e) => {

let empty = true
for(let i=0; i<SlideData.length; i++)
{

if (SlideData[i].tags.includes(proj_type) && SlideData[i].org_tag.includes(e.target.value))
{
empty = false;
break;
}
}
setEmpty(empty);

setproj_org(e.target.value);
};
useEffect(() => {
Expand Down Expand Up @@ -88,6 +115,8 @@ const Projects = () => {
</select>
</form>
</div>
{!empty?
<>
<div className="Container-arrows">
<div className="Arrow1" onClick={slideLeft}>
<FaArrowLeft />
Expand All @@ -105,6 +134,10 @@ const Projects = () => {
}
})}
</div>
</>
:<div className="empty_text">
<h1>No Result Found :(</h1>
</div>}
</div>
);
};
Expand Down

0 comments on commit 6fb1262

Please sign in to comment.