-
Notifications
You must be signed in to change notification settings - Fork 56
Firebase integration #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: thusara
Are you sure you want to change the base?
Firebase integration #301
Conversation
Feature submit new card
| REACT_APP_API_KEY=AIzaSyBoO1cF3m--z1OKJUNaflL5drrTA0aebaE | ||
| REACT_APP_AUTH_DOMIAN=dear-diary-thusara-9535b.firebaseapp.com | ||
| REACT_APP_PROJECT_ID=dear-diary-thusara-9535b | ||
| REACT_APP_STORAGE_BUCKET=dear-diary-thusara-9535b.appspot.com | ||
| REACT_APP_SENDER_ID=458518884342 | ||
| REACT_APP_APP_ID=1:458518884342:web:9b1c0526c179fbf82c21d7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't commit env values
| }; | ||
| dispatch(addCard(newDiaryEntry)); | ||
|
|
||
| const docRef = await addDoc(collection(db, "cards"), newDiaryEntry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't call APIs directly from the UI file, use saga to handle API calls
| dispatch(addCard(newDiaryEntry)); | ||
|
|
||
| const docRef = await addDoc(collection(db, "cards"), newDiaryEntry); | ||
| console.log("Document written with ID: ", docRef.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unwanted logs
| const dispatch = useDispatch(); | ||
|
|
||
| useEffect(() => { | ||
| const unsubscribe = onSnapshot(query(collection(db, 'cards')), (snapShot) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to saga
| // https://firebase.google.com/docs/web/setup#available-libraries | ||
|
|
||
| // Your web app's Firebase configuration | ||
| console.log(process.env.REACT_APP_API_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove logs
shamal-iroshan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix commented things
No description provided.