-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
101 lines (93 loc) · 3.06 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
import React from 'react';
import { Dimensions } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import "react-native-gesture-handler";
import Settings from './screens/settings';
import Home from './screens/home';
import landingScreen from './screens/landingScreen';
import { createStackNavigator } from '@react-navigation/stack';
import About from './screens/about'
import Information from './screens/information'
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import OmaScreen from './screens/omaSheet';
const { width, height } = Dimensions.get("window");
// const Tab = createBottomTabNavigator();
const Tab = createMaterialTopTabNavigator();
const stack = createStackNavigator();
export default function App() {
const globalScreenOptions = {
headerStyle: {
// backgroundColor: '#266E73' dunkel-pastelartig
backgroundColor: '#328695' // heller
},
headerTitleStyle: { color: 'white' },
headerTintStyle: 'white',
headerTintColor: 'white'
}
return (
<NavigationContainer>
<stack.Navigator initialRouteName="Home">
<stack.Screen name='Home' component={stackNav} options={{
headerShown: false,
}} />
<stack.Screen name='Settings' component={Settings} options={{headerLeft: () => null, title: () => null}} />
<stack.Screen name='Landing' component={landingScreen} options={{
headerShown: false,
gestureEnabled: false,
}} />
<stack.Screen name='About' component={About} />
<stack.Screen name='OmaScreen' component={OmaScreen} options={{
headerShown: false,
}} />
<stack.Screen name='Information' component={Information} options={{
title: "Mehr Informationen..."
}} />
</stack.Navigator>
</NavigationContainer>
);
}
function getTabMargin() {
if (Platform.OS === "ios") return 15;
else 0;
}
const stackNav = () => {
return (
<Tab.Navigator screenOptions={{
tabBarLabelPosition: "beside-icon",
tabBarLabelStyle: {
fontWeight: "700",
fontSize: 15,
marginBottom: getTabMargin(),
},
tabBarIconStyle: { display: "none" },
activeTintColor: "orange", // relevent für Top Tab Navigator
}}
tabBarPosition="bottom" // relevent für Top Tab Navigator
options={{ headerShown: false }}
>
<Tab.Screen
name='Heute'
component={Home}
initialParams={{ day: "today" }}
options={{
headerShown: false,
}} />
<Tab.Screen
name="Morgen"
component={Home}
initialParams={{ day: "tomorrow" }}
options={{
headerShown: false,
}} />
</Tab.Navigator >
);
};
/*
<stack.Navigator initialRouteName="Home_Today">
<stack.Screen name='Home_Today' component={Home_Today} options={{
headerShown: false,
}} />
<stack.Screen name='Settings' component={Settings} />
</stack.Navigator>
*/