Skip to content

Firebase integration#301

Open
TDimuth wants to merge 3 commits into
fcodelabs:thusarafrom
TDimuth:firebase-integration
Open

Firebase integration#301
TDimuth wants to merge 3 commits into
fcodelabs:thusarafrom
TDimuth:firebase-integration

Conversation

@TDimuth

@TDimuth TDimuth commented Oct 2, 2023

Copy link
Copy Markdown

No description provided.

Comment thread dear-diary/.env
Comment on lines +1 to +6
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

Copy link
Copy Markdown
Contributor

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);

Copy link
Copy Markdown
Contributor

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);

Copy link
Copy Markdown
Contributor

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) => {

Copy link
Copy Markdown
Contributor

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove logs

@shamal-iroshan shamal-iroshan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix commented things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants