Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions src/pages/Signup.jsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
import React, { useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { UserAuth } from '../context/AuthContext';
import React, { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { UserAuth } from "../context/AuthContext";

const Signup = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const { user, signUp } = UserAuth();
const navigate = useNavigate()
const navigate = useNavigate();

const handleSubmit = async (e) => {
e.preventDefault();
try {
await signUp(email, password);
navigate('/')
navigate("/");
} catch (error) {
console.log(error);
}
};

return (
<>
<div className='w-full h-screen'>
<div className="w-full h-screen">
<img
className='hidden sm:block absolute w-full h-full object-cover'
src='https://assets.nflxext.com/ffe/siteui/vlv3/f841d4c7-10e1-40af-bcae-07a3f8dc141a/f6d7434e-d6de-4185-a6d4-c77a2d08737b/US-en-20220502-popsignuptwoweeks-perspective_alpha_website_medium.jpg'
alt='/'
className="hidden sm:block absolute w-full h-full object-cover"
src="https://assets.nflxext.com/ffe/siteui/vlv3/f841d4c7-10e1-40af-bcae-07a3f8dc141a/f6d7434e-d6de-4185-a6d4-c77a2d08737b/US-en-20220502-popsignuptwoweeks-perspective_alpha_website_medium.jpg"
alt="/"
/>
<div className='bg-black/60 fixed top-0 left-0 w-full h-screen'></div>
<div className='fixed w-full px-4 py-24 z-50'>
<div className='max-w-[450px] h-[600px] mx-auto bg-black/75 text-white'>
<div className='max-w-[320px] mx-auto py-16'>
<h1 className='text-3xl font-bold'>Sign Up</h1>
<div className="bg-black/60 fixed top-0 left-0 w-full h-screen"></div>
<div className="fixed w-full px-4 py-24 z-50">
<div className="max-w-[450px] h-[600px] mx-auto bg-black/75 text-white">
<div className="max-w-[320px] mx-auto py-16">
<h1 className="text-3xl font-bold">Sign Up</h1>
<form
onSubmit={handleSubmit}
className='w-full flex flex-col py-4'
className="w-full flex flex-col py-4"
>
<input
onChange={(e) => setEmail(e.target.value)}
className='p-3 my-2 bg-gray-700 rouded'
type='email'
placeholder='Email'
autoComplete='email'
className="p-3 my-2 bg-gray-700 rounded"
type="email"
placeholder="Email"
autoComplete="email"
/>
<input
onChange={(e) => setPassword(e.target.value)}
className='p-3 my-2 bg-gray-700 rouded'
type='password'
placeholder='Password'
autoComplete='current-password'
className="p-3 my-2 bg-gray-700 rounded"
type="password"
placeholder="Password"
autoComplete="current-password"
/>
<button className='bg-red-600 py-3 my-6 rounded font-bold'>
<button className="bg-red-600 py-3 my-6 rounded font-bold">
Sign Up
</button>
<div className='flex justify-between items-center text-sm text-gray-600'>
<div className="flex justify-between items-center text-sm text-gray-600">
<p>
<input className='mr-2' type='checkbox' />
<input className="mr-2" type="checkbox" />
Remember me
</p>
<p>Need Help?</p>
</div>
<p className='py-8'>
<span className='text-gray-600'>
<p className="py-8">
<span className="text-gray-600">
Already subscribed to Netflix?
</span>{' '}
<Link to='/login'>Sign In</Link>
</span>{" "}
<Link to="/login">Sign In</Link>
</p>
</form>
</div>
Expand Down