-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
49 lines (42 loc) · 1.73 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
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, Touchable, TouchableOpacity, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import IndexScreen from './screens/IndexScreen';
import CreateScreen from './screens/CreateScreen';
import { Provider } from './context/BlogContext';
import ShowScreen from './screens/ShowScreen';
import { AntDesign } from '@expo/vector-icons';
import EditScreen from './screens/EditScreen';
import { EvilIcons } from '@expo/vector-icons';
const Stack = createNativeStackNavigator();
export default function App() {
return (
<Provider>
<NavigationContainer>
<Stack.Navigator screenOptions={{headerTitle: 'Blog Uygulaması'}}>
<Stack.Screen name="Index" component={IndexScreen}
options={({navigation}) => ({
headerRight: () => (
<TouchableOpacity onPress={() =>
navigation.navigate('Create')} >
<AntDesign name="plus" size={24} color="black" />
</TouchableOpacity>
)
})}/>
<Stack.Screen name="Create" component={CreateScreen} />
<Stack.Screen name="Show" component={ShowScreen}
options={({navigation, route}) => ({
headerRight: () => (
<TouchableOpacity onPress={() =>
navigation.navigate('Edit', {id: route.params.id})} >
<EvilIcons name="pencil" size={35} color="black" />
</TouchableOpacity>
)
})}/>
<Stack.Screen name="Edit" component={EditScreen} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
}