-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
88 lines (84 loc) · 2.55 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
import { Pressable, StyleSheet, View } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import ManageCourse from "./screens/ManageCourse";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import RecentCourses from "./screens/RecentCourses";
import AllCourses from "./screens/AllCourses";
import { Entypo } from "@expo/vector-icons";
import { AntDesign } from "@expo/vector-icons";
import CoursesContextProvider from "./context/coursesContext";
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function CourseOverview() {
return (
<Tab.Navigator
screenOptions={({ navigation }) => ({
headerStyle: { backgroundColor: "pink" },
headerTintColor: "white",
tabBarStyle: { backgroundColor: "pink" },
tabBarActiveTintColor: "darkblue",
headerRight: () => (
<Pressable
style={({ pressed }) => pressed && styles.pressed}
onPress={() => {
navigation.navigate("ManageCourse");
}}
>
<View style={styles.iconContainer}>
<AntDesign name="plus" size={24} color="white" />
</View>
</Pressable>
),
})}
>
<Tab.Screen
name="RecentCourses"
component={RecentCourses}
options={{
title: "Yakın Zamanda Kaydolunanlar",
tabBarLabel: "Yakın Zamanda",
tabBarIcon: ({ color, size }) => (
<AntDesign name="hourglass" size={size} color={color} />
),
}}
/>
<Tab.Screen
name="AllCourses"
component={AllCourses}
options={{
title: "Tüm Kurslar",
tabBarLabel: "Tüm Kurslar",
tabBarIcon: ({ color, size }) => (
<Entypo name="list" size={size} color={color} />
),
}}
/>
</Tab.Navigator>
);
}
export default function App() {
return (
<CoursesContextProvider>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="CourseOverview"
component={CourseOverview}
options={{ headerShown: false }}
/>
<Stack.Screen name="ManageCourse" component={ManageCourse} />
</Stack.Navigator>
</NavigationContainer>
</CoursesContextProvider>
);
}
const styles = StyleSheet.create({
pressed: {
opacity: 0.5,
},
iconContainer: {
marginHorizontal: 8,
marginVertical: 2,
},
});