-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
49 lines (45 loc) · 1.47 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
import 'react-native-gesture-handler';
import React from 'react';
import { YellowBox, Button, TouchableOpacity } from 'react-native';
YellowBox.ignoreWarnings(['Remote debugger']);
console.ignoredYellowBox = ['Remote debugger'];
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import SearchScreen from './src/screens/SearchScreen';
import ResultsShowScreen from './src/screens/ResultsShowScreen';
import { MaterialIcons } from '@expo/vector-icons';
const Stack = createStackNavigator();
const App = () => {
return (
<NavigationContainer initialRouteName='Search'>
<Stack.Navigator screenOptions={
{
title: 'Photz',
headerTitleAlign: 'center'
}
}
>
<Stack.Screen
name="Search"
component={SearchScreen}
/>
<Stack.Screen
name="ResultsShowScreen"
component={ResultsShowScreen}
options= {({ navigation }) => ({
title: 'Result Details',
headerLeft: () => {
const goBack = () => {
navigation.navigate('Search');
}
return (<TouchableOpacity style={{marginLeft: 15}} onPress={goBack}>
<MaterialIcons style={{paddingRight: 15}} name="arrow-back" size={30} color="black" />
</TouchableOpacity>)
}
})}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;