|
1 | 1 | // dependencies |
2 | | -import React, { Component } from 'react'; |
3 | | -import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; |
4 | | -import { ToastContainer } from 'react-toastify'; |
| 2 | +import React, { Component } from "react"; |
| 3 | +import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; |
| 4 | +import { ToastContainer } from "react-toastify"; |
5 | 5 |
|
6 | 6 | // components |
7 | | -import Dashboard from './components/Dashboard'; |
8 | | -import Home from './components/Home'; |
9 | | -import Navbar from './components/Navbar'; |
10 | | -import Register from './components/Register'; |
11 | | -import Login from './components/Login'; |
12 | | -import CategoriesList from './components/Category/CategoriesList'; |
13 | | -import PrivateRoute from './components/PrivateRoute'; |
14 | | -import Items from './components/Items'; |
15 | | -import Item from './components/Item'; |
16 | | -import NotFound from './components/NotFound'; |
17 | | -import AddItem from './components/AddItem'; |
18 | | -import UpdateItem from './components/UpdateItem'; |
19 | | -import User from './components/User'; |
| 7 | +import Dashboard from "./components/Dashboard"; |
| 8 | +import Home from "./components/Home"; |
| 9 | +import Navbar from "./components/Navbar"; |
| 10 | +import Register from "./components/Register"; |
| 11 | +import Login from "./components/Login"; |
| 12 | +import CategoriesList from "./components/Category/CategoriesList"; |
| 13 | +import PrivateRoute from "./components/PrivateRoute"; |
| 14 | +import Items from "./components/Items"; |
| 15 | +import Item from "./components/Item"; |
| 16 | +import NotFound from "./components/NotFound"; |
| 17 | +import AddItem from "./components/AddItem"; |
| 18 | +import UpdateItem from "./components/UpdateItem"; |
| 19 | +import User from "./components/User"; |
20 | 20 |
|
21 | 21 | // styles |
22 | | -import './App.scss'; |
23 | | -import 'react-toastify/dist/ReactToastify.min.css'; |
24 | | -import Footer from './components/Footer'; |
| 22 | +import "./App.scss"; |
| 23 | +import "react-toastify/dist/ReactToastify.min.css"; |
| 24 | +import Footer from "./components/Footer"; |
25 | 25 |
|
26 | 26 | class App extends Component { |
27 | 27 | render() { |
28 | 28 | return ( |
29 | 29 | <Router> |
30 | 30 | <Navbar /> |
31 | | - |
32 | | - <Switch> |
33 | | - <Route exact path='/' component={Home} /> |
34 | | - <Route path='/login' component={Login} /> |
35 | | - <Route path='/register' component={Register} /> |
36 | | - <Route |
37 | | - exact |
38 | | - path='/category/:category_id' |
39 | | - component={CategoriesList} |
40 | | - /> |
41 | | - <Route path='/items' component={Items} /> |
42 | | - <PrivateRoute exact path='/profile' component={Dashboard} /> |
43 | | - <PrivateRoute exact path='/profile/add' component={AddItem} /> |
44 | | - <Route exact path='/item/:id' component={Item} /> |
45 | | - <PrivateRoute |
46 | | - exact |
47 | | - path='/profile/update/:id' |
48 | | - component={UpdateItem} |
49 | | - /> |
50 | | - <PrivateRoute exact path='/user/:id' component={User} /> |
51 | | - <Route path='*' component={NotFound} /> |
52 | | - </Switch> |
| 31 | + <div style={{ minHeight: "100vh" }} className=""> |
| 32 | + <Switch> |
| 33 | + <Route exact path="/" component={Home} /> |
| 34 | + <Route path="/login" component={Login} /> |
| 35 | + <Route path="/register" component={Register} /> |
| 36 | + <Route |
| 37 | + exact |
| 38 | + path="/category/:category_id" |
| 39 | + component={CategoriesList} |
| 40 | + /> |
| 41 | + <Route path="/items" component={Items} /> |
| 42 | + <PrivateRoute exact path="/profile" component={Dashboard} /> |
| 43 | + <PrivateRoute exact path="/profile/add" component={AddItem} /> |
| 44 | + <Route exact path="/item/:id" component={Item} /> |
| 45 | + <PrivateRoute |
| 46 | + exact |
| 47 | + path="/profile/update/:id" |
| 48 | + component={UpdateItem} |
| 49 | + /> |
| 50 | + <PrivateRoute exact path="/user/:id" component={User} /> |
| 51 | + <Route path="*" component={NotFound} /> |
| 52 | + </Switch> |
| 53 | + </div> |
53 | 54 |
|
54 | 55 | <Footer /> |
55 | 56 | <ToastContainer |
56 | 57 | autoClose={3000} |
57 | | - position='top-right' |
| 58 | + position="top-right" |
58 | 59 | hideProgressBar={true} |
59 | 60 | /> |
60 | 61 | </Router> |
|
0 commit comments