diff --git a/src/api/apiEndpoints.js b/src/api/apiEndpoints.js index 632f3e9..bb9ab48 100644 --- a/src/api/apiEndpoints.js +++ b/src/api/apiEndpoints.js @@ -36,7 +36,7 @@ export const API_ENDPOINTS = { EDIT_LIFESTYLE_DETAILS: "get_lifestyle_details", EDIT_PREFERED_PARTNER_DETAILS: "get_preferred_details", - // delete api + // delete api DELETE_ACCOUNT: "delete_account", PHONE_NUMBER_VISIBILITY: "get_phone_number_visibility", @@ -76,7 +76,10 @@ export const API_ENDPOINTS = { SUBSCRIPTION_PLANS: "subscription-plans", SUBSCRIPTION_PURCHASE_RAZORPAY: "subscription-purchase-razorpay", SUBSCRIPTION_HISTORY: "subscription-history", + + //Report and Block profile + REPORT_PROFILE : "report_profile", + BLOCK_PROFILE: "block_profile", }; - - +// https://www.thirukalyanam.amrithaa.net/backend/api/report_profile?profile_id=151&reason=test diff --git a/src/components/matches/MatchesProfilesTab.jsx b/src/components/matches/MatchesProfilesTab.jsx index 96885d5..ec806c0 100644 --- a/src/components/matches/MatchesProfilesTab.jsx +++ b/src/components/matches/MatchesProfilesTab.jsx @@ -35,7 +35,7 @@ export default function MatchesInterface() { const selectedTab = filterType || "all_matches"; const isPaidMember = filters.isPaidMember; -const { ref, inView } = useInView({ + const { ref, inView } = useInView({ threshold: 0, rootMargin: "300px" }); @@ -48,30 +48,30 @@ const { ref, inView } = useInView({ isFetchingNextPage, } = useProfiles(filters); const profiles = - profilesData?.pages.flatMap((page) => page?.data|| []) || []; + profilesData?.pages.flatMap((page) => page?.data || []) || []; // const { ref, inView } = useInView(); -// useEffect(() => { -// if (inView && hasNextPage && !isFetchingNextPage) { -// fetchNextPage(); -// } -// }, [inView, hasNextPage, isFetchingNextPage]); + // useEffect(() => { + // if (inView && hasNextPage && !isFetchingNextPage) { + // fetchNextPage(); + // } + // }, [inView, hasNextPage, isFetchingNextPage]); -useEffect(() => { - if (inView && hasNextPage && !isFetchingNextPage) { + useEffect(() => { + if (inView && hasNextPage && !isFetchingNextPage) { - setShowSkeleton(true); // show skeleton + setShowSkeleton(true); // show skeleton - const timer = setTimeout(() => { - fetchNextPage(); - setShowSkeleton(false); // hide skeleton after API call - }, 120); // 0.5 seconds + const timer = setTimeout(() => { + fetchNextPage(); + setShowSkeleton(false); // hide skeleton after API call + }, 120); // 0.5 seconds - return () => clearTimeout(timer); - } -}, [inView, hasNextPage, isFetchingNextPage, fetchNextPage]); + return () => clearTimeout(timer); + } + }, [inView, hasNextPage, isFetchingNextPage, fetchNextPage]); @@ -84,10 +84,10 @@ useEffect(() => { console.log("Fetched profiles:", profiles); console.log({ - inView, - hasNextPage, - isFetchingNextPage, -}); + inView, + hasNextPage, + isFetchingNextPage, + }); const tabs = [ { id: "all_matches", @@ -159,169 +159,165 @@ useEffect(() => { return ( - <> + <> - {/*
- {tab.description} -
-+ {tab.description} +
+- You've reached the end. -
- )} ++ You've reached the end. +
+ )} +