Skip to content

Commit

Permalink
Maded the filter labels responsive from issue AnkitaMalik22#35
Browse files Browse the repository at this point in the history
  • Loading branch information
P-DR0ZD committed Oct 18, 2022
1 parent c776893 commit b5b4ba9
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,37 @@ import AOS from "aos";
import "aos/dist/aos.css";
import Typewriter from 'typewriter-effect';


export default function Home() {
const [display, setDisplay] = useState("absolute");
const [lang, setLang] = useState();
// let languages=new Set();
// let langs=Array.from(languages)
const [profilesList, setProfiles] = useState();
let languages=new Set();

// function addSkill(skill){
// languages.add(skill)
// }
//Used to make sure that the inputs in profile.js are consitent for example html is equal to HTML
function checkLang(skill){
return skill.toUpperCase() == lang.toUpperCase();
}

// useEffect(() => {
// setLang(Array.from(languages))
// console.log(langs)
// },[addSkill])
useEffect(() => {
setLang(lang)
languages.add(lang)
let tmpList=[];
if(typeof(lang) != "undefined")
{
console.log(profiles)
profiles.map((data, index) => {
if(data.skills.find(checkLang))
{
tmpList.push(data);
}
})
setProfiles(tmpList);
}
else
{
setProfiles(profiles);
}
})

useEffect(() => {
AOS.init()
Expand Down Expand Up @@ -135,7 +151,7 @@ export default function Home() {

{/* added animations */}
<div data-aos="fade-up" data-aos-duration="1500" data-aos-anchor-placement="top-center" className={styles.grid}>
{profiles && profiles.map((data, index) => {
{profilesList && profilesList.map((data, index) => {
return (
<ProfileCard data={data} key={index} />
)
Expand Down

0 comments on commit b5b4ba9

Please sign in to comment.