import "./App.css";
import Header from "./Components/Header/Header";
import "bootstrap/dist/css/bootstrap.min.css";
import Footer from "./Components/Footer/Footer";
import React, { useEffect, useState } from "react";
import i18next from "i18next";
import TermsAndConditions from "./Components/TermsAndConditions/TermsAndConditions";
import Home from "./Pages/Home/Home.js";
import { Switch, Route } from "react-router-dom";
import Commingsoon from "./Pages/Commingsoon/Commingsoon";
import NapToken from "./Pages/NapToken/NapToken";
import { useLocation } from "react-router-dom";
//import Blogs from "./Pages/Blogs/Blogs";
export const LangContext = React.createContext(null);
function App() {
  const location = useLocation();
  const [isEnglish, setIsEnglish] = useState(false);

  useEffect(() => {
    i18next.changeLanguage(isEnglish ? "en" : "hun");
  }, [isEnglish]);
  return (
    <LangContext.Provider value={{ isEnglish, setIsEnglish }}>
      <div
        className={location.pathname === "/naptoken" ? "bluebg" : "gradientbg"}
      >
        <Header />

        <Switch>
          <Route exact path="/" component={Home} />
          <Route path="/TermsAndConditions" component={TermsAndConditions} />
          <Route path="/commingsoon" component={Commingsoon} />
          <Route path="/naptoken" component={NapToken} />
          {/* <Route path="/Blogs" component={Blogs} />*/}
        </Switch>

        <Footer />
      </div>

      {/* <Home />
      <TermsAndConditions /> */}
    </LangContext.Provider>
  );
}

export default App;
