-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
99 lines (99 loc) · 3.25 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
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import ScrnLogin from './ScrnLogin';
import ScrnPost from './ScrnPost';
import ScrnSettings from './ScrnSettings';
import ScrnSignup from './ScrnSignup';
import ScrnSearch from './ScrnSearch';
import {ArrowBackIcon, Heading, IconButton, NativeBaseProvider} from 'native-base';
import ScrnUser from './ScrnUser';
const Stack = createNativeStackNavigator();
export function BackButton(navigation) {
if (navigation.canGoBack()) {
return (
<IconButton
accessibilityHint="Navigates to the previous screen"
accessibilityLabel="Go back"
icon={<ArrowBackIcon />}
onPress={() => navigation.goBack()}
/>
);
}
}
export default function App() {
return (
<NativeBaseProvider>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="post"
component={ScrnPost}
options={({navigation}) => ({
headerLeft: () => BackButton(navigation),
// eslint-disable-next-line prettier/prettier
headerTitle: () => <Heading>
Spacetacular spaceposts
</Heading>
})}
/>
<Stack.Screen
name="login"
component={ScrnLogin}
options={({navigation}) => ({
headerLeft: () => BackButton(navigation),
// eslint-disable-next-line prettier/prettier
headerTitle: () => <Heading>
Spacepossibilities spaceawait!
</Heading>
})}
/>
<Stack.Screen
name="search"
component={ScrnSearch}
options={({navigation}) => ({
headerLeft: () => BackButton(navigation),
// eslint-disable-next-line prettier/prettier
headerTitle: () => <Heading>
Spaceselocate astronauts
</Heading>
})}
/>
<Stack.Screen
name="settings"
component={ScrnSettings}
options={({navigation}) => ({
headerLeft: () => BackButton(navigation),
// eslint-disable-next-line prettier/prettier
headerTitle: () => <Heading>
Spacesettings and spacelog out
</Heading>
})}
/>
<Stack.Screen
name="signup"
component={ScrnSignup}
options={({navigation}) => ({
headerLeft: () => BackButton(navigation),
// eslint-disable-next-line prettier/prettier
headerTitle: () => <Heading>
Your spacejourney spacebegins!
</Heading>
})}
/>
<Stack.Screen
name="user"
component={ScrnUser}
options={({navigation}) => ({
headerLeft: () => BackButton(navigation),
// eslint-disable-next-line prettier/prettier
headerTitle: () => <Heading>
Spaceuser spaceinformation
</Heading>
})}
/>
</Stack.Navigator>
</NavigationContainer>
</NativeBaseProvider>
);
}