|
@@ -17,10 +17,15 @@ import { fetchUser } from '../../redux/actions/index'
|
17
|
17
|
export function Home_page({navigation}) {
|
18
|
18
|
const [threads, setThreads] = useState([]);
|
19
|
19
|
const [loading, setLoading] = useState(true);
|
|
20
|
+
|
|
21
|
+ //const [roomName, setRoomName] = useState('');
|
|
22
|
+ //const navigation = useNavigation();
|
20
|
23
|
|
21
|
24
|
useEffect(() => {
|
22
|
25
|
|
23
|
26
|
const fire = firebase.firestore()
|
|
27
|
+ .collection('Users')
|
|
28
|
+ .doc(firebase.auth().currentUser.uid)
|
24
|
29
|
.collection('THREADS')
|
25
|
30
|
|
26
|
31
|
.onSnapshot(querySnapshot => {
|
|
@@ -47,6 +52,27 @@ export function Home_page({navigation}) {
|
47
|
52
|
if (loading) {
|
48
|
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
|
77
|
return (
|
52
|
78
|
<View>
|