forked from utkarsh867/bookbytes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
156 lines (147 loc) · 3.21 KB
/
App.js
File metadata and controls
156 lines (147 loc) · 3.21 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import React from "react";
import { AsyncStorage } from "react-native";
import {
createAppContainer,
createStackNavigator,
createDrawerNavigator,
createSwitchNavigator
} from "react-navigation";
import Login from "./screens/Login";
import Complete from "./screens/Completed";
import Drop from "./screens/Dropped";
import Hold from "./screens/On_hold";
import ToRead from "./screens/ToRead";
import HomeScreen from "./screens/Home";
import Settings from "./screens/Setting";
import Parse from "parse/react-native";
import Comment from "./screens/Comment";
import { Appbar } from "react-native-paper";
import ThreadList from "./screens/ThreadList";
import Thread from "./screens/Thread";
import Book from "./screens/BookView";
import Logout from "./components/Logout";
class NavigationDrawerStructure extends React.Component {
//Structure for the navigatin Drawer
toggleDrawer = () => {
//Props to open/close the drawer
this.props.navigationProps.toggleDrawer();
};
render() {
return (
<Appbar.Header
theme={{
colors: {
primary: "#FFFFFF"
}
}}
>
<Appbar.Action icon="menu" onPress={this.toggleDrawer.bind(this)} />
<Appbar.Content title={this.props.titleText} />
</Appbar.Header>
);
}
}
//Parse config done(based on info from PS folder)
//Import Parse from "parse/react-native" in other js files to "use" it
Parse.initialize(
"5874f2274cbb3dc45fc8743b4361871278e0c4c1",
"",
"6971ed566bb807cd7b7795dd075ea601b4c41e26"
);
Parse.serverURL = "http://18.222.127.61:80/parse";
Parse.setAsyncStorage(AsyncStorage);
const DrawerNavigator = createDrawerNavigator(
{
Home: {
screen: HomeScreen
},
Reading: {
screen: ToRead
},
Completed: {
screen: Complete
},
Dropped: {
screen: Drop
},
Hold: {
screen: Hold
},
Settings: {
screen: Settings
},
Logout: {
screen: Logout
}
},
{
initialRouteName: "Home",
drawerWidth: 300
}
);
const StackNavigator = createStackNavigator({
DrawerNavigator: {
screen: DrawerNavigator,
navigationOptions: ({ navigation }) => ({
title: "Bookbytes",
header: (
<NavigationDrawerStructure
navigationProps={navigation}
titleText="Bookbytes"
/>
)
})
},
Threads: {
screen: ThreadList,
navigationOptions: props => {
return {
title: "Threads"
};
}
},
Comment: {
screen: Comment,
navigationOptions: props => {
return {
title: "Comments"
};
}
},
Thread: {
screen: Thread,
navigationOptions: props => {
return {
title: "Threads"
};
}
},
BookDetails: {
screen: Book,
navigationOptions: props => {
return {
title: "Book Details"
};
}
}
});
const SwitchNavigator = createSwitchNavigator(
{
Login: {
screen: Login,
navigationOptions: () => ({
title: "Login"
})
},
App: StackNavigator
},
{
initialRouteName: "Login"
}
);
const AppContainer = createAppContainer(SwitchNavigator);
export default class App extends React.Component {
render() {
return <AppContainer />;
}
}