-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
139 lines (123 loc) · 3.15 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import * as React from 'react';
import {
StyleSheet,
Button,
View,
Text,
ImageBackground,
Alert,
} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Constants from 'expo-constants';
// You can import from local files
import Navbar from './elements/Navbar';
import Footer from './elements/Footer';
import ButterflyBoy from './components/ButterflyBoy';
import CinderellaShoes from './components/CinderellaShoes';
import FlightlessCanary from './components/FlightlessCanary';
import BluePerennials from './components/BluePerennials';
// or any pure javascript modules available in npm
import { Card } from 'react-native-paper';
const image = {
uri: 'https://i.pinimg.com/474x/7e/cb/29/7ecb29d2fe42cd9adc92e65dbffd5db6.jpg',
};
function HomeScreen({ navigation }) {
return (
<View style={styles.container}>
<Card>
<Navbar />
</Card>
<ImageBackground source={image} resizeMode="cover" style={styles.image}>
<View style={styles.options}>
<Button
title="The Flightless Canary"
color="#ff"
onPress={() => navigation.navigate('The Flightless Canary')}
/>
<Button
title="Butterfly Boy"
color="#ff"
onPress={() => navigation.navigate('Butterfly Boy')}
/>
<Button
title="Cinderella's Red Shoes"
color="#ff"
onPress={() => navigation.navigate("Cinderella's Red Shoes")}
/>
<Button
title="Blue Perennials"
color="#ff"
onPress={() => navigation.navigate('Blue Perennials')}
/>
</View>
</ImageBackground>
<Card style={styles.footer}>
<Footer />
</Card>
</View>
);
}
function CanaryScreen({ navigation }) {
return (
<View>
<FlightlessCanary />
</View>
);
}
function ButterflyScreen({ navigation }) {
return (
<View>
<ButterflyBoy />
</View>
);
}
function CinderellaScreen({ navigation }) {
return (
<View>
<CinderellaShoes />
</View>
);
}
function BlueScreen({ navigation }) {
return (
<View>
<BluePerennials />
</View>
);
}
const Stack = createNativeStackNavigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="The Flightless Canary" component={CanaryScreen} />
<Stack.Screen name="Butterfly Boy" component={ButterflyScreen} />
<Stack.Screen name="Cinderella's Red Shoes" component={CinderellaScreen} />
<Stack.Screen name="Blue Perennials" component={BlueScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
footer: {
position: 'fixed',
bottom: 0,
},
image: {
flex: 1,
justifyContent: 'center',
},
options: {
position: 'absolute',
right: 0,
left: 0,
top: 20,
},
});
export default App;