-
Notifications
You must be signed in to change notification settings - Fork 10
/
App.tsx
84 lines (73 loc) · 2.26 KB
/
App.tsx
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
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View , Image, Button} from "react-native";
import Hyperlink from 'react-native-hyperlink'
import { NavigationContainer, StackActions} from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
// import IUserdata from 'profile';
export const HomeScreen = ({navigation}) => {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button
title= "profile page"
onPress= {()=> navigation.navigate('IUserData')}
/>
</View>
);
};
export const IUserData= () => {
const username= "abc";
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Profile Screen</Text>
<Image
source= {{
uri : "#",
}}
/>
<Text>{username}</Text>
<Hyperlink linkText={ url => url === '#'?'Hyperlink':url} >
<Text>facebook -- (Add facebook url later) </Text>
</Hyperlink>
<Hyperlink linkText={ url => url === '#'?'Hyperlink':url} >
<Text>github -- (Add github url later) </Text>
</Hyperlink>
<Hyperlink linkText={ url => url === '#'?'Hyperlink':url} >
<Text>linkedin -- (Add linkedin url later) </Text>
</Hyperlink>
<Text>Enter bio here</Text>
</View>
);
};
type RootStackParamList= {
Home: undefined;
}
const Stack = createStackNavigator();
const RootStack = createStackNavigator<RootStackParamList>();
function App() {
return (
<View style={styles.container}>
<Text>hello there</Text>
<NavigationContainer>
<RootStack.Navigator initialRouteName="Home">
<RootStack.Screen name= "Home" component= {HomeScreen} />
</RootStack.Navigator>
{/* <Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Profile" component={IUserData} />
</Stack.Navigator> */}
</NavigationContainer>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
export default App;