Skip to content

Commit

Permalink
Merge pull request #5 from optile/PCPAY-2308
Browse files Browse the repository at this point in the history
Changes default languagfe to `en-US` and renames constants to utils
  • Loading branch information
AnwerAR authored Aug 26, 2024
2 parents d2b2d9f + 45a8faf commit 89290aa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHashRouter, RouterProvider } from "react-router-dom";
import { MainContextProvider } from "./contexts/MainContext";
import { currentLang, getCountryDetails } from "./constants";
import { currentLang, getCountryDetails } from "./utils.js";
import Checkout from "./pages/Checkout.jsx";
import Success from "./pages/Success.jsx";
import Cancel from "./pages/Cancel.jsx";
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import payoneerLogo from "../../assets/payoneer-circle.png";
import "./header.scss";
import { useContext, useEffect } from "react";
import MainContext from "../../contexts/MainContext";
import { currentLang, getCountryDetails } from "../../constants";
import { currentLang, getCountryDetails } from "../../utils";

export default function Header() {
const [searchParams, setSearchParams] = useSearchParams();
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext } from "react";
import { products } from "../../constants";
import { products } from "../../utils";
import ProductOverview from "../product-overview";
import "./sidebar.scss";
import MainContext from "../../contexts/MainContext";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Checkout.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Header from "../components/header";
import PaymentMethods from "../components/payment-methods";
import Sidebar from "../components/sidebar";
import { getCountryDetails } from "../constants";
import { getCountryDetails } from "../utils";

export default function Checkout() {
console.log("getCountryDetails", getCountryDetails())
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js → src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const getCountryDetails = (lang = "en") => {
return countryDetails.find(({ language }) => lang === language);
};

export const currentLang = countryDetails.find(({ language }) => language === new URLSearchParams(window.location.search).get("lang"))?.language || "en-GB";
export const currentLang = countryDetails.find(({ language }) => language === new URLSearchParams(window.location.search).get("lang"))?.language || "en-US";

export const products = [
{
Expand Down

0 comments on commit 89290aa

Please sign in to comment.