Skip to content

Commit

Permalink
fix: issue 4539, qf shown in donation success page for donations abov…
Browse files Browse the repository at this point in the history
…eor below estimated matching amount
  • Loading branch information
HrithikSampson committed Sep 25, 2024
1 parent afa3732 commit 241dbb1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1341,10 +1341,10 @@
"page.donate.matching_toast.upper_valid": "Emparellament estimat",
"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.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.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 et perdis l'emparellament!",
"page.donate.passport_toast.title.non_eligible": "No us ho perdeu!",
"page.donate.title": "Donar",
"page.donate.zero_fees": "Sense Comissions",
"page.engage.discord.desc": "Uneix-te a la conversa! Discord és on el nostre equip es comunica. Presenta't, dóna'ns comentaris, descobreix com contribuir o simplement saluda!",
Expand Down
9 changes: 5 additions & 4 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1339,12 +1339,12 @@
"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": "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.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.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": "Dont miss out on matching!",
"page.donate.passport_toast.title.non_eligible": "Don't miss out!",
"page.donate.title": "Donate",
"page.donate.zero_fees": "Zero Fees",
"page.engage.discord.desc": "Join the conversation! Discord is where our team communicates. Introduce yourself, give us feedback, find out how to contribute or just say hello!",
Expand Down Expand Up @@ -1692,6 +1692,7 @@
"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
8 changes: 4 additions & 4 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1339,12 +1339,12 @@
"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": "¡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.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.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 pierdas la oportunidad!",
"page.donate.passport_toast.title.non_eligible": "¡No te lo pierdas!",
"page.donate.title": "Donar",
"page.donate.zero_fees": "Sin Comisiones",
"page.engage.discord.desc": "¡Únete a la conversación! Nuestro equipo se comunica en Discord. Preséntate, danos retroalimentación, descubre cómo contribuir o ¡sólo saluda!",
Expand Down
1 change: 1 addition & 0 deletions src/apollo/gql/gqlQF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const QF_ROUNDS_QUERY = `
allocatedFundUSDPreferred
allocatedTokenSymbol
minMBDScore
minimumValidUsdValue
}
`;

Expand Down
29 changes: 21 additions & 8 deletions src/components/views/donate/QFToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { useIntl } from 'react-intl';
import { EQFElegibilityState, usePassport } from '@/hooks/usePassport';
import PassportModal from '@/components/modals/PassportModal';
import { useRouter } from 'next/router';

Check failure on line 15 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

`next/router` import should occur before import of `@/hooks/usePassport`

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

const isEligible = qfEligibilityState === EQFElegibilityState.ELIGIBLE;

Expand All @@ -46,22 +48,21 @@ const QFToast = () => {
formatMessage({
id: 'page.donate.passport_toast.description.eligible',
}) +
' ' +
currentRound?.name +
currentRound?.minimumValidUsdValue +
' ' +
formatMessage({
id: 'label.ends_on',
id: 'page.donate.passport_toast.description.eligible_2',
}) +
' ' +
endDate +
formatMessage({
id: 'page.donate.passport_toast.description.eligible_2',
});
currentRound?.name +
'.'

Check failure on line 58 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Insert `;`
} else {
description = (
<>
{formatMessage({

Check failure on line 62 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Insert `⏎↹↹↹↹↹`
id: 'page.donate.passport_toast.description.non_eligible',

Check failure on line 63 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Insert `↹`
},{

Check failure on line 64 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `},` with `↹},⏎↹↹↹↹↹`
usd_value: currentRound?.minimumValidUsdValue,

Check failure on line 65 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Insert `↹`
})}{' '}

Check failure on line 66 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `}` with `↹},⏎↹↹↹↹`
<span>{endDate}</span>
</>
Expand All @@ -75,7 +76,19 @@ const QFToast = () => {
{title}
</Title>
<Description>{description}</Description>
{!isEligible && (
{isEligible ? (
<FlexCenter>
<Button
label={formatMessage({
id: 'qf_donor_eligibility.banner.link.back_to_project',
})}
buttonType='primary'
size='small'
icon={<IconExternalLink16 />}
onClick={() => router.push("/qf")}

Check failure on line 88 in src/components/views/donate/QFToast.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `"/qf"` with `'/qf'`
/>
</FlexCenter>
) : (
<FlexCenter>
<Button
label={formatMessage({
Expand Down

0 comments on commit 241dbb1

Please sign in to comment.