diff --git a/src/App.jsx b/src/App.jsx index 611f377..b9e82dc 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -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"; diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index e4780e6..e3406f2 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -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(); diff --git a/src/components/sidebar/index.jsx b/src/components/sidebar/index.jsx index 007f8e5..b240e0e 100644 --- a/src/components/sidebar/index.jsx +++ b/src/components/sidebar/index.jsx @@ -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"; diff --git a/src/pages/Checkout.jsx b/src/pages/Checkout.jsx index 8024a25..b0551df 100644 --- a/src/pages/Checkout.jsx +++ b/src/pages/Checkout.jsx @@ -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()) diff --git a/src/constants.js b/src/utils.js similarity index 97% rename from src/constants.js rename to src/utils.js index a7818fe..c1bb897 100644 --- a/src/constants.js +++ b/src/utils.js @@ -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 = [ {