-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
149 lines (135 loc) · 3.47 KB
/
App.js
File metadata and controls
149 lines (135 loc) · 3.47 KB
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
140
141
142
143
144
145
146
147
148
149
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
TouchableOpacity,
Image,
Dimensions
} from 'react-native';
import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
Component,
} from 'react-native/Libraries/NewAppScreen';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const deviceHeight = Dimensions.get('window').height;
const deviceWidth = Dimensions.get('window').width;
const Stack = createNativeStackNavigator();
const App = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen component={Home} name = "Home"/>
<Stack.Screen component={Profile} name = "Profile"/>
</Stack.Navigator>
</NavigationContainer>
);
}
const Home = ({navigation}) => {
return (
<SafeAreaView style={{
flex: 1, justifyContent:'center', alignItems: 'center'
}}>
<View>
<Text style = {{fontWeight:'bold', fontSize:25, color:'black' }}>Profile</Text>
</View>
<View>
<Image source={{uri:'https://images.unsplash.com/photo-1434030216411-0b793f4b4173?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8N3x8c3R1ZGVudHxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=600&q=60'}}
style={{width:300,
height:300,
marginBottom:100,
marginTop:150,
borderRadius:10}}/>
</View>
<TouchableOpacity
onPress={() => navigation.navigate('Profile')}>
<Text style={{
fontWeight:'bold',
fontSize:18,
color:'white',
backgroundColor:'blue',
width:350 ,
padding:20,
borderRadius :10,
justifyContent : 'space-between'
}}>Visit profile</Text>
</TouchableOpacity>
</SafeAreaView>
);
};
const Profile = () => {
return(
<View>
<View style ={styles.upperSection}>
<Image source={{uri:'https://images.unsplash.com/photo-1496016943515-7d33598c11e6?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTJ8fGhhY2tlcnxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=600&q=60'}}
style={styles.img}/>
</View>
<View style={styles.bottomSection}>
<Text style={styles.name}>Teja Ganesh</Text>
<Text style={styles.edu}>B.Tech</Text>
<Text style={styles.des}>I'm a hard-working engineering graduate pursuing information technology in
bachelors of Technology. Currently in react native development course to explore the knowledge in react
native
</Text>
<View>
<TouchableOpacity style={{borderWidth:5, borderRadius:10, padding:20, marginTop: 28,paddingLeft:50,paddingRight:50,
borderColor:'blue'}}>
<Text style={{color:'black'}}>Like</Text>
</TouchableOpacity>
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
upperSection: {
width: deviceWidth,
height: deviceHeight/4,
backgroundColor:'pink'
},
bottomSection: {
width: deviceWidth,
height: 3*(deviceHeight/4),
alignItems: 'center',
},
img: {
width:150,
height:150,
borderRadius: 100,
marginTop: 100,
marginLeft: 120,
},
name: {
marginTop: 70,
fontSize: 25,
color:'black',
},
edu:{
fontSize:20,
color:'black',
},
des: {
marginTop:20,
paddingLeft: 20,
paddingRight:20,
fontSize: 22,
textAlign: 'justify',
}
});
export default App;