-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
53 lines (50 loc) · 1.45 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
import React, { useState } from "react";
import Container from "react-bootstrap/Container";
import { Row } from "react-bootstrap";
import Cartcounter from "./Components/UI/Cartcounter";
import Navigationbar from "./Components/UI/NavigationBar";
import Logo from "./Components/UI/Logo";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Home from "./Components/Home";
import About from "./Components/About";
import Login from "./Components/Login";
import Dashboard from "./Components/Dashboard";
import Pagenotfound from "./Components/Pagenotfound";
const App = () => {
const [cartCount, setcartCount] = useState(0);
const cartContentCounterHandler = (data) => {
setcartCount(data);
};
return (
<React.Fragment>
<header className="App-header">
<Container className="p-3">
<Row>
<Logo />
<Cartcounter itemCount={cartCount} />
</Row>
</Container>
</header>
<BrowserRouter>
<Navigationbar />
<body>
<Container className="pt-4">
<Routes>
<Route path="about" element={<About />} />
<Route
path="/"
element={
<Home cartContentCounter={cartContentCounterHandler} />
}
/>
<Route path="login" element={<Login />} />
<Route path="dashboard" element={<Dashboard />} />
<Route path="*" element={<Pagenotfound />} />
</Routes>
</Container>
</body>
</BrowserRouter>
</React.Fragment>
);
};
export default App;