-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
69 lines (58 loc) · 1.87 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//import logo from './logo.svg';
import { createBrowserRouter, createRoutesFromElements,Route,RouterProvider,Link } from 'react-router-dom';
import React from "react";
import './App.css';
import Home from "./components/Home/Home.jsx"
//<link rel="stylesheet" href="bootstrap.scss"/>
//import CartCard from "./components/Cart/dishCard";
//import ItemCard from "./components/Menu/ItemCard";
import Navbar from './components/Navbar/Navbar.jsx';
// import HorizontalNavBar from "./components/Navbar/navnav";
import LoginForm from './components/Login/Login';
import CustomItemContext from "./components/Contexts/ItemContext";
import RegisterForm from "./components/Register/register";
function App() {
const routes=createRoutesFromElements([
{ path:"/",
element:<Navbar/>,
children:[
{index:true, element:<Home/>},
{path:"/login", element: <LoginForm/>},
{path:"/register", element: <RegisterForm/>},
// {path:"/menu", element: <Menu/>},
],
}
]);
const [currentPage, setCurrentPage] = useState('home');
// const renderContent = () => {
// switch (currentPage) {
// case 'home':
// return <div>Home Page Content</div>;
// case 'about':
// return <div>About Page Content</div>;
// case 'services':
// return <div>Services Page Content</div>;
// case 'contact':
// return <div>Contact Page Content</div>;
// default:
// return <div>Select a Page</div>;
// }
// };
return(
<>
<CustomItemContext>
<RouterProvider router={routes}/>
</CustomItemContext>
{/* <div className="app-container">
<HorizontalNavBar onNavigate={setCurrentPage} />
<div className="main-content">
{renderContent()}
</div>
</div>
{/* <div>
< />
</div> */}
</>
);
}
export default App;