Skip to content

Commit

Permalink
Revert "adding matching value to project layouts except matching on p…
Browse files Browse the repository at this point in the history
…roject single page"

This reverts commit f79c543.
  • Loading branch information
kkatusic committed Jan 27, 2025
1 parent 6f960ae commit e6dc66c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 42 deletions.
3 changes: 0 additions & 3 deletions src/apollo/gql/gqlProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const PROJECT_CORE_FIELDS = gql`
allocatedTokenSymbol
allocatedFundUSDPreferred
allocatedFundUSD
qfStrategy
}
}
`;
Expand Down Expand Up @@ -196,7 +195,6 @@ export const FETCH_PROJECT_BY_SLUG_DONATION = gql`
allocatedFundUSDPreferred
allocatedFundUSD
minimumValidUsdValue
qfStrategy
}
anchorContracts {
address
Expand Down Expand Up @@ -293,7 +291,6 @@ export const FETCH_PROJECT_BY_SLUG_SINGLE_PROJECT = gql`
allocatedTokenSymbol
allocatedFundUSDPreferred
allocatedFundUSD
qfStrategy
}
campaigns {
id
Expand Down
6 changes: 0 additions & 6 deletions src/apollo/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,6 @@ export interface IUsersPFPTokens {
[key: string]: IGiverPFPToken[];
}

export enum QfStrategyEnum {
Cocm = 'Cocm',
Regular = 'Regular',
}

export interface IQFRound {
slug: string;
id: string;
Expand All @@ -515,7 +510,6 @@ export interface IQFRound {
allocatedTokenChainId: number;
minimumValidUsdValue?: number;
minMBDScore: number;
qfStrategy: QfStrategyEnum;
}

export interface IArchivedQFRound extends IQFRound {
Expand Down
11 changes: 2 additions & 9 deletions src/components/project-card/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -105,7 +101,6 @@ const ProjectCard = (props: IProjectCard) => {
allocatedFundUSDPreferred,
allocatedFundUSD,
allocatedTokenSymbol,
qfStrategy,
} = activeQFRound || {};

const projectLink = slugToProjectView(slug);
Expand Down Expand Up @@ -305,8 +300,6 @@ const ProjectCard = (props: IProjectCard) => {
? allocatedFundUSD
: matchingPool,
activeStartedRound?.maximumReward,
matching,
qfStrategy,
),
allocatedFundUSDPreferred ? '$' : '',
locale,
Expand Down
11 changes: 2 additions & 9 deletions src/components/views/donate/DonatePageProjectDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -76,7 +72,6 @@ export const DonatePageProjectDescription: FC<
allocatedFundUSDPreferred,
allocatedFundUSD,
allocatedTokenSymbol,
qfStrategy,
} = activeQFRound || {};

return (
Expand Down Expand Up @@ -152,8 +147,6 @@ export const DonatePageProjectDescription: FC<
? allocatedFundUSD
: matchingPool,
activeStartedRound?.maximumReward,
matching,
qfStrategy,
),
allocatedFundUSDPreferred ? '$' : '',
locale,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface IProjectTotalFundCardProps {
const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => {
const [qfRoundHistory, setQfRoundHistory] = useState<IGetQfRoundHistory>();
const { projectData, isAdmin } = useProjectContext();

console.log('projectData', projectData);
const {
id,
totalDonations,
Expand Down Expand Up @@ -120,8 +120,6 @@ const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => {
allProjectsSum,
allocatedFundUSDPreferred ? allocatedFundUSD : matchingPool,
selectedQF.maximumReward,
projectData?.estimatedMatching.matching,
selectedQF.qfStrategy,
)
: qfRoundHistory
? qfRoundHistory.matchingFund !== null
Expand All @@ -132,8 +130,6 @@ const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => {
qfRoundHistory.estimatedMatching.allProjectsSum,
qfRoundHistory.estimatedMatching.matchingPool,
selectedQF.maximumReward,
projectData?.estimatedMatching.matching,
selectedQF.qfStrategy,
)
: 0
: 0;
Expand Down Expand Up @@ -222,7 +218,7 @@ const ProjectTotalFundCard = ({ selectedQF }: IProjectTotalFundCardProps) => {
<EstimatedMatchingPrice>
+{' '}
{formatDonation(
matchFund || 0,
matchFund,
allocatedFundUSDPreferred
? '$'
: '',
Expand Down
10 changes: 1 addition & 9 deletions src/helpers/qf.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -32,8 +32,6 @@ export const calculateTotalEstimatedMatching = (
allProjectsSum?: number,
matchingPool?: number,
matchingCapPercentage?: number,
matching: number = 0,
qfStrategy?: string,
) => {
if (
!matchingCapPercentage ||
Expand All @@ -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,
Expand Down

0 comments on commit e6dc66c

Please sign in to comment.