Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/pagination-visibilty when no results found #1103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions public/data/Saipradyumna Goud Chiragoni.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "Chiragoni Sai Pradyumna Goud",
"location": "Telangana, India",
"bio": "I am an aspiring full stack developer and very sincere about my work. I am pursuing my B.Tech at Kakatiya Institute of Technology and Science, and I am an open source contributor.",
"avatar": "https://github.com/saipradyumnagoud.png",
"portfolio": "https://github.com/saipradyumnagoud",
"skills": ["HTML", "CSS", "JAVASCRIPT", "REACT", "EXPRESS", "NODE", "MONGODB", "SQL","C","JAVA"],
"social": {
"GitHub": "https://github.com/saipradyumnagoud",
"Twitter": "https://x.com/saipradyumnaaaa",
"LinkedIn": "https://www.linkedin.com/in/saipradyumnagoudch/"
}
}
{
"name": "Chiragoni Sai Pradyumna Goud",
"location": "Telangana, India",
"bio": "I am an aspiring full stack developer and very sincere about my work. I am pursuing my B.Tech at Kakatiya Institute of Technology and Science, and I am an open source contributor.",
"avatar": "https://github.com/saipradyumnagoud.png",
"portfolio": "https://github.com/saipradyumnagoud",
"skills": ["HTML", "CSS", "JAVASCRIPT", "REACT", "EXPRESS", "NODE", "MONGODB", "SQL", "C", "JAVA"],
"social": {
"GitHub": "https://github.com/saipradyumnagoud",
"Twitter": "https://x.com/saipradyumnaaaa",
"LinkedIn": "https://www.linkedin.com/in/saipradyumnagoudch/"
}
}
12 changes: 12 additions & 0 deletions public/data/sohailk12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Sohail Ahmad",
"location": "Pakistan",
"bio": "i am a react front-end developer",
"avatar": "https://github.com/sohailk12.png",
"portfolio": "https://github.com/sohailk12",
"skills": ["JavaScript", "React js", "Html", "Css", "Saas", "BootStrap", "jquery"],
"social": {
"GitHub": "https://github.com/sohailk12",
"LinkedIn": "https://www.linkedin.com/in/sohail-ahmad-45373125a"
}
}
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function App() {
const endIndex = startIndex + recordsPerPage;
return data.slice(startIndex, endIndex);
};

console.log(profiles);
const renderProfiles = () => {
if (loadingProfiles) {
return (
Expand All @@ -132,13 +132,15 @@ 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 && (
{profiles.length >= recordsPerPage ? (
<Pagination
currentPage={currentPage}
totalPages={Math.ceil((searching ? profiles.length : shuffledProfiles.length) / recordsPerPage)}
onNextPage={handleNextPage}
onPrevPage={handlePrevPage}
/>
) : (
''
)}
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/ProfilesList.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,5 +432,6 @@
"AnkitMourya12.json",
"tainguyenphat74.json",
"Saipradyumna Goud Chiragoni.json",
"dylan-dot-c.json"
]
"dylan-dot-c.json",
"sohailk12.json"
]