-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
93 lines (84 loc) · 3.32 KB
/
App.tsx
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
import React, {useState} from 'react';
import {StyleSheet, Text, View } from 'react-native';
import Login from './Screens/Login';
import Home from './Screens/Home';
import CopingCards from './Screens/CopingCards';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import ViewAssessments from './Screens/ViewAssessments';
import TakeAssessment from './Screens/TakeAssessment';
import ViewAssessmentResults from './Screens/ViewAssessmentResults';
import { ThemeProvider, Button } from 'react-native-elements';
import CBPosts from './Screens/CBPosts'
import CBReplies from './Screens/CBReplies'
import CMPost from './Screens/CMPost'
const Stack = createNativeStackNavigator();
const Drawer = createDrawerNavigator();
const QuizStack = createNativeStackNavigator();
const CommunityStack = createNativeStackNavigator();
import getStyling from './Styling/Styling';
const styles = getStyling();
// https://reactnativeelements.com/docs/customization/#theme
const theme = {
Button: {
// https://reactnativeelements.com/docs/button/#buttonstyle
buttonStyle: styles.button,
// https://reactnativeelements.com/docs/button/#containerstyle
containerStyle: styles.buttonContainer
},
};
export default function App() {
return (
<ThemeProvider theme = {theme}>
<NavigationContainer>
<Stack.Navigator screenOptions={{headerShown: false}}>
<Stack.Screen name="Log In" component={Login}/>
<Stack.Screen name="Home" component={MainNavigator}/>
</Stack.Navigator>
</NavigationContainer>
</ThemeProvider>
);
}
const MainNavigator: React.FC = () => {
return (
<Drawer.Navigator
screenOptions={{
drawerStyle: {
backgroundColor: '#1f2f3f',
},
headerStyle: {
backgroundColor: '#1f2f3f'
},
drawerItemStyle: {
backgroundColor: 'white'
},
drawerType: 'back',
headerTintColor: 'white',
}}
>
<Drawer.Screen name="Home" component={Home} options={{title: 'Home', drawerLabel: 'Home'}} />
<Drawer.Screen name="Coping Cards" component={CopingCards} options={{title: 'Coping Cards', drawerLabel: 'Coping Cards'}} />
<Drawer.Screen name="Quiz" component={QuizNavigator} options={{title: 'Take An Assessment', drawerLabel: 'Take An Assessment'}} />
<Drawer.Screen name="Posts" component={CommunityNavigator} options={{title: 'Community', drawerLabel: 'Community'}} />
</Drawer.Navigator>
)
}
const QuizNavigator: React.FC = () => {
return (
<QuizStack.Navigator screenOptions={{headerShown: false}}>
<QuizStack.Screen name="ViewAssessments" component={ViewAssessments} />
<QuizStack.Screen name="TakeAssessment" component={TakeAssessment} />
<QuizStack.Screen name="ViewAssessmentResuts" component={ViewAssessmentResults} />
</QuizStack.Navigator>
)
}
const CommunityNavigator: React.FC = () => {
return (
<CommunityStack.Navigator screenOptions={{headerShown: false}}>
<CommunityStack.Screen name="Posts" component={CBPosts} />
<CommunityStack.Screen name="Replies" component={CBReplies} />
<CommunityStack.Screen name="Create" component={CMPost} />
</CommunityStack.Navigator>
)
}