-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes
18 lines (16 loc) · 1.14 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
installed firebase many places auth funstion are used has been used
install react-firebase-hooks
useNavigate is been used
auth provider which we declared in firebas.ts
singInWithPopup use to login to google
used useAuthState from react-firebase-hooks/auth we have to install it first it does the job by bringing the user's details who have looged in or going to login without the if we used auth.currentUser? it did not refresh or did not show photo after refresh
from firebase/firestore we use adDoc to add doc to database
also imported from the same getFirestore and assigned it to db constajt
collection specifie which collection we want adddoc to
enabled read and wite in database by going to database rules and changed to true
use ctrl and "." to add import
// to get likes we do the same thins as we did to get the posts
// using usestate to present likeamount
// console.log(likedata.docs.map((doc) => ({ ...doc.data(), id: doc.id })));
// modified bove statement to only likedata.docs as we only need length of that data.docs arrayso write data.docs.length
to delete we first have to mend the rules of firebase and edit delete access then we can do it