forked from SoftverInzenjeringETFSA/SI2016_TIM4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
98 lines (77 loc) · 3.23 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
import React from 'react';
import {
BrowserRouter as Router,
Route,
Link
} from 'react-router-dom';
//import * as ReactBootstrap from 'react-bootstrap';
import { NavbarInstance } from './components/NavbarInstance';
import { AddNews } from './components/news/AddNews';
import { NewsList } from './components/news/NewsList';
import { ComplaintFormInstance } from './components/complaint/ComplaintForm';
import { ComplaintList } from './components/complaint/ComplaintList';
import { Login } from './components/account/Login';
import { CreatingAccount } from './components/account/CreatingAccount';
import { EditingAccount } from './components/account/EditingAccount';
import { AddLocationForm } from './components/location/AddLocationForm';
import { DeleteLocationForm } from './components/location/DeleteLocationForm';
import { AddingWord } from './components/forbiddenWords/AddingWord';
import { WordsList } from './components/forbiddenWords/WordsList';
import { AddPoll } from './components/poll/AddPoll';
import { ActivePolls } from './components/poll/ActivePolls';
import { PollQuestions } from './components/poll/PollQuestions';
import { AnswerPoll } from './components/poll/AnswerPoll';
import { AddContactInformation } from './components/contactInformation/AddContactInformation';
import { ViewContactInformation } from './components/contactInformation/ViewContactInformation';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
auth: {
isAuthenticated: false,
username: "",
role: ""
}
};
this.updateAuth = this.updateAuth.bind(this);
}
updateAuth(authParam) {
this.setState(this.state);
// this.setState(
// auth: {
// isAuthenticated: authParam.isAuthenticated,
// username: authParam.username,
// role: authParam.role
// }
// );
}
render() {
return (
<div>
<Router>
<div>
<NavbarInstance />
<Route exact path="/" component={NewsList} />
<Route path="/login" component={() => (<Login onLoginCheck={this.updateAuth} />)} />
<Route path="/signup" component={CreatingAccount} />
<Route path="/account/edit" component={EditingAccount} />
<Route path="/news/add" component={AddNews} />
<Route path="/location/add" component={AddLocationForm} />
<Route path="/complaint" component={ComplaintFormInstance} />
<Route path="/location/delete" component={DeleteLocationForm} />
<Route path="/forbiddenwords/add" component={AddingWord} />
<Route path="/forbiddenwordsList" component={WordsList} />
<Route path="/complaintList" component={ComplaintList} />
<Route path="/poll/create" component={AddPoll} />
<Route path="/poll/activePolls" component={ActivePolls} />
<Route path="/poll/questions/:id" component={PollQuestions} />
<Route path="/poll/answer/:id" component={AnswerPoll} />
<Route path="/contact/add" component={AddContactInformation} />
<Route path="/contact/view" component={ViewContactInformation} />
</div>
</Router>
</div>
);
}
}
export default App;