-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
56 lines (52 loc) · 1.72 KB
/
Copy pathApp.js
File metadata and controls
56 lines (52 loc) · 1.72 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
import React from 'react';
import { StatusBar, StyleSheet } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Home from './pages/Home';
import Apropos from './pages/Apropos';
import WeatherScreen from './pages/WeatherScreen';
import { NativeBaseProvider } from "native-base";
export default function App() {
const Stack = createNativeStackNavigator();
return(
<NativeBaseProvider>
<NavigationContainer>
<Stack.Navigator initialRouteName='Home'>
<Stack.Screen name="Home" component={Home} options={{ headerStyle: {
backgroundColor: '#F39C12'
}, headerTitleAlign: "center", headerTintColor: '#fff' }}/>
<Stack.Screen name="Apropos" component={Apropos} options={{ title: 'A propoos', headerStyle: {
backgroundColor: '#F39C12'
}, headerTitleAlign: "center", headerTintColor: '#fff'}}/>
<Stack.Screen name="WeatherScreen" component={WeatherScreen}
options={({ route }) => ({
title: route.params.item.nom,
headerTitleAlign: "center",
headerStyle: {
backgroundColor: '#F39C12',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
})}/>
</Stack.Navigator>
</NavigationContainer>
</NativeBaseProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: StatusBar.currentHeight || 0,
},
item: {
backgroundColor: '#f9c2ff',
padding: 20,
marginVertical: 8,
marginHorizontal: 16,
},
title: {
fontSize: 32,
},
});