-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignupScreen.js
More file actions
46 lines (38 loc) · 1.21 KB
/
SignupScreen.js
File metadata and controls
46 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React, { useRef } from 'react';
import { auth } from "../firebase.js";
import "./SignupScreen.css";
function SignupScreen() {
const emailref = useRef(null);
const passwordref = useRef(null);
const register = (e) => {
e.preventDefault();
auth.createUserWithEmailAndPassword(
emailref.current.value,
passwordref.current.value
)
.then((authUser) => {
console.log(authUser);
})
.catch((error) => {
alert(error.message);
});
};
const signIn = (e) => {
e.preventDefault();
};
return (
<div className='signupScreen'>
<form>
<h1>Sign In</h1>
<input ref = {emailref} placeholder='Email' type='email'/>
<input ref = {passwordref} placeholder='Password' type='password'/>
<button type='submit' onClick={signIn}>Sign In</button>
<h4>
<span className='signupScreen__gray'>New to Netflix? </span>
<span className='signupScreen__link' onClick={register}>Sign up now.</span>
</h4>
</form>
</div>
)
}
export default SignupScreen