Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove estimated matching from staging #4991

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/apollo/gql/gqlDonations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export const FETCH_QF_ROUND_HISTORY = gql`
projectDonationsSqrtRootSum
allProjectsSum
matchingPool
matching
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/apollo/gql/gqlProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export const PROJECT_CORE_FIELDS = gql`
allocatedTokenSymbol
allocatedFundUSDPreferred
allocatedFundUSD
qfStrategy
clusterMatchingSyncAt
}
}
`;
Expand Down Expand Up @@ -53,7 +51,6 @@ export const PROJECT_CARD_FIELDS = gql`
projectDonationsSqrtRootSum
allProjectsSum
matchingPool
matching
}
anchorContracts {
address
Expand Down Expand Up @@ -183,7 +180,6 @@ export const FETCH_PROJECT_BY_SLUG_DONATION = gql`
projectDonationsSqrtRootSum
allProjectsSum
matchingPool
matching
}
qfRounds {
id
Expand All @@ -197,8 +193,6 @@ export const FETCH_PROJECT_BY_SLUG_DONATION = gql`
allocatedFundUSDPreferred
allocatedFundUSD
minimumValidUsdValue
qfStrategy
clusterMatchingSyncAt
}
anchorContracts {
address
Expand Down Expand Up @@ -282,7 +276,6 @@ export const FETCH_PROJECT_BY_SLUG_SINGLE_PROJECT = gql`
projectDonationsSqrtRootSum
allProjectsSum
matchingPool
matching
}
qfRounds {
id
Expand All @@ -295,8 +288,6 @@ export const FETCH_PROJECT_BY_SLUG_SINGLE_PROJECT = gql`
allocatedTokenSymbol
allocatedFundUSDPreferred
allocatedFundUSD
qfStrategy
clusterMatchingSyncAt
}
campaigns {
id
Expand Down
7 changes: 0 additions & 7 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,8 +510,6 @@ export interface IQFRound {
allocatedTokenChainId: number;
minimumValidUsdValue?: number;
minMBDScore: number;
qfStrategy: QfStrategyEnum;
clusterMatchingSyncAt: string;
}

export interface IArchivedQFRound extends IQFRound {
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/HarvestAll.sc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const HarvestAllPending = styled(Pending)`

export const TooltipContent = styled(Subline)`
${mediaQueries.tablet} {
width: 250px;
width: 200px;
text-align: left;
}
`;
Expand Down
41 changes: 0 additions & 41 deletions src/components/project-card/ProjectCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect, useState } from 'react';
import styled from 'styled-components';
import Image from 'next/image';
import {
P,
H6,
Expand Down Expand Up @@ -37,7 +36,6 @@ import { TooltipContent } from '@/components/modals/HarvestAll.sc';
import { IconWithTooltip } from '@/components/IconWithToolTip';
import { FETCH_RECURRING_DONATIONS_BY_DATE } from '@/apollo/gql/gqlProjects';
import { client } from '@/apollo/apolloClient';
import { calculateQFTimeDifferences } from '@/helpers/time';

const cardRadius = '12px';
const imgHeight = '226px';
Expand Down Expand Up @@ -107,14 +105,8 @@ const ProjectCard = (props: IProjectCard) => {
allocatedFundUSDPreferred,
allocatedFundUSD,
allocatedTokenSymbol,
qfStrategy,
clusterMatchingSyncAt,
} = activeQFRound || {};

const clusterMatchingSyncAtDiff = calculateQFTimeDifferences(
clusterMatchingSyncAt || '',
);

const projectLink = slugToProjectView(slug);
const donateLink = slugToProjectDonate(slug);

Expand Down Expand Up @@ -312,8 +304,6 @@ const ProjectCard = (props: IProjectCard) => {
? allocatedFundUSD
: matchingPool,
activeStartedRound?.maximumReward,
matching,
qfStrategy,
),
allocatedFundUSDPreferred ? '$' : '',
locale,
Expand All @@ -337,24 +327,6 @@ const ProjectCard = (props: IProjectCard) => {
{formatMessage({
id: 'component.qf-section.tooltip_polygon',
})}
<ToolTipBellow>
<Image
src={
'/images/icons/clock.svg'
}
alt='score'
width={16}
height={16}
/>
{formatMessage(
{
id: 'component.qf-section.estimated_time',
},
{
time: clusterMatchingSyncAtDiff,
},
)}
</ToolTipBellow>
</TooltipContent>
</IconWithTooltip>
</EstimatedMatching>
Expand Down Expand Up @@ -618,17 +590,4 @@ const QFBadge = styled(Subline)`
align-items: center;
`;

const ToolTipBellow = styled.div`
display: flex;
align-items: center;
justify-content: flex-start;
border-top: 1px solid #121848;
margin: 7px 0;
padding: 7px 0 0 0;
line-height: 16px;
& img {
margin: 0 6px 0 0;
}
`;

export default ProjectCard;
3 changes: 0 additions & 3 deletions src/components/views/donate/DonatePageProjectDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const DonatePageProjectDescription: FC<
allocatedFundUSDPreferred,
allocatedFundUSD,
allocatedTokenSymbol,
qfStrategy,
} = activeQFRound || {};

return (
Expand Down Expand Up @@ -152,8 +151,6 @@ export const DonatePageProjectDescription: FC<
? allocatedFundUSD
: matchingPool,
activeStartedRound?.maximumReward,
matching,
qfStrategy,
),
allocatedFundUSDPreferred ? '$' : '',
locale,
Expand Down
36 changes: 0 additions & 36 deletions src/components/views/donate/OneTime/EstimatedMatchingToast.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from 'styled-components';
import Image from 'next/image';
import {
B,
Caption,
Expand All @@ -21,7 +20,6 @@ import {
import { IProjectAcceptedToken } from '@/apollo/types/gqlTypes';
import { formatDonation } from '@/helpers/number';
import { truncateToDecimalPlaces } from '@/lib/helpers';
import { calculateQFTimeDifferences } from '@/helpers/time';

interface IEstimatedMatchingToast {
projectData: IProject;
Expand Down Expand Up @@ -52,13 +50,8 @@ const EstimatedMatchingToast: FC<IEstimatedMatchingToast> = ({
allocatedFundUSD,
allocatedTokenSymbol,
maximumReward,
clusterMatchingSyncAt,
} = activeStartedRound || {};

const clusterMatchingSyncAtDiff = calculateQFTimeDifferences(
clusterMatchingSyncAt || '',
);

const decimals = isStellar ? 18 : token?.decimals || 18;
const amountInUsd =
(tokenPrice || 0) *
Expand Down Expand Up @@ -94,22 +87,6 @@ const EstimatedMatchingToast: FC<IEstimatedMatchingToast> = ({
{formatMessage({
id: 'component.qf-section.tooltip_polygon',
})}
<ToolTipBellow>
<Image
src={'/images/icons/clock.svg'}
alt='score'
width={16}
height={16}
/>
{formatMessage(
{
id: 'component.qf-section.estimated_time',
},
{
time: clusterMatchingSyncAtDiff,
},
)}
</ToolTipBellow>
</TooltipContent>
</IconWithTooltip>
</FlexCenter>
Expand All @@ -130,17 +107,4 @@ const Wrapper = styled.div<{ show?: boolean }>`
opacity: ${({ show }) => (show ? 1 : 0)};
`;

const ToolTipBellow = styled.div`
display: flex;
align-items: center;
justify-content: flex-start;
border-top: 1px solid #121848;
margin: 7px 0;
padding: 7px 0 0 0;
line-height: 16px;
& img {
margin: 0 6px 0 0;
}
`;

export default EstimatedMatchingToast;
65 changes: 3 additions & 62 deletions src/components/views/project/projectActionCard/QFSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '@giveth/ui-design-system';
import { useIntl } from 'react-intl';
import styled from 'styled-components';
import Image from 'next/image';
import { type FC } from 'react';
import { useRouter } from 'next/router';
import Link from 'next/link';
Expand All @@ -36,7 +35,6 @@ import { ProjectCardUserName } from '@/components/project-card/ProjectCardUserNa
import { CustomH5 } from '@/components/setProfilePic/SetProfilePic';
import { ORGANIZATION } from '@/lib/constants/organizations';
import { slugToProjectView } from '@/lib/routeCreators';
import { calculateQFTimeDifferences } from '@/helpers/time';

interface IQFSectionProps {
projectData?: IProject;
Expand All @@ -58,32 +56,21 @@ const QFSection: FC<IQFSectionProps> = ({ projectData }) => {
const router = useRouter();
const isOnDonatePage = router.pathname.includes('/donate');

const {
projectDonationsSqrtRootSum,
matchingPool,
allProjectsSum,
matching,
} = estimatedMatching ?? {};
const { projectDonationsSqrtRootSum, matchingPool, allProjectsSum } =
estimatedMatching ?? {};

const { activeStartedRound } = getActiveRound(qfRounds);
const {
allocatedFundUSD,
allocatedTokenSymbol,
allocatedFundUSDPreferred,
clusterMatchingSyncAt,
qfStrategy,
} = activeStartedRound || {};

const totalEstimatedMatching = calculateTotalEstimatedMatching(
projectDonationsSqrtRootSum,
allProjectsSum,
allocatedFundUSDPreferred ? allocatedFundUSD : matchingPool,
activeStartedRound?.maximumReward,
matching,
qfStrategy,
);

const clusterMatchingSyncAtDiff = calculateQFTimeDifferences(
clusterMatchingSyncAt || '',
);

const projectLink = slugToProjectView(slug!);
Expand Down Expand Up @@ -118,22 +105,6 @@ const QFSection: FC<IQFSectionProps> = ({ projectData }) => {
{formatMessage({
id: 'component.qf-section.tooltip_polygon',
})}
<ToolTipBellow>
<Image
src={'/images/icons/clock.svg'}
alt='score'
width={16}
height={16}
/>
{formatMessage(
{
id: 'component.qf-section.estimated_time',
},
{
time: clusterMatchingSyncAtDiff,
},
)}
</ToolTipBellow>
</TooltipContent>
</IconWithTooltip>
</Flex>
Expand Down Expand Up @@ -291,16 +262,6 @@ const QFSection: FC<IQFSectionProps> = ({ projectData }) => {
<LightSubline>|</LightSubline>
<LightSubline>Next update in: 3 min</LightSubline>
</Flex> */}
<LastUpdate>
{formatMessage(
{
id: 'label.last_updated_ago',
},
{
time: clusterMatchingSyncAtDiff,
},
)}
</LastUpdate>
<a
href={links.QF_DOC}
target='_blank'
Expand Down Expand Up @@ -431,23 +392,3 @@ const DefaultEstimatedMatchingContainer = styled.div`
display: none;
}
`;

const ToolTipBellow = styled.div`
display: flex;
align-items: center;
justify-content: flex-start;
border-top: 1px solid #121848;
margin: 7px 0;
padding: 7px 0 0 0;
line-height: 16px;
& img {
margin: 0 6px 0 0;
}
`;

const LastUpdate = styled.div`
font-weight: 400;
font-size: 12px;
line-height: 150%;
color: ${neutralColors.gray[700]};
`;
Loading
Loading