App JS prior to merge with navigation

PHOTO EMBED

Mon Mar 22 2021 19:28:38 GMT+0000 (UTC)

Saved by @stephanieraymos

import React, { useEffect } from "react";
import {
  BrowserRouter as Router,
  Switch,
  Route,
  Redirect,
  useLocation 
} from "react-router-dom";
import { AppProvider, useGlobalContext } from "./context";

import Contact from "./Components/Contact";
import Home from "./Components/Home";
import AddInventory from "./Components/AddInventory";
import InventoryAllTrucks from "./Components/InventoryAllTrucks";
import Navigation from "./Components/Navigation";
import Dashboard from "./Components/Dashboard";
import Settings from "./Components/Settings";
import Statements from "./Components/Statements";
import Modal from "./Components/Modal";
import Sidebar from "./Components/Sidebar";
import Signup from "./Components/Signup";
import CustomerDb from "./Components/CustomerDb";
import OrderDetails from "./Components/OrderDetails";
import Orders from "./Components/Orders";
import TruckDetails from "./Components/TruckDetails";
import Error from "./Pages/Error";

const App = () => {
  // const { pathname } = useLocation();

  return (
    <>
      <Modal />
      <Sidebar />

      
      <Router>
      {/* { pathname !== '/Home' && <Navigation /> } */}

            <Navigation />
        <Switch>
            <Route exact path="/">
              <Redirect to="/Home" />
            </Route>
          <Route path="/Home" exact component={Home} />
            <Route path="/Dashboard" exact component={Dashboard} />
            <Route path="/AddInventory" exact component={AddInventory} />
            <Route
              path="/InventoryAllTrucks"
              exact
              component={InventoryAllTrucks}
            />
            <Route path="/Settings" exact component={Settings} />
            <Route path="/Statements" exact component={Statements} />
            <Route path="/Contact" exact component={Contact} />
            <Route path="/Signup" exact component={Signup} />
            <Route path="/CustomerDb" exact component={CustomerDb} />
            <Route path="/OrderDetails" exact component={OrderDetails} />
            <Route path="/Orders" exact component={Orders} />
            <Route path="/TruckDetails/:id" exact component={TruckDetails} />
            <Route path="*" exact component={Error} />
            <Redirect to="/" />
        </Switch>
      </Router>
    </>
  );
};

export default App;
content_copyCOPY