Skip to content

Commit

Permalink
changes blogs,events, projects per page
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush4345 committed Feb 28, 2024
1 parent 016bfca commit f50df76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/ProjectsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { useMediaQuery } from "react-responsive";

const ProjectsPage = ({ projects }) => {
const [currentPage, setCurrentPage] = useState(0);
const bigScreen = useMediaQuery({ minWidth: "1536px" });
const projectsPerPage = bigScreen ? 8 : 6;
// const bigScreen = useMediaQuery({ minWidth: "1536px" });
const projectsPerPage = 8;

const handlePageClick = (data) => {
setCurrentPage(data.selected);
Expand Down
9 changes: 2 additions & 7 deletions src/components/blog/blogList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { useMediaQuery } from "react-responsive";
const BlogList = () => {
const [blogs, setBlogs] = useState([]);
const [currentPage, setCurrentPage] = useState(0);
const bigScreen = useMediaQuery({ minWidth: "1536px" });
const blogsPerPage = bigScreen ? 8 : 6;
// const bigScreen = useMediaQuery({ minWidth: "1536px" });
const blogsPerPage = 8;

useEffect(() => {
const fetchData = async () => {
Expand All @@ -35,11 +35,6 @@ const BlogList = () => {
const currentBlogs = blogs.slice(indexOfFirstProject, indexOfLastProject);
const pageCount = Math.ceil(blogs.length / 6);

// Function to handle page change
const handlePageChange = (newPage) => {
setCurrentPage(newPage);
};

return (
<>
<div className='mt-20 min-h-[90vh] relative'>
Expand Down
2 changes: 1 addition & 1 deletion src/components/event/eventList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EventList = () => {
const [events, setEvents] = useState([]);
const [currentPage, setCurrentPage] = useState(0);
const bigScreen = useMediaQuery({ minWidth: "1536px" });
const eventsPerPage = bigScreen ? 8 : 6;
const eventsPerPage = 8;

useEffect(() => {
const fetchData = async () => {
Expand Down

0 comments on commit f50df76

Please sign in to comment.