-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
52 lines (46 loc) · 1.6 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
import React, { Component } from 'react';
import GroupList from './components/Groups/GroupList';
import Nav from './components/Navigation/Nav';
import Filter from './components/UserControl/Filter';
import GroupMaker from './components/UserControl/GroupMaker';
import MiniProfile from './components/UserControl/MiniProfile';
import LoginModal from './components/auth/LoginModal';
import GroupTab from './components/Group/GroupTab'
import Fountain from './components/Fountain/fountain'
import {connect} from 'react-redux';
import './css/reset.css'
import './css/app.css'
class App extends Component {
render() {
/*Maybe I should use react router instead, but since there are only two pages and I don't want to
have different URLs (e.g. /home /app) I have opted for this simple solution. I believe I could
also look into using memory router to avoid having different URLS, but I'll look at that later */
if(!localStorage.getItem('onHome') || this.props.onHome)
{
return (
<div className="App">
<Nav/>
<Fountain/>
</div>
)
}
console.log(this.props);
return (
<div className="App">
<Nav/>
<LoginModal whereFrom={this.props.whereFrom} visible={this.props.loginModalVisible}/>
<div className="topRow">
<GroupMaker/>
<MiniProfile/>
</div>
<GroupList/>
</div>
);
}
}
export const mapStateToProps = state => ({
loginModalVisible: state.misc.loginModalVisible,
whereFrom: state.misc.whereFrom,
onHome: state.misc.onHome
});
export default connect(mapStateToProps)(App);