Skip to content

Commit

Permalink
update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lyokoth committed Jan 26, 2024
1 parent 52ee0fa commit ed0b34a
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { React, useState, useEffect} from 'react';
import './App.css';
import Header from './Components/Header/Header';
import ReservationHeader from './Components/Header/ReservationHeader';
import Nav from './Components/Nav/Nav';
import Main from './Components/Main/Main';
//import Footer from './Components/Footer/Footer';
import Specials from './Components/Main/Specials/Specials';
import About from './Components/Main/About/About';
import Footer from './Components/Footer/Footer';
import { headerData, reservationData, orderOnline } from './constants';
import DataContext from './DataContext/DataContext';
import Reservations from './Components/Reservations/Reservations';
import OrderOnline from './Components/OrderOnline/OrderOnline';
import { Routes, Route, useLocation } from 'react-router-dom';
import ComfirmedBooking from './Components/Reservations/ConfirmedBooking/ConfirmedBooking';
import Login from './Components/Login/Login';
import Testimonials from './Components/Main/Testimonials/Testimonials';
// import Login from './Components/Login/Login';
// import {themeProvider, createTheme} from 'chakra-ui/react';


Expand All @@ -24,7 +28,7 @@ function App() {


let data = {};
if (path === "/") {
if (path === "/meta-front-end-capstone") {
data = headerData;
} else if (path === "/reservations") {
data = reservationData;
Expand All @@ -37,29 +41,24 @@ function App() {

<Nav />
<DataContext.Provider value={data}>
<Routes>
<Route path='/' element={
<>
<Header />
<Main />
</>
} />
<Route path="/reservations" element={<Reservations />} />
<Route path='/order-online' element={
<>
<Header />
<OrderOnline />
</>
} />
<Route path='/confirmed-booking' element={<ComfirmedBooking />} />
<Route path='/login' element={<Login />} />
</Routes>
</DataContext.Provider>
{/* <Footer /> */}
{path === "/meta-front-end-capstone" && <Header />}
{path === "/meta-front-end-capstone/reservations" && <ReservationHeader />}
<Routes>
<Route path="/meta-front-end-capstone" element={<Main />} />
<Route path="/meta-front-end-capstone/reservations" element={<Reservations />} />
<Route path="/meta-front-end-capstone/order-online" element={<OrderOnline />} />
<Route path="/meta-front-end-capstone/confirmed-booking" element={<ComfirmedBooking />} />
</Routes>
</DataContext.Provider>

<Specials />
<Testimonials />
<About />

<Footer />
</>

);
}
};

export default App;

0 comments on commit ed0b34a

Please sign in to comment.