-
Notifications
You must be signed in to change notification settings - Fork 0
/
splash.js
77 lines (71 loc) · 1.84 KB
/
splash.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
import 'react-native-gesture-handler';
import React from "react";
import { ImageBackground, StyleSheet, Text, View,Image, Button } from "react-native";
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { DetailsScreen } from './DetailsScreen';
function HomeScreen({ navigation }) {
return (
<View style={styles.container}>
<ImageBackground source={require("./assets/bg.jpg")} style={styles.image}>
<Image
style={styles.inside}
source={require("./assets/logo.png")}
onPress={() => {
return navigation.navigate('Details');
}}
/>
<Button
title="Go to Details"
onPress={() => navigation.navigate('Details')}
/>
</ImageBackground>
</View>
);
}
const Stack = createStackNavigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={HomeScreen}
/>
<Stack.Screen name="Details" component={DetailsScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: "column",
},
image: {
flex: 1,
resizeMode: "contain",
justifyContent: "center",
position: "relative",
alignItems: "center"
},
inside: {
height: "50%",
width: "50%",
justifyContent: "center",
alignItems: "center",
resizeMode: "contain",
marginHorizontal: 40,
top: -100
},
logo: {
height: "50%",
width: "50%",
justifyContent: "center",
alignItems: "center",
resizeMode: "contain",
position: "absolute",
marginHorizontal: 40,
}
});
export default App;