From 32eb01b9f4431bd5dc3e187adcdc5f92af9e204e Mon Sep 17 00:00:00 2001 From: Digi Date: Tue, 19 Nov 2024 08:55:00 +0100 Subject: [PATCH] fixed user auth hook bug --- src/App.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index c54c8bc..80740a2 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useRef, useState } from 'react'; import './App.css'; /* @@ -12,7 +12,7 @@ import 'firebase/compat/firestore'; import 'firebase/compat/auth'; -import {useAuthState, useSignInWithGoogle} from 'react-firebase-hooks/auth'; +import {useAuthState} from 'react-firebase-hooks/auth'; import {useCollectionData} from 'react-firebase-hooks/firestore'; firebase.initializeApp({ @@ -28,9 +28,11 @@ firebase.initializeApp({ const auth = firebase.auth(); const firestore =firebase.firestore(); -const [user] = useAuthState(auth); + function App() { + const [user] = useAuthState(auth); + return (
@@ -51,7 +53,10 @@ function SignIn(){ } return( + <> +

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

+ ) } @@ -80,6 +85,8 @@ function ChatRoom(){ function ChatMessage(props){ const {text, uid} = props.message; + const messageClass = uid; + return

{text}

}