Skip to content

Commit

Permalink
[Removed] comments from Chat
Browse files Browse the repository at this point in the history
  • Loading branch information
ROSSROSALES committed Oct 2, 2023
1 parent 6ceb2c4 commit a197bb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
18 changes: 9 additions & 9 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ logo192.png,1665354843807,3ee59515172ee198f3be375979df15ac5345183e656720a381b887
logo512.png,1665354843808,ee7e2f3fdb8209c4b6fd7bef6ba50d1b9dba30a25bb5c3126df057e1cb6f5331
manifest.json,1665354843808,5c997de1364b8be939319fa9209abd77f2caf7f8844999a9e2e9173f844e7840
robots.txt,1665354843809,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
asset-manifest.json,1696108853764,0ada94c9515048bf98698114c8029cf0c16b890838a2e3bcc422b9a3356437db
index.html,1696108853764,6cbb96170897356f9fde999e811f1d13c6550bd533299bde13ee5fd8aea084c6
static/css/main.9512be23.css,1696108853778,454823e9eca16bfb79098de46859c41e5d5732f8bc689228b3136edf9caf7e51
static/js/787.1583e544.chunk.js,1696108853778,8af2baeb24f579297dedfea57ed17f2c85f6bd0a1fda19f030e80031c0bf3bb0
static/css/main.9512be23.css.map,1696108853778,fdd7538b97cbc7790f7a2cec1d078dbdae21c3f1a2f25099d840185bd4c2dc58
static/js/787.1583e544.chunk.js.map,1696108853778,f81d2b4464179ec15df3380d732b71d987e624b5fc91e23e43c0be1fd21819a7
static/js/main.d9636bb0.js.LICENSE.txt,1696108853778,4f35a1289934fb45d3feae9333f9dbeaa8ec67f3f9f16633535ee89c6a60a3b9
static/js/main.d9636bb0.js,1696108853779,172b59ba42e039a9888d06c88709c6ebaff7a52203caf6d9af8ff9cdbfe98bb1
static/js/main.d9636bb0.js.map,1696108853781,c2aa6bfd2b421e260fb06dd98de0a0f2d172ac5959fd3bebbaa037f564a6c4ed
asset-manifest.json,1696123646555,46bb645675a014ede44b981eafef1a150af89284af830567ee66652f90f73bc2
index.html,1696123646555,2c7fe3c9ea70c158c29ea9cd4dde91f3f8f257d59e4ccca237c2a1e3f418a757
static/css/main.9512be23.css,1696123646569,454823e9eca16bfb79098de46859c41e5d5732f8bc689228b3136edf9caf7e51
static/js/787.1583e544.chunk.js,1696123646569,8af2baeb24f579297dedfea57ed17f2c85f6bd0a1fda19f030e80031c0bf3bb0
static/css/main.9512be23.css.map,1696123646569,fdd7538b97cbc7790f7a2cec1d078dbdae21c3f1a2f25099d840185bd4c2dc58
static/js/787.1583e544.chunk.js.map,1696123646570,f81d2b4464179ec15df3380d732b71d987e624b5fc91e23e43c0be1fd21819a7
static/js/main.fc13ffc6.js.LICENSE.txt,1696123646569,4f35a1289934fb45d3feae9333f9dbeaa8ec67f3f9f16633535ee89c6a60a3b9
static/js/main.fc13ffc6.js,1696123646570,8b0fb2cd2791a4427311e3e0467d997449488c4a5d456530183ee987dbb55054
static/js/main.fc13ffc6.js.map,1696123646572,7b744d6a8f9fb58f1c557ec99732e8a9c2e020d89d1d7496747abf94a6369424
16 changes: 1 addition & 15 deletions src/Components/Chat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import firebase from 'firebase/compat/app';
import 'firebase/compat/firestore';
import { addDoc, collection, getDocs, limit, orderBy, query } from "firebase/firestore";
import { addDoc, collection, limit, orderBy, query } from "firebase/firestore";
import React, { useRef, useState } from 'react';
import { useCollectionData } from 'react-firebase-hooks/firestore';
import { auth, firestore } from "../firebase";
Expand All @@ -20,29 +20,15 @@ function Chat() {
function ChatRoom() {
const dummy = useRef();
const messagesRef = collection(firestore, 'messages');
console.log(messagesRef)
const query1 = query(messagesRef, orderBy('createdAt'), limit(25));
// const q = query(citiesRef, orderBy("name", "desc"), limit(3));
const [messages] = useCollectionData(query1, { idField: 'id' });
//

const querySnapshot = getDocs(query1);
console.log("What is this info after getDocs gotta wait when quota is not exceeded", querySnapshot)

// querySnapshot.forEach((doc) => {
// console.log(doc.id, " => ", doc.data());
//});
console.log("This is QUERY:", query1)
const [formValue, setFormValue] = useState('');

const { uid, photoURL } = auth.currentUser;

const sendMessage = async (e) => {
e.preventDefault();


// OLD await messagesRef.add({
// addDoc(collection(firestore, 'users'), {
await addDoc(messagesRef, {
text: formValue,
createdAt: firebase.firestore.FieldValue.serverTimestamp(),
Expand Down

0 comments on commit a197bb1

Please sign in to comment.