Browse Source

Update 'screens/account.js'

dayanlee.deleon 1 year ago
parent
commit
fb37663c6f
1 changed files with 45 additions and 38 deletions
  1. 45
    38
      screens/account.js

+ 45
- 38
screens/account.js View File

@@ -1,11 +1,20 @@
1 1
 import * as React from 'react';
2 2
 import { Alert, View, Linking} from 'react-native';
3 3
 import { Button, Text, TextInput, Divider } from 'react-native-paper';
4
-import { useCallback } from "react";
5
-import { createStackNavigator, createAppContainer } from 'react-navigation';  
4
+import { useState, useCallback } from "react";
5
+import { NavigationContainer } from '@react-navigation/native';
6
+import { createNativeStackNavigator } from '@react-navigation/native-stack';
7
+import createAccount from './createAccount';
8
+import Header from '../shared/header';
9
+
10
+
6 11
 
7 12
 const supportedURL = "https://docs.google.com/forms/d/e/1FAIpQLSe93-cuCFQ084AxVbzhwFJHjtPhrXFJ624ezAcqKU5qUsBqwg/viewform";
8 13
 
14
+const submit = () => {
15
+    console.log("write something")
16
+}
17
+
9 18
 const OpenURLButton = ({ url, children }) => {
10 19
     const handlePress = useCallback(async () => {
11 20
       // Checking if the link is supported for links with custom URL scheme.
@@ -28,53 +37,51 @@ const OpenURLButton = ({ url, children }) => {
28 37
             </Button> ;
29 38
   };
30 39
 
40
+const Stack = createNativeStackNavigator();
31 41
 
32
-const MyComponent = () => {
33
-    const [text, setText] = React.useState("");
34
-    const [text2, setText2] = React.useState("");
35
-
36
-
42
+const ProfileScreen = ({ route }) => {
37 43
   return (
38 44
     <View >
39 45
 
40
-        <Text style={{fontSize:30, fontWeight:"bold",  marginVertical: 20, marginHorizontal: 110}}>
41
-            Crear Cuenta
46
+        <Text style={{fontSize:30, fontWeight:"bold",  marginVertical: 20, marginHorizontal: 30}}>
47
+            Mi Cuenta
42 48
         </Text>
43 49
     
44
-        <TextInput style={{width: 350, marginVertical: 40, marginHorizontal: 30}}
45
-            label="Nombre"
46
-            value={text}
47
-            mode = "outlined"
48
-            outlineColor='#327ABC'
49
-            onChangeText={text => setText(text)}
50
-        />
51
-
52
-        <TextInput style={{width: 350, marginVertical: -20, marginHorizontal: 30}}
53
-            label="Email"
54
-            value={text2}
55
-            mode = "outlined"
56
-            outlineColor='#327ABC'
57
-            onChangeText={text2 => setText2(text2)}
58
-        />
50
+        <Text style={{fontSize:15, fontWeight:"bold",  marginVertical: 20, marginHorizontal: 30}}>
51
+            Nombre: {route.params.userName}
52
+        </Text>
59 53
 
60
-        <Button style={{width: 250, marginVertical: 70, marginHorizontal: 90}}
61
-        buttonColor = "#327ABC"
62
-        mode="contained"
63
-        onPress={console.log(text)}>
64
-            Crear cuenta
65
-        </Button>
66
-        <Divider style={{marginVertical: -20}}
67
-        horizontalInset='true' />
54
+        <Text style={{fontSize:15, fontWeight:"bold",  marginVertical: 20, marginHorizontal: 30}}>
55
+            Email: {route.params.email}
56
+        </Text>
68 57
 
69
-        <Button style={{width: 250, marginVertical: 70, marginHorizontal: 90}}
70
-        buttonColor = "teal"
71
-        mode="contained" >
72
-            Crear cuenta con Google
73
-        </Button>
74
-  
58
+        <Text style={{fontSize:15, fontWeight:"bold",  marginVertical: 20, marginHorizontal: 30}}>
59
+            Telefono: {route.params.phone}
60
+        </Text>
61
+    
62
+        <OpenURLButton 
63
+        url={"https://docs.google.com/forms/d/e/1FAIpQLSe93-cuCFQ084AxVbzhwFJHjtPhrXFJ624ezAcqKU5qUsBqwg/viewform"}>
64
+            Llenar formulario de voluntario
65
+        </OpenURLButton>
75 66
         
76 67
     </View>
77 68
   );
78 69
 };
79 70
 
71
+const MyComponent = () => {
72
+
73
+    return (
74
+      <NavigationContainer independent="true">
75
+        <Stack.Navigator>
76
+        <Stack.Screen name="CreateAccountScreen" component={createAccount}  options={ ({navigation}) => {
77
+          return {
78
+            headerShown:false,
79
+              headerTitle: () => <Header navigation={navigation}/>
80
+          } }}/>
81
+        <Stack.Screen name="Profile" component={ProfileScreen} />
82
+        </Stack.Navigator>
83
+      </NavigationContainer>
84
+  );
85
+  
86
+}
80 87
 export default MyComponent;