import React, { useRef, useState } from 'react'; import './App.css'; /* import firebase from 'firebase/'; import 'firebase/firestore'; import 'firebase/auth'; */ import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore'; import 'firebase/compat/auth'; import {useAuthState} from 'react-firebase-hooks/auth'; import {useCollectionData} from 'react-firebase-hooks/firestore'; firebase.initializeApp({ apiKey: "AIzaSyDhXnMyDGw3ei7-4M-x1LXcEZvATPx0tbc", authDomain: "yapper-204ab.firebaseapp.com", projectId: "yapper-204ab", storageBucket: "yapper-204ab.firebasestorage.app", messagingSenderId: "31767433105", appId: "1:31767433105:web:b75ea782115bc2fe8a1430", measurementId: "G-ERFF6SL9W6" }); const auth = firebase.auth(); const firestore =firebase.firestore(); function App() { const [user] = useAuthState(auth); return (
{user ? : }
); } function SignIn(){ const signInWithGoogle = () =>{ const provider = new firebase.auth.GoogleAuthProvider(); auth.signInWithPopup(provider); } return( <>

Do not violate the community guidelines or you will be banned for life!

) } function SignOut(){ return auth.currentUser && ( ) } function ChatRoom(){ const messagesRef = firestore.collection('messages'); const query = messagesRef.orderBy('createdAt').limit(25); const [messages] = useCollectionData(query, {idField: 'id'}); /* NOT YET IMPLEMENTED return ( <>
{messages && messages.map(msg => )}
) */ return (
You are logged in
); } function ChatMessage(props){ const {text, uid} = props.message; const messageClass = uid; return

{text}

} export default App;