Skip to content

Commit

Permalink
fix: formats donation.units in ThankyouMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitb35 committed Nov 20, 2023
1 parent 3976a99 commit f01b7e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Donations/Micros/PaymentStatus/ThankyouMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ReactElement } from "react";
import { useTranslation } from "next-i18next";
import getFormatedCurrency from "src/Utils/getFormattedCurrency";
import { getFormattedNumber } from "src/Utils/getFormattedNumber";
import { QueryParamContext } from "src/Layout/QueryParamContext";
import { FetchedProjectDetails } from "src/Common/Types";
import { Donation } from "@planet-sdk/common/build/types/donation";
Expand Down Expand Up @@ -47,12 +48,13 @@ function ThankyouMessage({
})
: null;

// EXAMPLE: Your 50 trees will be planted by AMU EcoVillage Project, Ethiopia in Ethiopia.
// EXAMPLE: Your donation will be used to restore 1,000 trees by Yucatán Restoration in Mexico.
// EXAMPLE: Your donation will be used to restore 2,000 m² by Saving Sumatra’s Last Refuge in Indonesia.
const donationProjectMessage =
donation.destination && donation.units
? " " +
t("common:restorationDonationUsage", {
units: donation.units,
units: getFormattedNumber(i18n.language, donation.units),
unitType: t(`common:${donation.unitType}`, { count: donation.units }),
projectName: donation.destination.name,
location: t("country:" + donation.destination.country.toLowerCase()),
Expand Down

0 comments on commit f01b7e8

Please sign in to comment.