- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
diff --git a/src/Donations/Micros/DonationAmount.tsx b/src/Donations/Micros/DonationAmount.tsx
index 454837a1..bc999855 100644
--- a/src/Donations/Micros/DonationAmount.tsx
+++ b/src/Donations/Micros/DonationAmount.tsx
@@ -1,6 +1,6 @@
import React, { ReactElement } from "react";
import { QueryParamContext } from "../../Layout/QueryParamContext";
-import getFormatedCurrency from "../../Utils/getFormattedCurrency";
+import getFormattedCurrency from "../../Utils/getFormattedCurrency";
import { getFormattedNumber } from "../../Utils/getFormattedNumber";
import TreeCostLoader from "../../Common/ContentLoaders/TreeCostLoader";
import { useTranslation } from "next-i18next";
@@ -15,7 +15,7 @@ function DonationAmount(): ReactElement {
{paymentSetup && paymentSetup.unitCost ? (
- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
diff --git a/src/Donations/Micros/DonationTypes/BouquetDonations.tsx b/src/Donations/Micros/DonationTypes/BouquetDonations.tsx
index ed3ce57e..2395a69f 100644
--- a/src/Donations/Micros/DonationTypes/BouquetDonations.tsx
+++ b/src/Donations/Micros/DonationTypes/BouquetDonations.tsx
@@ -8,8 +8,8 @@ import React, {
import { useTranslation } from "next-i18next";
import { QueryParamContext } from "../../../Layout/QueryParamContext";
import themeProperties from "../../../../styles/themeProperties";
-import getFormatedCurrency, {
- getFormatedCurrencySymbol,
+import getFormattedCurrency, {
+ getFormattedCurrencySymbol,
} from "../../../Utils/getFormattedCurrency";
import DownArrowIcon from "../../../../public/assets/icons/DownArrowIcon";
import TreeCostLoader from "../../../Common/ContentLoaders/TreeCostLoader";
@@ -160,7 +160,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
{paymentSetup.purpose === "conservation"
? option.quantity
- : getFormatedCurrency(
+ : getFormattedCurrency(
i18n.language,
currency,
option.quantity * paymentSetup.unitCost
@@ -193,7 +193,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
}}
>
{paymentSetup.purpose === "bouquet"
- ? getFormatedCurrencySymbol(currency)
+ ? getFormattedCurrencySymbol(currency)
: []}
)}
{paymentSetup.purpose === "conservation"
- ? getFormatedCurrency(
+ ? getFormattedCurrency(
i18n.language,
"",
Number(paymentSetup.unitCost)
diff --git a/src/Donations/Micros/DonationTypes/FundingDonations.tsx b/src/Donations/Micros/DonationTypes/FundingDonations.tsx
index 062359da..de696880 100644
--- a/src/Donations/Micros/DonationTypes/FundingDonations.tsx
+++ b/src/Donations/Micros/DonationTypes/FundingDonations.tsx
@@ -7,8 +7,8 @@ import React, {
import { useTranslation } from "next-i18next";
import { QueryParamContext } from "../../../Layout/QueryParamContext";
import themeProperties from "../../../../styles/themeProperties";
-import getFormatedCurrency, {
- getFormatedCurrencySymbol,
+import getFormattedCurrency, {
+ getFormattedCurrencySymbol,
} from "../../../Utils/getFormattedCurrency";
import DownArrowIcon from "../../../../public/assets/icons/DownArrowIcon";
import TreeCostLoader from "../../../Common/ContentLoaders/TreeCostLoader";
@@ -164,7 +164,7 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
fontSize: option.caption ? "14px" : "18px",
}}
>
- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
currency,
option.quantity * paymentSetup.unitCost
@@ -195,7 +195,7 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
marginTop: "3px",
}}
>
- {getFormatedCurrencySymbol(currency)}
+ {getFormattedCurrencySymbol(currency)}
{
// Lock the currency/country change if planetCash is active
- !isPlanetCashActive && setopenCurrencyModal(true);
+ if (!isPlanetCashActive) setopenCurrencyModal(true);
}}
className="text-bold text-primary"
style={{
@@ -165,7 +165,7 @@ function TreeDonation({ setopenCurrencyModal }: Props): ReactElement {
{!isPlanetCashActive && (
)}
- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
"",
Number(paymentSetup.unitCost)
diff --git a/src/Donations/Micros/PaymentStatus/ImageComponent.tsx b/src/Donations/Micros/PaymentStatus/ImageComponent.tsx
index 382ca014..42c6e24c 100644
--- a/src/Donations/Micros/PaymentStatus/ImageComponent.tsx
+++ b/src/Donations/Micros/PaymentStatus/ImageComponent.tsx
@@ -1,7 +1,6 @@
import React, { ReactElement, RefObject } from "react";
import { useTranslation } from "next-i18next";
import { getFormattedNumber } from "src/Utils/getFormattedNumber";
-import getFormatedCurrency from "src/Utils/getFormattedCurrency";
import getFormattedCurrency from "src/Utils/getFormattedCurrency";
import { QueryParamContext } from "src/Layout/QueryParamContext";
import { FetchedProjectDetails } from "src/Common/Types";
@@ -24,7 +23,7 @@ const ImageComponent = ({
let currencyFormat = () => {};
if (donation) {
currencyFormat = () =>
- getFormatedCurrency(i18n.language, donation.currency, donation.amount);
+ getFormattedCurrency(i18n.language, donation.currency, donation.amount);
}
const pluralProfileTypes = [
diff --git a/src/Donations/Micros/PaymentStatus/ThankyouMessage.tsx b/src/Donations/Micros/PaymentStatus/ThankyouMessage.tsx
index 300ee601..975ac5fd 100644
--- a/src/Donations/Micros/PaymentStatus/ThankyouMessage.tsx
+++ b/src/Donations/Micros/PaymentStatus/ThankyouMessage.tsx
@@ -1,6 +1,6 @@
import React, { ReactElement } from "react";
import { useTranslation } from "next-i18next";
-import getFormatedCurrency from "src/Utils/getFormattedCurrency";
+import getFormattedCurrency from "src/Utils/getFormattedCurrency";
import { getFormattedNumber } from "src/Utils/getFormattedNumber";
import { QueryParamContext } from "src/Layout/QueryParamContext";
import { FetchedProjectDetails } from "src/Common/Types";
@@ -22,7 +22,7 @@ function ThankyouMessage({
let currencyFormat = () => {};
if (donation) {
currencyFormat = () =>
- getFormatedCurrency(
+ getFormattedCurrency(
i18n.language,
donation.currency,
Number(donation.amount)
diff --git a/src/Donations/Micros/PaymentStatus/TransferDetails.tsx b/src/Donations/Micros/PaymentStatus/TransferDetails.tsx
index 8236578b..f8e44757 100644
--- a/src/Donations/Micros/PaymentStatus/TransferDetails.tsx
+++ b/src/Donations/Micros/PaymentStatus/TransferDetails.tsx
@@ -8,7 +8,7 @@ import ReturnToButton from "./Components/ReturnToButton";
import { Donation } from "@planet-sdk/common/build/types/donation";
import { ReactElement } from "react";
import { TFunction } from "next-i18next";
-import getFormatedCurrency from "src/Utils/getFormattedCurrency";
+import getFormattedCurrency from "src/Utils/getFormattedCurrency";
interface TransferDetailsProps {
donationID: string;
@@ -51,7 +51,7 @@ function TransferDetails({
? t("common:transferDetailsMessage")
: t("common:recurrentTransferDetailsMsg", {
frequency,
- amount: getFormatedCurrency(
+ amount: getFormattedCurrency(
i18n.language,
donation.currency,
donation.amount
diff --git a/src/Donations/Micros/PlanetCashSelector.tsx b/src/Donations/Micros/PlanetCashSelector.tsx
index 15cdeacb..c017f138 100644
--- a/src/Donations/Micros/PlanetCashSelector.tsx
+++ b/src/Donations/Micros/PlanetCashSelector.tsx
@@ -4,7 +4,7 @@ import { FC, useContext, useEffect } from "react";
import ToggleSwitch from "src/Common/InputTypes/ToggleSwitch";
import { QueryParamContext } from "src/Layout/QueryParamContext";
import { getCountryDataBy } from "src/Utils/countryUtils";
-import getFormatedCurrency from "src/Utils/getFormattedCurrency";
+import getFormattedCurrency from "src/Utils/getFormattedCurrency";
// TODO - Sentry captureException;
@@ -144,7 +144,7 @@ const PlanetCashSelector: FC = () => {
: "-negative")
}
>
- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
profile.planetCash.currency,
profile.planetCash.balance / 100
@@ -163,7 +163,7 @@ const PlanetCashSelector: FC = () => {
: "-negative")
}
>
- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
profile.planetCash.currency,
profile.planetCash.creditLimit / 100
@@ -186,7 +186,7 @@ const PlanetCashSelector: FC = () => {
: "-negative")
}
>
- {getFormatedCurrency(
+ {getFormattedCurrency(
i18n.language,
profile.planetCash.currency,
profile.planetCash.balance / 100 +
diff --git a/src/Donations/PaymentMethods/PaymentMethodTabs.tsx b/src/Donations/PaymentMethods/PaymentMethodTabs.tsx
index f60a22fd..84d98796 100644
--- a/src/Donations/PaymentMethods/PaymentMethodTabs.tsx
+++ b/src/Donations/PaymentMethods/PaymentMethodTabs.tsx
@@ -9,7 +9,7 @@ import BankIcon from "../../../public/assets/icons/donation/BankIcon";
import { QueryParamContext } from "../../Layout/QueryParamContext";
import { formatAmountForStripe } from "../../Utils/stripe/stripeHelpers";
import { NativePay } from "./PaymentRequestCustomButton";
-import getFormatedCurrency from "src/Utils/getFormattedCurrency";
+import getFormattedCurrency from "src/Utils/getFormattedCurrency";
import { PaymentMethod } from "@stripe/stripe-js/types/api/payment-methods";
import { PaymentRequest } from "@stripe/stripe-js/types/stripe-js/payment-request";
@@ -104,7 +104,7 @@ export default function PaymentMethodTabs({
break;
case "funds":
paymentLabel = t("fundingPaymentLabel", {
- amount: getFormatedCurrency(
+ amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
@@ -113,7 +113,7 @@ export default function PaymentMethodTabs({
break;
case "planet-cash":
paymentLabel = t("pcashPaymentLabel", {
- amount: getFormatedCurrency(
+ amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
@@ -123,7 +123,7 @@ export default function PaymentMethodTabs({
case "bouquet":
case "conservation":
paymentLabel = t("bouquetPaymentLabel", {
- amount: getFormatedCurrency(
+ amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
diff --git a/src/Utils/getFormattedCurrency.ts b/src/Utils/getFormattedCurrency.ts
index 9ae9dbc3..4d03165d 100644
--- a/src/Utils/getFormattedCurrency.ts
+++ b/src/Utils/getFormattedCurrency.ts
@@ -1,4 +1,4 @@
-export default function getFormatedCurrency(
+export default function getFormattedCurrency(
langCode: string,
currency: string,
number: number
@@ -19,7 +19,7 @@ export default function getFormatedCurrency(
return formatter.format(number);
}
-export function getFormatedCurrencySymbol(
+export function getFormattedCurrencySymbol(
currency: string
): string | undefined {
let options: Intl.NumberFormatOptions = {