Browse Source

Anadi el collection users para que collection Threads sea una sub coleccion.

ErnestoOrtiz2 3 years ago
parent
commit
1c4e2848b0
1 changed files with 26 additions and 0 deletions
  1. 26
    0
      screens/main/Home_page.js

+ 26
- 0
screens/main/Home_page.js View File

17
 export function Home_page({navigation}) {
17
 export function Home_page({navigation}) {
18
   const [threads, setThreads] = useState([]);  
18
   const [threads, setThreads] = useState([]);  
19
   const [loading, setLoading] = useState(true);
19
   const [loading, setLoading] = useState(true);
20
+  
21
+  //const [roomName, setRoomName] = useState('');
22
+  //const navigation = useNavigation();
20
 
23
 
21
   useEffect(() => {
24
   useEffect(() => {
22
 
25
 
23
     const fire = firebase.firestore()
26
     const fire = firebase.firestore()
27
+    .collection('Users')
28
+    .doc(firebase.auth().currentUser.uid)
24
     .collection('THREADS')
29
     .collection('THREADS')
25
     
30
     
26
     .onSnapshot(querySnapshot => {
31
     .onSnapshot(querySnapshot => {
47
   if (loading) {
52
   if (loading) {
48
     return <Loading />;
53
     return <Loading />;
49
   }
54
   }
55
+
56
+
57
+  /*function handleButtonPress() {
58
+    if (roomName.length > 0) {
59
+      firebase.firestore()
60
+        .collection('Users')
61
+        .doc(firebase.auth().currentUser.uid)
62
+        .collection('THREADS')
63
+        .add({
64
+          name: roomName
65
+        })
66
+        .then(() => {
67
+          navigation.navigate('allChats');
68
+         });
69
+    }
70
+  }*/
71
+
72
+
73
+
74
+
75
+
50
   
76
   
51
   return (
77
   return (
52
     <View>
78
     <View>