-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
145 lines (129 loc) · 4.29 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
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
import React from "react";
import { AppRegistry } from "react-native";
import { createStackNavigator, createBottomTabNavigator, createAppContainer, createSwitchNavigator } from "react-navigation";
import Icon from 'react-native-vector-icons/FontAwesome';
import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';
import SettingsScreen from "./Components/Settings/Settings"
//import MainScreen from "./Components/Main/Main"
import MainScreen from "./Components/Main/Homepage"
import TimeTables from "./Components/TimeTables/TimeTables"
import BulletinBoards from "./Components/BulletinBoards/BulletinBoards"
import BulletinBoardsContent from "./Components/BulletinBoards/BulletinBoardsContent"
import BulletinBoardsEditEntry from "./Components/BulletinBoards/BulletinBoardsEditEntry";
import BulletinBoardsLists from "./Components/BulletinBoards/BulletinBoardsLists";
import CourseEvaluation from './Components/Course_Evaluation/CourseEvaluation';
import CalendarScreen from './Components/EventCalendar/EventCalendar'
import ExpandableCalendarScreen from './Components/EventCalendar/ExpandableEventCalendar'
import BulletinBoardsSearch from "./Components/BulletinBoards/BulletinBoardsSearch";
import BulletinBoardsContext from "./Components/BulletinBoards/BulletinBoardsContext";
import { Input } from "react-native-elements";
//창이 만든 거
import AuthScreen from "./Components/Auth/Auth";
import LoginScreen from "./Components/Auth/Login";
import SignUpScreen from "./Components/Auth/Signup";
import NotverifiedScreen from "./Components/Auth/Notverified"
const AuthSwitch = createSwitchNavigator({
Auth: AuthScreen,
Login: LoginScreen,
Signup: SignUpScreen,
Notverified: NotverifiedScreen
},
{
initialRouteName: 'Auth'
});
const MainStack = createStackNavigator({
Main: MainScreen,
});
const SettingsStack = createStackNavigator({
Settings: SettingsScreen,
});
const BulletinBoardsStack = createStackNavigator({
BulletinBoardsLists: BulletinBoardsLists,
BulletinBoards: BulletinBoards,
Post: BulletinBoardsContent,
EntryEdit: BulletinBoardsEditEntry,
Search: BulletinBoardsSearch,
});
const TimeTablesStack = createStackNavigator({
TimeTables: TimeTables,
});
const TabNavigator = createBottomTabNavigator(
{
Main : {
screen : MainStack,
navigationOptions : {
tabBarLabel : 'Main',
tabBarIcon : ({tintColor}) => (<Icon name="home" color={tintColor} size = {20}/>)
}
},
BulletinBoards : {
screen : BulletinBoardsStack,
navigationOptions : {
tabBarLabel : 'Notice',
tabBarIcon : ({tintColor}) => (<Icon name="list" color={tintColor} size = {20}/>)
}
},
CalendarScreen : {
screen : CalendarScreen,
navigationOptions : {
tabBarLabel : 'Calender',
tabBarIcon : ({tintColor}) => (<Icon name="calendar" color={tintColor} size = {20}/>)
}
},
CourseEvaluation : {
screen : CourseEvaluation,
navigationOptions : {
tabBarLabel : 'Rating',
tabBarIcon : ({tintColor}) => (<Icon name="star" color={tintColor} size = {20}/>)
}
},
}
);
const AppSwitchNavigator = createSwitchNavigator({
AuthSwitch: {screen: AuthSwitch},
TabNavigator: {screen: TabNavigator}
},
{
initialRouteName: 'TabNavigator'
})
const AppContainer = createAppContainer(AppSwitchNavigator);
const theme = {
...DefaultTheme,
roundness: 2,
dark: true,
colors: {
...DefaultTheme.colors,
primary: '#3498db',
accent: '#f1c40f',
}
};
export default class App extends React.Component {
constructor(props){
super(props);
this.state = {
BulletinBoards: {
isDev : false,
isReplyEditMode : false,
isReplySubmitted : false,
// 댓글 관련 context
boardid: 0,
entryid: 0,
replyid: 0,
// 댓글 수정 중일 때
currentReplyEditId : '',
currentReplyEditContents: '',
_toggleDevMode : this._toggleDevMode,
_setContextState: (input) => { this.setState({BulletinBoards: {...this.state.BulletinBoards, ...input}})},
},
}
}
render() {
return (
<PaperProvider>
<BulletinBoardsContext.Provider value={this.state}>
<AppContainer />
</BulletinBoardsContext.Provider>
</PaperProvider>
);
}
}