Linking Firebase Databse with Signup
This commit is contained in:
parent
1e968638ab
commit
ea64819d91
11
src/App.js
11
src/App.js
|
@ -14,6 +14,7 @@ import { Signup } from "./pages/Signup"
|
|||
|
||||
function App() {
|
||||
const FBapp = initializeApp(FirebaseConfig)
|
||||
const FBauth = getAuth(FBapp)
|
||||
// navigation array
|
||||
const navItems = [
|
||||
{ label: "Home", link: "/" },
|
||||
|
@ -37,6 +38,15 @@ const [nav, setNav ] = useState( navItems )
|
|||
const saySomething = (word) => {
|
||||
alert(word)
|
||||
}
|
||||
|
||||
// signing up a user
|
||||
const signUp = (email, password) => {
|
||||
createUserWithEmailAndPassword(FBauth, email, password)
|
||||
.then((userCredential) => {
|
||||
// do something
|
||||
})
|
||||
.catch((error) => console.log(error.message))
|
||||
}
|
||||
return (
|
||||
<div className="App">
|
||||
<Header items={nav} />
|
||||
|
@ -49,4 +59,5 @@ const [nav, setNav ] = useState( navItems )
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
Loading…
Reference in New Issue