forked from plytagalvisx/Bookligo-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
executable file
·102 lines (86 loc) · 3.12 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import React, {Component} from "react";
import {Route} from "react-router-dom";
import HomeView from "./HomeView/HomeView";
import modelInstance from "./data/BookligoModel";
import SearchView from "./SearchView/SearchView";
import DetailsView from "./DetailsView/DetailsView";
import "./App.css";
import BookListView from "./BookListView/BookListView";
import BookCategoryView from "./BookCategoryView/BookCategoryView";
import Error404View from "./Error404View/Error404View";
import Switch from "react-router-dom/Switch";
import Logout from "./Logout/Logout";
import Login from "./Login/Login";
import 'react-notifications/lib/notifications.css';
import { NotificationContainer } from 'react-notifications';
import ProfileView from "./ProfileView/ProfileView";
import Link from "react-router-dom/Link";
import HeaderNavbar from "./Components/HeaderNavbar/HeaderNavbar";
import PurchaseView from "./PurchaseView/PurchaseView";
import PrintoutView from "./PrintoutView/PrintoutView";
class App extends Component {
constructor(props) {
super(props);
this.state = {
title: "Bookligo",
};
}
render() {
return (
<div className="App">
<header className="App-header">
<Link to="/">
<div className="App-title">{this.state.title}</div>
</Link>
</header>
<HeaderNavbar/>
{/* We rendered different components based on the path */}
<Switch>
<Route exact path="/" component={HomeView}/>
<Route
path="/search"
render={() => <SearchView model={modelInstance}/>}
/>
<Route
path="/details/:bookID"
render={() => <DetailsView model={modelInstance}/>}
/>
<Route
path="/bookList"
render={() => <BookListView model={modelInstance}/>}
/>
<Route
path="/bookCategory"
render={() => <BookCategoryView model={modelInstance}/>}
/>
<Route
path="/logout"
render={() => <Logout model={modelInstance}/>}
/>
<Route
path="/login"
render={() => <Login model={modelInstance}/>}
/>
<Route
path="/profile"
render={() => <ProfileView model={modelInstance}/>}
/>
<Route
path="/confirmPurchase"
render={() => <PurchaseView model={modelInstance}/>}
/>
<Route
path="/printout"
render={() => <PrintoutView model={modelInstance}/>}
/>
<Route
exact path="/*"
component={Error404View}
/>
</Switch>
<NotificationContainer />
</div>
);
}
}
export default App;