Skip to content

Commit

Permalink
Merge branch 'master' into add-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal065 authored Oct 12, 2024
2 parents a67c904 + d503002 commit fbdd8d9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
13 changes: 13 additions & 0 deletions public/data/Anshgrover23.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Ansh Grover",
"location": "Hanumangarh Town, Rajasthan",
"bio": "👨‍💻 Passionate web developer focused on JavaScript. Love learning new tech and improving code. Always exploring new ideas and contributing to open source. 🚀✨",
"avatar": "https://github.com/Anshgrover23.png",
"portfolio": "https://github.com/Anshgrover23",
"skills": ["HTML", "CSS", "JavaScript", "ReactJS", "Node.js", "Express.js"],
"social": {
"GitHub": "https://github.com/Anshgrover23",
"Twitter": "https://twitter.com/anshgrover938",
"LinkedIn": "https://www.linkedin.com/in/anshgrover23/"
}
}
12 changes: 12 additions & 0 deletions public/data/ArnavGarg68.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Arnav Garg",
"location": "Meerut, India",
"bio": "A software developer with experience in MERN stack & JAVA",
"avatar": "https://avatars.githubusercontent.com/u/150692775?s=400&u=76946dcd293b4bb56766f09dd3aef7755bde3911&v=4",
"portfolio": "https://portfolio-gsap.onrender.com",
"skills": ["React ", "MongoDB", "Express", "JavaScript", "Node", "GSAP", "HTML", "CSS", "JAVA"],
"social": {
"GitHub": "https://github.com/Arnavgarg68",
"LinkedIn": "https://www.linkedin.com/in/arnav-garg-221h/"
}
}
13 changes: 13 additions & 0 deletions public/data/krtEngineer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Kushagra Raj Tiwari",
"location": "Pune, India",
"bio": "Software Engineer @ Marketcast",
"avatar": "https://github.com/krtEngineer.png",
"portfolio": "",
"skills": ["Javascript", "Java", "AWS", "Typescript", "NodeJs", "NestJs", "React", "SQL", "Python"],
"social": {
"GitHub": "https://github.com/krtEngineer",
"Twitter": "https://x.com/kushagra1857",
"LinkedIn": "https://www.linkedin.com/in/kushagra-raj-tiwari/"
}
}
8 changes: 5 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function App() {
const recordsPerPage = 20;

const currentUrl = window.location.pathname;

useEffect(() => {
const fetchData = async (file) => {
try {
Expand All @@ -36,7 +37,7 @@ function App() {
setLoadingProfiles(true);
try {
const promises = filenames.map((file) => fetchData(`/data/${file}`));
const combinedData = await Promise.all(promises);
const combinedData = await Promise.all(promises).then((results) => results.flat());
setCombinedData(combinedData);
setShuffledProfiles(shuffleProfiles(combinedData));
} catch (error) {
Expand Down Expand Up @@ -80,11 +81,12 @@ function App() {
});

setProfiles(filteredResults);
setCurrentPage(1);
setSearching(true);
};

const handleNextPage = () => {
const totalPages = Math.ceil((searching ? profiles.length : combinedData.length) / recordsPerPage);
const totalPages = Math.ceil((searching ? profiles.length : shuffledProfiles.length) / recordsPerPage);
if (currentPage < totalPages) {
setCurrentPage(currentPage + 1);
}
Expand Down Expand Up @@ -132,7 +134,7 @@ function App() {
<div className="w-full pl-5 pr-4 md:h-screen md:w-[77%] md:overflow-y-scroll md:py-7" ref={profilesRef}>
<Search onSearch={handleSearch} />
{profiles.length === 0 && searching ? <NoResultFound /> : renderProfiles()}
{combinedData.length > 0 && (
{(searching ? profiles.length : shuffledProfiles.length) > 0 && (
<Pagination
currentPage={currentPage}
totalPages={Math.ceil((searching ? profiles.length : shuffledProfiles.length) / recordsPerPage)}
Expand Down
4 changes: 4 additions & 0 deletions src/ProfilesList.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[
"ArnavGarg68.json",
"samah554.json",
"mayurr7.json",
"vitormarinheiro.json",
"AndresFelipe077.json",
"Anshgrover23.json",
"adityashah7867.json",
"swarnendu19.json",
"hassanaboukhalil.json",
Expand Down Expand Up @@ -442,5 +444,7 @@
"Om-pawarr.json",
"boytur.json",
"giuliarappo.json",
"krtEngineer.json",
"giuliarappo.json"
"vishal065.json"
]
2 changes: 1 addition & 1 deletion src/components/Profile/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Card({ data }) {
{data.location}
</p>
<div
className="skills-container mt-4 flex h-auto gap-4 overflow-hidden hover:overflow-x-scroll hover:scroll-smooth"
className="skills-container mt-4 flex h-auto gap-4 overflow-hidden hover:overflow-hidden hover:scroll-smooth"
ref={cardRef}
>
{data.skills &&
Expand Down

0 comments on commit fbdd8d9

Please sign in to comment.