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

Revert "fix: issue 4539, qf shown in donation success page for estimated matching amount" #4799

Merged
Merged
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
10 changes: 4 additions & 6 deletions lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1350,14 +1350,12 @@
"page.donate.matching_toast.bottom_invalid_p1": "Només donacions de més de",
"page.donate.matching_toast.bottom_invalid_p2": "són elegibles per a l'aparellament.",
"page.donate.matching_toast.bottom_valid": "Els fons de finançament es destinaran al projecte seleccionat després que acabi la ronda. Dona a més projectes per rebre més finançament!",
"page.donate.matching_toast.upper_invalid": "Fes que compti",
"page.donate.matching_toast.upper_valid": "Emparellament estimat",
"page.donate.passport_toast.description.eligible": "Sou elegible per a QF! Sempre que les vostres donacions siguin almenys $",
"page.donate.passport_toast.description.eligible_2": ", són aptes per ser emparellats",
"page.donate.passport_toast.description.non_eligible": "Les donacions superiors a ${usd_value} són aptes per ser igualades amb finançament quadràtic.\nVerifiqueu la vostra elegibilitat de QF abans",
"page.donate.passport_toast.description.eligible": "La teva donació és elegible per ser emparellada! Després del",
"page.donate.passport_toast.description.eligible_2": ", totes les donacions seran revisades per a la protecció contra frau i els fons d'emparellament seran enviats als projectes. Estigues atent a les notificacions :)",
"page.donate.passport_toast.description.non_eligible": "Obtén el teu emparellament de donació amb finançament quadràtic!\nComproveu la vostra elegibilitat QF abans",
"page.donate.passport_toast.description.not_connected": "Obtén el teu emparellament de donació amb finançament quadràtic!\nVerifica el teu Gitcoin Passport abans de",
"page.donate.passport_toast.title.eligible": "Finançament Quadràtic",
"page.donate.passport_toast.title.non_eligible": "No us ho perdeu!",
"page.donate.passport_toast.title.non_eligible": "No et perdis l'emparellament!",
"page.donate.makes_you_eligible_for_givbacks": "${value} et fan elegible per a GIVbacks",
"page.donate.unlocks_matching_funds": "${value} desbloquegen fons coincidents",
"page.donate.project_not_eligible_for_qf": "El projecte no és elegible per a la concordança QF.",
Expand Down
11 changes: 4 additions & 7 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1348,14 +1348,12 @@
"page.donate.matching_toast.bottom_invalid_p1": "Only donations more than",
"page.donate.matching_toast.bottom_invalid_p2": "are eligible for matching.",
"page.donate.matching_toast.bottom_valid": "Matching funds will be sent to the selected project after the round ends. Donate to more projects to receive higher matching!",
"page.donate.matching_toast.upper_invalid": "Make it count",
"page.donate.matching_toast.upper_valid": "Estimated matching",
"page.donate.passport_toast.description.eligible": "You are QF-eligible! As long as your donations are at least $",
"page.donate.passport_toast.description.eligible_2": ", they are eligible to be matched in ",
"page.donate.passport_toast.description.non_eligible": "Donations above ${usd_value} are eligible to be matched with quadratic funding.\nVerify your QF Eligibility before ",
"page.donate.passport_toast.description.eligible": "Your donation is eligible to be matched! After the",
"page.donate.passport_toast.description.eligible_2": ", all donations will be reviewed for fraud protection and matching funds will be sent to the projects. Stay tuned for notifications :)",
"page.donate.passport_toast.description.non_eligible": "Get your donation matched with quadratic funding!\nCheck your QF Eligibility before",
"page.donate.passport_toast.description.not_connected": "Get your donation matched with quadratic funding!\nVerify your Gitcoin Passport before",
"page.donate.passport_toast.title.eligible": "Quadratic Funding",
"page.donate.passport_toast.title.non_eligible": "Don't miss out!",
"page.donate.passport_toast.title.non_eligible": "Dont miss out on matching!",
"page.donate.makes_you_eligible_for_givbacks": "${value} makes you eligible for GIVbacks",
"page.donate.unlocks_matching_funds": "${value} unlocks matching funds",
"page.donate.donations_will_be_matched": "Donation will be matched",
Expand Down Expand Up @@ -1710,7 +1708,6 @@
"projects_technology": "Technology",
"projects_technology_desc": "Support technology projects with a focus on tech, research and desci.",
"public-goods": "Public Goods",
"qf_donor_eligibility.banner.link.back_to_project": "Back to projects",
"qf_donor_eligibility.banner.link.check_eligibility": "Check Eligibility",
"qf_donor_eligibility.banner.link.recheck_eligibility": "Re-check Eligibility",
"real-estate": "Real Estate",
Expand Down
10 changes: 4 additions & 6 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1348,14 +1348,12 @@
"page.donate.matching_toast.bottom_invalid_p1": "Sólo las donaciones superiores a",
"page.donate.matching_toast.bottom_invalid_p2": "son subvencionables.",
"page.donate.matching_toast.bottom_valid": "Los fondos de emparejamiento se enviarán al proyecto seleccionado después de que termine la ronda. ¡Dona a más proyectos para recibir un mayor emparejamiento!",
"page.donate.matching_toast.upper_invalid": "Haz que cuente",
"page.donate.matching_toast.upper_valid": "Estimado del monto complementado",
"page.donate.passport_toast.description.eligible": "¡Eres elegible para QF! Siempre que tus donaciones sean de al menos $",
"page.donate.passport_toast.description.eligible_2": ", son elegibles para ser emparejados en",
"page.donate.passport_toast.description.non_eligible": "Las donaciones superiores a ${usd_value} son elegibles para ser igualadas con fondos cuadráticos.\nVerifique su elegibilidad para QF antes",
"page.donate.passport_toast.description.eligible": "¡Tu donación es elegible para ser complementada! Después de la",
"page.donate.passport_toast.description.eligible_2": ", todas las donaciones serán revisadas para protección contra fraudes y los fondos de complementarios se enviarán a los proyectos. ¡Mantente atento a las notificaciones! :)",
"page.donate.passport_toast.description.non_eligible": "¡Haz que tu donación sea complementada con financiamiento cuadrático!\nCompruebe su elegibilidad QF antes de",
"page.donate.passport_toast.description.not_connected": "¡Haz que tu donación sea complementada con financiamiento cuadrático! Verifica tu Gitcoin Passport antes de",
"page.donate.passport_toast.title.eligible": "Financiamiento Cuadrático",
"page.donate.passport_toast.title.non_eligible": "¡No te lo pierdas!",
"page.donate.passport_toast.title.non_eligible": "¡No te pierdas la oportunidad!",
"page.donate.title": "Donar",
"page.donate.zero_fees": "Sin Comisiones",
"page.donate.makes_you_eligible_for_givbacks": "${value} te hacen elegible para recibir GIVbacks",
Expand Down
1 change: 0 additions & 1 deletion src/apollo/gql/gqlQF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const QF_ROUNDS_QUERY = `
allocatedFundUSDPreferred
allocatedTokenSymbol
minMBDScore
minimumValidUsdValue
}
`;

Expand Down
38 changes: 11 additions & 27 deletions src/components/views/donate/QFToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
FlexCenter,
} from '@giveth/ui-design-system';
import { useIntl } from 'react-intl';
import { useRouter } from 'next/router';
import { EQFElegibilityState, usePassport } from '@/hooks/usePassport';
import PassportModal from '@/components/modals/PassportModal';

Expand All @@ -21,7 +20,6 @@ const QFToast = () => {
const { qfEligibilityState, passportState, passportScore, currentRound } =
info;
const [showModal, setShowModal] = useState<boolean>(false);
const router = useRouter();

const isEligible = qfEligibilityState === EQFElegibilityState.ELIGIBLE;

Expand All @@ -48,25 +46,23 @@ const QFToast = () => {
formatMessage({
id: 'page.donate.passport_toast.description.eligible',
}) +
currentRound?.minimumValidUsdValue +
' ' +
currentRound?.name +
' ' +
formatMessage({
id: 'page.donate.passport_toast.description.eligible_2',
id: 'label.ends_on',
}) +
' ' +
currentRound?.name +
'.';
endDate +
formatMessage({
id: 'page.donate.passport_toast.description.eligible_2',
});
Comment on lines +49 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using template literals for improved readability

The current string concatenation could be made more readable and maintainable by using template literals. This would also help to avoid potential spacing issues.

Consider refactoring the description generation as follows:

description = `${formatMessage({
  id: 'page.donate.passport_toast.description.eligible',
})} ${currentRound?.name} ${formatMessage({
  id: 'label.ends_on',
})} ${endDate}${formatMessage({
  id: 'page.donate.passport_toast.description.eligible_2',
})}`;

This change would make the code more concise and easier to read while maintaining the same functionality.

} else {
description = (
<>
{formatMessage(
{
id: 'page.donate.passport_toast.description.non_eligible',
},
{
usd_value: currentRound?.minimumValidUsdValue,
},
)}{' '}
{formatMessage({
id: 'page.donate.passport_toast.description.non_eligible',
})}{' '}
<span>{endDate}</span>
</>
);
Expand All @@ -79,19 +75,7 @@ const QFToast = () => {
{title}
</Title>
<Description>{description}</Description>
{isEligible ? (
<FlexCenter>
<Button
label={formatMessage({
id: 'qf_donor_eligibility.banner.link.back_to_project',
})}
buttonType='primary'
size='small'
icon={<IconExternalLink16 />}
onClick={() => router.push('/qf')}
/>
</FlexCenter>
) : (
{!isEligible && (
<FlexCenter>
<Button
label={formatMessage({
Expand Down
Loading