mirror of
https://github.com/FranP-code/Pomodoro-Timer-with-Clockify-integration.git
synced 2025-10-12 23:52:30 +00:00
Started the Firebase Integration. Users Register and Login done
This commit is contained in:
31
src/components/Account.jsx
Normal file
31
src/components/Account.jsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import React, {useState} from 'react'
|
||||
import {firebase} from './Firebase/firebase'
|
||||
import {getAuth, onAuthStateChanged} from 'firebase/auth'
|
||||
|
||||
const Account = () => {
|
||||
|
||||
const [signIn, setSignIn] = useState('false')
|
||||
|
||||
const auth = getAuth()
|
||||
|
||||
onAuthStateChanged(auth, (user) => {
|
||||
|
||||
if (user) {
|
||||
setSignIn(true)
|
||||
} else {
|
||||
setSignIn(false)
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
signIn ?
|
||||
<h1>Insert your Clockify API here</h1> :
|
||||
<h1>Sign in before access to this page...</h1>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Account
|
||||
Reference in New Issue
Block a user