Commit 32ac1ea7 by jaymehta

.

1 parent 2926a56c
...@@ -21,8 +21,8 @@ const Detail = () => { ...@@ -21,8 +21,8 @@ const Detail = () => {
const { faqs } = useSelector(state => state.faqs); const { faqs } = useSelector(state => state.faqs);
useEffect(() => { useEffect(() => {
// console.log("router", activityById.data.attributes.category?.data?.attributes.name); // console.log("router", activityById.data.attributes.category?.data?.attributes.name);
dispatch(getActivitiesByFilters({ category: activityById?.data.attributes.category?.data?.id, currentPage: router.query.page })); dispatch(getActivitiesByFilters({ category: activityById?.data.attributes.category?.data?.id }));
}, [activityById, router]); }, [activityById]);
// console.log("faqs=>", faqs); // console.log("faqs=>", faqs);
console.log("activityById", activityById); console.log("activityById", activityById);
......
import { Empty } from "antd"; import { Empty } from "antd";
import Image from "next/image"; import Image from "next/image";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React, { useState } from "react"; import React, { useEffect, useState } from "react";
import { Button } from "react-bootstrap"; import { Button } from "react-bootstrap";
import { Loader } from "react-bootstrap-typeahead"; import { Loader } from "react-bootstrap-typeahead";
import { useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { cleanImage } from "../../services/imageHandling"; import { cleanImage } from "../../services/imageHandling";
import WishlistComponent from "../detail/WIshlistComponent"; import WishlistComponent from "../detail/WIshlistComponent";
import Pagination from "react-js-pagination"; import Pagination from "react-js-pagination";
import { getActivitiesByFilters } from "../../redux/actions/activityAction";
const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) => { const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) => {
// const [gridClass, setGridClass] = useState('col-md-3'); // const [gridClass, setGridClass] = useState('col-md-3');
const { endUser } = useSelector(state => state.endUser); const { endUser } = useSelector(state => state.endUser);
console.log("endUser", endUser);
const router = useRouter(); const router = useRouter();
const dispatch = useDispatch();
useEffect(() => {
dispatch(getActivitiesByFilters({ currentPage: router.query.page }));
}, [router]);
console.log("endUser", endUser);
// console.log("router", router); // console.log("router", router);
let { page = 1, location = "" } = router.query; let { page = 1, location = "" } = router.query;
page = Number(page); page = Number(page);
...@@ -39,6 +44,7 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) => ...@@ -39,6 +44,7 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
}); });
}; };
console.log("page", page); console.log("page", page);
return ( return (
<> <>
{allActivitiesData && !allActivitiesData.data.length == 0 ? ( {allActivitiesData && !allActivitiesData.data.length == 0 ? (
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!