From e6dc66cf54b153b447a0b1048460de5485385fbd Mon Sep 17 00:00:00 2001 From: kkatusic Date: Mon, 27 Jan 2025 14:58:36 +0100 Subject: [PATCH] Revert "adding matching value to project layouts except matching on project single page" This reverts commit f79c543c8f0029e685828a46a52dcd95ed62c100. --- src/apollo/gql/gqlProjects.ts | 3 --- src/apollo/types/types.ts | 6 ------ src/components/project-card/ProjectCard.tsx | 11 ++--------- .../views/donate/DonatePageProjectDescription.tsx | 11 ++--------- .../project/projectDonations/ProjectTotalFundCard.tsx | 8 ++------ src/helpers/qf.ts | 10 +--------- 6 files changed, 7 insertions(+), 42 deletions(-) diff --git a/src/apollo/gql/gqlProjects.ts b/src/apollo/gql/gqlProjects.ts index 5e6008f9de..8ce2e5cd9c 100644 --- a/src/apollo/gql/gqlProjects.ts +++ b/src/apollo/gql/gqlProjects.ts @@ -20,7 +20,6 @@ export const PROJECT_CORE_FIELDS = gql` allocatedTokenSymbol allocatedFundUSDPreferred allocatedFundUSD - qfStrategy } } `; @@ -196,7 +195,6 @@ export const FETCH_PROJECT_BY_SLUG_DONATION = gql` allocatedFundUSDPreferred allocatedFundUSD minimumValidUsdValue - qfStrategy } anchorContracts { address @@ -293,7 +291,6 @@ export const FETCH_PROJECT_BY_SLUG_SINGLE_PROJECT = gql` allocatedTokenSymbol allocatedFundUSDPreferred allocatedFundUSD - qfStrategy } campaigns { id diff --git a/src/apollo/types/types.ts b/src/apollo/types/types.ts index 9736b13dc3..17e036a35e 100644 --- a/src/apollo/types/types.ts +++ b/src/apollo/types/types.ts @@ -489,11 +489,6 @@ export interface IUsersPFPTokens { [key: string]: IGiverPFPToken[]; } -export enum QfStrategyEnum { - Cocm = 'Cocm', - Regular = 'Regular', -} - export interface IQFRound { slug: string; id: string; @@ -515,7 +510,6 @@ export interface IQFRound { allocatedTokenChainId: number; minimumValidUsdValue?: number; minMBDScore: number; - qfStrategy: QfStrategyEnum; } export interface IArchivedQFRound extends IQFRound { diff --git a/src/components/project-card/ProjectCard.tsx b/src/components/project-card/ProjectCard.tsx index 6e3ec3ecf3..cacd19cc4c 100644 --- a/src/components/project-card/ProjectCard.tsx +++ b/src/components/project-card/ProjectCard.tsx @@ -91,12 +91,8 @@ const ProjectCard = (props: IProjectCard) => { const { formatMessage, formatRelativeTime, locale } = useIntl(); const router = useRouter(); - const { - allProjectsSum, - matchingPool, - projectDonationsSqrtRootSum, - matching, - } = estimatedMatching || {}; + const { allProjectsSum, matchingPool, projectDonationsSqrtRootSum } = + estimatedMatching || {}; const { activeStartedRound, activeQFRound } = getActiveRound(qfRounds); const hasFooter = activeStartedRound || verified || isGivbackEligible; @@ -105,7 +101,6 @@ const ProjectCard = (props: IProjectCard) => { allocatedFundUSDPreferred, allocatedFundUSD, allocatedTokenSymbol, - qfStrategy, } = activeQFRound || {}; const projectLink = slugToProjectView(slug); @@ -305,8 +300,6 @@ const ProjectCard = (props: IProjectCard) => { ? allocatedFundUSD : matchingPool, activeStartedRound?.maximumReward, - matching, - qfStrategy, ), allocatedFundUSDPreferred ? '$' : '', locale, diff --git a/src/components/views/donate/DonatePageProjectDescription.tsx b/src/components/views/donate/DonatePageProjectDescription.tsx index 154b159e51..8c4608c138 100644 --- a/src/components/views/donate/DonatePageProjectDescription.tsx +++ b/src/components/views/donate/DonatePageProjectDescription.tsx @@ -49,12 +49,8 @@ export const DonatePageProjectDescription: FC< estimatedMatching, } = projectData || {}; - const { - allProjectsSum, - matchingPool, - projectDonationsSqrtRootSum, - matching, - } = estimatedMatching || {}; + const { allProjectsSum, matchingPool, projectDonationsSqrtRootSum } = + estimatedMatching || {}; const isQRDonation = router.query.chain === ChainType.STELLAR.toLowerCase(); const orgLabel = organization?.label; const isForeignOrg = @@ -76,7 +72,6 @@ export const DonatePageProjectDescription: FC< allocatedFundUSDPreferred, allocatedFundUSD, allocatedTokenSymbol, - qfStrategy, } = activeQFRound || {}; return ( @@ -152,8 +147,6 @@ export const DonatePageProjectDescription: FC< ? allocatedFundUSD : matchingPool, activeStartedRound?.maximumReward, - matching, - qfStrategy, ), allocatedFundUSDPreferred ? '$' : '', locale, diff --git a/src/components/views/project/projectDonations/ProjectTotalFundCard.tsx b/src/components/views/project/projectDonations/ProjectTotalFundCard.tsx index 3eb6c1b371..c4a2eed670 100644 --- a/src/components/views/project/projectDonations/ProjectTotalFundCard.tsx +++ b/src/components/views/project/projectDonations/ProjectTotalFundCard.tsx @@ -35,7 +35,7 @@ interface IProjectTotalFundCardProps { const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => { const [qfRoundHistory, setQfRoundHistory] = useState(); const { projectData, isAdmin } = useProjectContext(); - + console.log('projectData', projectData); const { id, totalDonations, @@ -120,8 +120,6 @@ const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => { allProjectsSum, allocatedFundUSDPreferred ? allocatedFundUSD : matchingPool, selectedQF.maximumReward, - projectData?.estimatedMatching.matching, - selectedQF.qfStrategy, ) : qfRoundHistory ? qfRoundHistory.matchingFund !== null @@ -132,8 +130,6 @@ const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => { qfRoundHistory.estimatedMatching.allProjectsSum, qfRoundHistory.estimatedMatching.matchingPool, selectedQF.maximumReward, - projectData?.estimatedMatching.matching, - selectedQF.qfStrategy, ) : 0 : 0; @@ -222,7 +218,7 @@ const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => { +{' '} {formatDonation( - matchFund || 0, + matchFund, allocatedFundUSDPreferred ? '$' : '', diff --git a/src/helpers/qf.ts b/src/helpers/qf.ts index 4ce5b40ca6..f78af6e05a 100644 --- a/src/helpers/qf.ts +++ b/src/helpers/qf.ts @@ -1,4 +1,4 @@ -import { IQFRound, QfStrategyEnum } from '@/apollo/types/types'; +import { IQFRound } from '@/apollo/types/types'; import { getNowUnixMS } from './time'; // import { formatDonation } from '@/helpers/number'; @@ -32,8 +32,6 @@ export const calculateTotalEstimatedMatching = ( allProjectsSum?: number, matchingPool?: number, matchingCapPercentage?: number, - matching: number = 0, - qfStrategy?: string, ) => { if ( !matchingCapPercentage || @@ -42,12 +40,6 @@ export const calculateTotalEstimatedMatching = ( !allProjectsSum ) return 0; - - // For al new round return "matching" value - if (qfStrategy && qfStrategy === QfStrategyEnum.Cocm) { - return matching; - } - const result = Math.min( (Math.pow(projectDonationsSqrtRootSum, 2) / allProjectsSum) * matchingPool,