diff --git a/src/components/Home/ActiveCommunityGrants.tsx b/src/components/Home/ActiveCommunityGrants.tsx index 3137a7975..500b7a08a 100644 --- a/src/components/Home/ActiveCommunityGrants.tsx +++ b/src/components/Home/ActiveCommunityGrants.tsx @@ -1,9 +1,10 @@ -import React from 'react' +import React, { useMemo } from 'react' import classNames from 'classnames' +import { ProposalType } from '../../entities/Proposal/types' import useFormatMessage from '../../hooks/useFormatMessage' -import useGrants from '../../hooks/useProjects' +import useProjects from '../../hooks/useProjects' import locations from '../../utils/locations' import FullWidthButton from '../Common/FullWidthButton' import ProjectCard from '../Projects/ProjectCard/ProjectCard' @@ -12,11 +13,12 @@ import './ActiveCommunityGrants.css' import HomeLoader from './HomeLoader' import HomeSectionHeader from './HomeSectionHeader' -const CURRENT_GRANTS_PER_PAGE = 4 +const GRANTS_TO_SHOW = 4 const ActiveCommunityGrants = () => { const t = useFormatMessage() - const { projects, isLoadingProjects } = useGrants() + const { projects, isLoadingProjects } = useProjects() + const grants = useMemo(() => projects?.data.filter((item) => item.type === ProposalType.Grant), [projects]) return (