Skip to content

Commit 6bfa807

Browse files
authored
Merge pull request #18 from amanpoddar-dev12/main
"some changes in app js and side bar js"
2 parents 05f91f9 + 89249b3 commit 6bfa807

10 files changed

+285
-159
lines changed

public/data/abhishekkumar62000.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
"bio": "A passion of become a Data Scientists & Artificial Intelligence, Machine Learning learn about technology, Computer Science and programming language. I am always professional in my field.",
55
"avatar": "https://github.com/abhishekkumar62000.png",
66
"portfolio": "https://github.com/abhishekkumar62000",
7-
"skills": ["Data Scientists", "Data Analytics", "Python", "Statistics", "Power BI", "Tableau", "SQL", "Machine Learning", "Deep learning", "Generative AI", "Big Data"],
7+
"skills": [
8+
"Data Scientists",
9+
"Data Analytics",
10+
"Python",
11+
"Statistics",
12+
"Power BI",
13+
"Tableau",
14+
"SQL",
15+
"Machine Learning",
16+
"Deep learning",
17+
"Generative AI",
18+
"Big Data"
19+
],
820
"social": {
921
"GitHub": "https://github.com/abhishekkumar62000",
1022
"Twitter": "https://twitter.com/",

public/data/amanpoddar-dev12.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@
44
"bio": "A talented BCA student and front-end developer skilled in technologies like React, HTML, CSS, and JavaScript, with experience using frameworks like Tailwind and Bootstrap. I have successfully created numerous projects, showcasing my ability to design and build responsive, user-friendly web applications.",
55
"avatar": "https://github.com/amanpoddar-dev12.png",
66
"portfolio": "https://github.com/amanpoddar-dev12",
7-
"skills": ["React", "JavaScript", "Tailwind", "Python", "Java", "C", "C++", "HTML", "CSS", "DBMS", "WebDevelopment", "MernStack", "Bootstrap", "PHP", "mySQL"],
7+
"skills": [
8+
"React",
9+
"JavaScript",
10+
"Tailwind",
11+
"Python",
12+
"Java",
13+
"C",
14+
"C++",
15+
"HTML",
16+
"CSS",
17+
"DBMS",
18+
"WebDevelopment",
19+
"MernStack",
20+
"Bootstrap",
21+
"PHP",
22+
"mySQL"
23+
],
824
"social": {
925
"GitHub": "https://github.com/amanpoddar-dev12",
1026
"Twitter": "https://twitter.com/AmanPoddarr",

public/data/anux-cyberboy.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@
44
"bio": "I'm an engineering student at IMT Atlantique and I'm currently doing my final internship at EY as a cybersecurity consultant. I work on both organizational and technical issues. I also have a degree in applied economics from the University of Paris Saclay",
55
"avatar": "https://github.com/anux-cyberboy.png",
66
"portfolio": "https://github.com/anux-cyberboy",
7-
"skills": [ "Hacking", "Web Scrapping", "Shell Script", "Cyber Security", "Linux", "Shell", "Firebase", "Supabase", "Webpack", "Babel", "Hacker", "Bug Bounty"],
7+
"skills": [
8+
"Hacking",
9+
"Web Scrapping",
10+
"Shell Script",
11+
"Cyber Security",
12+
"Linux",
13+
"Shell",
14+
"Firebase",
15+
"Supabase",
16+
"Webpack",
17+
"Babel",
18+
"Hacker",
19+
"Bug Bounty"
20+
],
821
"social": {
922
"GitHub": "https://github.com/anux-cyberboy",
1023
"Twitter": "https://x.com/AnuxGamerz",

public/data/codeaashu.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,35 @@
44
"bio": "A proficient Web Developer & Designer specializing in crafting captivating Websites & Apps. My focus on user-centric design, creative development, and effective collaboration, i can also elevate the brand presence with my design expertise. Till now i build 50+ WEB APP. Most importantly, I'm a reliable designer you can rely on for all your design needs.",
55
"avatar": "https://github.com/codeaashu.png",
66
"portfolio": "https://ashutosh-kumar.vercel.app",
7-
"skills": ["React", "Tailwind", "JavaScript", "TypeScript", "NodeJS", "ThreeJS", "NextJS", "AnimeJS", "ExpressJS", "Redux", "GSAP", "MaterialUI", "SASS", "WebDevelopment", "MernStack", "WebDesign", "Figma", "Webflow", "Wix", "framer", "Bootstrap", "PHP", "mySQL", "MongoDB", "SEO", "Shell", "prompt Engineering"],
7+
"skills": [
8+
"React",
9+
"Tailwind",
10+
"JavaScript",
11+
"TypeScript",
12+
"NodeJS",
13+
"ThreeJS",
14+
"NextJS",
15+
"AnimeJS",
16+
"ExpressJS",
17+
"Redux",
18+
"GSAP",
19+
"MaterialUI",
20+
"SASS",
21+
"WebDevelopment",
22+
"MernStack",
23+
"WebDesign",
24+
"Figma",
25+
"Webflow",
26+
"Wix",
27+
"framer",
28+
"Bootstrap",
29+
"PHP",
30+
"mySQL",
31+
"MongoDB",
32+
"SEO",
33+
"Shell",
34+
"prompt Engineering"
35+
],
836
"social": {
937
"GitHub": "https://github.com/codeaashu",
1038
"Twitter": "https://twitter.com/warrior_aashuu",

public/data/deruxhalter3js.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"Git",
2020
"Tailwind CSS",
2121
"REST APIs",
22-
"GraphQL"],
22+
"GraphQL"
23+
],
2324
"social": {
2425
"GitHub": "https://github.com/deruxhalter3js",
2526
"Twitter": "https://twitter.com/DavidMwas2_0",

public/data/shubhcoding01.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,30 @@
44
"bio": "I'm Web-Developer, I'm currently working as Freelancer, Open to work as a Software Engineer, I'm currently learning MERN, Funfact: I also do Photo/Video Editing ",
55
"avatar": "https://github.com/shubhcoding01.png",
66
"portfolio": "https://github.com/shubhcoding01",
7-
"skills": ["Java", "JavaScript", "HTML", "CSS", "C++", "DSA", "MY SQL", "PYTHON", "C", "React", "Cyber Security", "WebFlow", "Canva", "Figma", "NodeJS", "WebDevelopment", "FullStack", "MernStack", "GSAP", "Git", "GitHub", "KALI LINUX"],
7+
"skills": [
8+
"Java",
9+
"JavaScript",
10+
"HTML",
11+
"CSS",
12+
"C++",
13+
"DSA",
14+
"MY SQL",
15+
"PYTHON",
16+
"C",
17+
"React",
18+
"Cyber Security",
19+
"WebFlow",
20+
"Canva",
21+
"Figma",
22+
"NodeJS",
23+
"WebDevelopment",
24+
"FullStack",
25+
"MernStack",
26+
"GSAP",
27+
"Git",
28+
"GitHub",
29+
"KALI LINUX"
30+
],
831
"social": {
932
"GitHub": "https://github.com/shubhcoding01",
1033
"Twitter": "https://x.com/shubh__coding",

src/App.js

Lines changed: 10 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,14 @@
1-
import { useState, useEffect, useRef } from 'react';
2-
import Profile from './components/Profile/Profile';
3-
import ProfileSkeleton from './components/ProfileSkeleton/ProfileSkeleton';
4-
import Search from './components/Search/Search';
5-
import Sidebar from './components/Sidebar/Sidebar';
6-
import ErrorPage from './components/ErrorPage/ErrorPage';
7-
import NoResultFound from './components/NoResultFound/NoResultFound';
8-
import Pagination from './components/Pagination/Pagination';
9-
import './App.css';
10-
import filenames from './ProfilesList.json';
11-
1+
import AboutUS from './components/Sidebar/AboutUs';
2+
import Homepage from './Homepage';
3+
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
124
function App() {
13-
const profilesRef = useRef();
14-
const [profiles, setProfiles] = useState([]);
15-
const [searching, setSearching] = useState(false);
16-
const [combinedData, setCombinedData] = useState([]);
17-
const [currentPage, setCurrentPage] = useState(1);
18-
const [shuffledProfiles, setShuffledProfiles] = useState([]);
19-
const [loadingProfiles, setLoadingProfiles] = useState(false);
20-
const recordsPerPage = 20;
21-
22-
const currentUrl = window.location.pathname;
23-
useEffect(() => {
24-
const fetchData = async (file) => {
25-
try {
26-
const response = await fetch(file);
27-
const data = await response.json();
28-
return data;
29-
} catch (error) {
30-
console.error('Error fetching data:', error);
31-
return [];
32-
}
33-
};
34-
35-
const combineData = async () => {
36-
setLoadingProfiles(true);
37-
try {
38-
const promises = filenames.map((file) => fetchData(`/data/${file}`));
39-
const combinedData = await Promise.all(promises);
40-
setCombinedData(combinedData);
41-
setShuffledProfiles(shuffleProfiles(combinedData));
42-
} catch (error) {
43-
console.error('Error combining data:', error);
44-
setCombinedData([]);
45-
setShuffledProfiles([]);
46-
}
47-
setLoadingProfiles(false);
48-
};
49-
50-
combineData();
51-
}, []);
52-
53-
const shuffleProfiles = (array) => {
54-
for (let i = array.length - 1; i > 0; i--) {
55-
const j = Math.floor(Math.random() * (i + 1));
56-
[array[i], array[j]] = [array[j], array[i]];
57-
}
58-
return array;
59-
};
60-
61-
const handleSearch = ({ value, criteria }) => {
62-
const normalizeString = (str) =>
63-
str
64-
.toLowerCase()
65-
.replace(/\s*,\s*/g, ' ')
66-
.replace(/\s+/g, ' ')
67-
.trim();
68-
69-
const normalizedValue = normalizeString(value);
70-
71-
const filteredResults = combinedData.filter((user) => {
72-
if (criteria === 'name') {
73-
return normalizeString(user.name).includes(normalizedValue);
74-
} else if (criteria === 'location') {
75-
return normalizeString(user.location).includes(normalizedValue);
76-
} else if (criteria === 'skill') {
77-
return user.skills.some((skill) => normalizeString(skill).includes(normalizedValue));
78-
}
79-
return false;
80-
});
81-
82-
setProfiles(filteredResults);
83-
setSearching(true);
84-
};
85-
86-
const handleNextPage = () => {
87-
const totalPages = Math.ceil((searching ? profiles.length : combinedData.length) / recordsPerPage);
88-
if (currentPage < totalPages) {
89-
setCurrentPage(currentPage + 1);
90-
}
91-
};
92-
93-
const handlePrevPage = () => {
94-
if (currentPage > 1) {
95-
setCurrentPage(currentPage - 1);
96-
}
97-
};
98-
99-
useEffect(() => {
100-
profilesRef.current.scrollTo({
101-
top: 0,
102-
behavior: 'smooth',
103-
});
104-
}, [currentPage]);
105-
106-
const getPaginatedData = () => {
107-
const data = searching ? profiles : shuffledProfiles;
108-
const startIndex = (currentPage - 1) * recordsPerPage;
109-
const endIndex = startIndex + recordsPerPage;
110-
return data.slice(startIndex, endIndex);
111-
};
112-
113-
const renderProfiles = () => {
114-
if (loadingProfiles) {
115-
return (
116-
<>
117-
{Array(5)
118-
.fill('profile-skeleton')
119-
.map((item, index) => (
120-
<ProfileSkeleton key={index} />
121-
))}
122-
</>
123-
);
124-
}
125-
const paginatedData = getPaginatedData();
126-
return paginatedData.map((currentRecord, index) => <Profile data={currentRecord} key={index} />);
127-
};
128-
129-
return currentUrl === '/' ? (
130-
<div className="App flex flex-col bg-primaryColor dark:bg-secondaryColor md:flex-row">
131-
<Sidebar />
132-
<div className="w-full pl-5 pr-4 md:h-screen md:w-[77%] md:overflow-y-scroll md:py-7" ref={profilesRef}>
133-
<Search onSearch={handleSearch} />
134-
{profiles.length === 0 && searching ? <NoResultFound /> : renderProfiles()}
135-
{combinedData.length > 0 && (
136-
<Pagination
137-
currentPage={currentPage}
138-
totalPages={Math.ceil((searching ? profiles.length : shuffledProfiles.length) / recordsPerPage)}
139-
onNextPage={handleNextPage}
140-
onPrevPage={handlePrevPage}
141-
/>
142-
)}
143-
</div>
144-
</div>
145-
) : (
146-
<ErrorPage />
5+
return (
6+
<BrowserRouter>
7+
<Routes>
8+
<Route path="/" element={<Homepage />} />
9+
<Route path="/about" element={<AboutUS />} />
10+
</Routes>
11+
</BrowserRouter>
14712
);
14813
}
149-
15014
export default App;

0 commit comments

Comments
 (0)