Skip to content

Commit

Permalink
fix: correct typos for getFormattedCurrency / getFormattedCurrencySymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitb35 committed Dec 3, 2024
1 parent 99e0b3b commit 9e8b60b
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/Donations/Components/ContactsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import themeProperties from "../../../styles/themeProperties";
import { ThemeContext } from "../../../styles/themeContext";
import { useAuth0 } from "@auth0/auth0-react";
import { useRouter } from "next/router";
import getFormatedCurrency from "src/Utils/getFormattedCurrency";
import getFormattedCurrency from "src/Utils/getFormattedCurrency";
import { DONATE, PAYMENT } from "src/Utils/donationStepConstants";
import { ContactDetails } from "@planet-sdk/common";
import { AddressCandidate, GeocodeSuggestion } from "src/Common/Types/arcgis";
Expand Down Expand Up @@ -588,7 +588,7 @@ function ContactsForm(): ReactElement {
>
{paymentSetup &&
t("donate_button", {
totalCost: getFormatedCurrency(
totalCost: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand Down
10 changes: 5 additions & 5 deletions src/Donations/Components/DonationsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactElement } from "react";
import { QueryParamContext } from "../../Layout/QueryParamContext";
import GiftForm from "../Micros/GiftForm";
import { useTranslation } from "next-i18next";
import getFormatedCurrency from "../../Utils/getFormattedCurrency";
import getFormattedCurrency from "../../Utils/getFormattedCurrency";
import { getMinimumAmountForCurrency } from "../../Utils/getExchange";
import { formatAmountForStripe } from "../../Utils/stripe/stripeHelpers";
import { NativePay } from "../PaymentMethods/PaymentRequestCustomButton";
Expand Down Expand Up @@ -257,7 +257,7 @@ function DonationsForm(): ReactElement {
break;
case "funds":
paymentLabel = t("fundingPaymentLabel", {
amount: getFormatedCurrency(
amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand All @@ -266,7 +266,7 @@ function DonationsForm(): ReactElement {
break;
case "planet-cash":
paymentLabel = t("pcashPaymentLabel", {
amount: getFormatedCurrency(
amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand All @@ -276,7 +276,7 @@ function DonationsForm(): ReactElement {
case "bouquet":
case "conservation":
paymentLabel = t("bouquetPaymentLabel", {
amount: getFormatedCurrency(
amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand Down Expand Up @@ -466,7 +466,7 @@ function DonationsForm(): ReactElement {
<p className={"text-danger mt-20 text-center"}>
{t("minDonate")}{" "}
<span>
{getFormatedCurrency(i18n.language, currency, minAmt)}
{getFormattedCurrency(i18n.language, currency, minAmt)}
</span>
</p>
) : (
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Components/PaymentsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { apiRequest } from "../../Utils/api";
import PaymentProgress from "../../Common/ContentLoaders/Donations/PaymentProgress";
import { Elements } from "@stripe/react-stripe-js";
import getStripe from "../../Utils/stripe/getStripe";
import getFormatedCurrency from "../../Utils/getFormattedCurrency";
import getFormattedCurrency from "../../Utils/getFormattedCurrency";
import {
createDonationFunction,
payDonationFunction,
Expand Down Expand Up @@ -419,7 +419,7 @@ function PaymentsForm(): ReactElement {
<Elements stripe={stripePromise}>
<CardPayments
donorDetails={contactDetails}
totalCost={getFormatedCurrency(
totalCost={getFormattedCurrency(
i18n.language,
currency,
paymentSetup?.unitCost * quantity
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/LeftPanel/TransactionSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { 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 { PaymentOptions, UnitType } from "src/Common/Types";
import styles from "./LeftPanel.module.scss";
Expand Down Expand Up @@ -68,7 +68,7 @@ const TransactionSummary = ({
<div className={styles["transaction-summary"]}>
{t("donating")}{" "}
<strong>
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/DonationAmount.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -15,7 +15,7 @@ function DonationAmount(): ReactElement {
{paymentSetup && paymentSetup.unitCost ? (
<div className={"w-100 text-center text-bold mt-20"}>
<span className={"text-primary"} style={{ marginRight: "4px" }}>
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand Down
10 changes: 5 additions & 5 deletions src/Donations/Micros/DonationTypes/BouquetDonations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -160,7 +160,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
<span style={{ fontSize: "18px" }}>
{paymentSetup.purpose === "conservation"
? option.quantity
: getFormatedCurrency(
: getFormattedCurrency(
i18n.language,
currency,
option.quantity * paymentSetup.unitCost
Expand Down Expand Up @@ -193,7 +193,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
}}
>
{paymentSetup.purpose === "bouquet"
? getFormatedCurrencySymbol(currency)
? getFormattedCurrencySymbol(currency)
: []}
</p>
<input
Expand Down Expand Up @@ -281,7 +281,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
<DownArrowIcon color={themeProperties.primaryColor} />
)}
{paymentSetup.purpose === "conservation"
? getFormatedCurrency(
? getFormattedCurrency(
i18n.language,
"",
Number(paymentSetup.unitCost)
Expand Down
8 changes: 4 additions & 4 deletions src/Donations/Micros/DonationTypes/FundingDonations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -164,7 +164,7 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
fontSize: option.caption ? "14px" : "18px",
}}
>
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
currency,
option.quantity * paymentSetup.unitCost
Expand Down Expand Up @@ -195,7 +195,7 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
marginTop: "3px",
}}
>
{getFormatedCurrencySymbol(currency)}
{getFormattedCurrencySymbol(currency)}
</p>
<input
className={"funding-custom-tree-input"}
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/DonationTypes/TreeDonation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
import CustomIcon from "../../../../public/assets/icons/CustomIcon";
import { QueryParamContext } from "../../../Layout/QueryParamContext";
import DownArrowIcon from "../../../../public/assets/icons/DownArrowIcon";
import getFormatedCurrency from "../../../Utils/getFormattedCurrency";
import getFormattedCurrency from "../../../Utils/getFormattedCurrency";
import themeProperties from "../../../../styles/themeProperties";
import { useTranslation } from "next-i18next";
import TreeCostLoader from "../../../Common/ContentLoaders/TreeCostLoader";
Expand Down Expand Up @@ -165,7 +165,7 @@ function TreeDonation({ setopenCurrencyModal }: Props): ReactElement {
{!isPlanetCashActive && (
<DownArrowIcon color={themeProperties.primaryColor} />
)}
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
"",
Number(paymentSetup.unitCost)
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/PaymentStatus/ImageComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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 getFormattedCurrency from "src/Utils/getFormattedCurrency";
import { QueryParamContext } from "src/Layout/QueryParamContext";
import { FetchedProjectDetails } from "src/Common/Types";
Expand All @@ -24,7 +24,7 @@ const ImageComponent = ({
let currencyFormat = () => {};
if (donation) {
currencyFormat = () =>
getFormatedCurrency(i18n.language, donation.currency, donation.amount);
getFormattedCurrency(i18n.language, donation.currency, donation.amount);
}

const pluralProfileTypes = [
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/PaymentStatus/ThankyouMessage.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -22,7 +22,7 @@ function ThankyouMessage({
let currencyFormat = () => {};
if (donation) {
currencyFormat = () =>
getFormatedCurrency(
getFormattedCurrency(
i18n.language,
donation.currency,
Number(donation.amount)
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/PaymentStatus/TransferDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,7 +51,7 @@ function TransferDetails({
? t("common:transferDetailsMessage")
: t("common:recurrentTransferDetailsMsg", {
frequency,
amount: getFormatedCurrency(
amount: getFormattedCurrency(
i18n.language,
donation.currency,
donation.amount
Expand Down
8 changes: 4 additions & 4 deletions src/Donations/Micros/PlanetCashSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -144,7 +144,7 @@ const PlanetCashSelector: FC = () => {
: "-negative")
}
>
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
profile.planetCash.currency,
profile.planetCash.balance / 100
Expand All @@ -163,7 +163,7 @@ const PlanetCashSelector: FC = () => {
: "-negative")
}
>
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
profile.planetCash.currency,
profile.planetCash.creditLimit / 100
Expand All @@ -186,7 +186,7 @@ const PlanetCashSelector: FC = () => {
: "-negative")
}
>
{getFormatedCurrency(
{getFormattedCurrency(
i18n.language,
profile.planetCash.currency,
profile.planetCash.balance / 100 +
Expand Down
8 changes: 4 additions & 4 deletions src/Donations/PaymentMethods/PaymentMethodTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -104,7 +104,7 @@ export default function PaymentMethodTabs({
break;
case "funds":
paymentLabel = t("fundingPaymentLabel", {
amount: getFormatedCurrency(
amount: getFormattedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/getFormattedCurrency.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function getFormatedCurrency(
export default function getFormattedCurrency(
langCode: string,
currency: string,
number: number
Expand All @@ -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 = {
Expand Down

0 comments on commit 9e8b60b

Please sign in to comment.