Skip to content

Commit cccba8c

Browse files
Adding Login UI
1 parent caa5fe8 commit cccba8c

File tree

7 files changed

+120
-2
lines changed

7 files changed

+120
-2
lines changed

facebook-login-clone/src/App.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { useState } from 'react'
22
import './App.css'
3+
import { Link } from 'react-router-dom'
4+
import Routes from './Routes'
5+
36

47
function App() {
5-
const [count, setCount] = useState(0)
68

79
return (
810
<>
9-
<h1>Home app page</h1>
11+
<Routes/>
1012
</>
1113
)
1214
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
3+
const Button = () => {
4+
return (
5+
<div>Button</div>
6+
)
7+
}
8+
9+
export default Button
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
const Input = ({ type = 'text', name,email,password,placeholder}) => {
4+
return <input className='flex p-3 mb-3 w-full text-lg border-2 rounded border-gray-300' type={type} name={name} placeholder={placeholder} />
5+
}
6+
7+
export default Input
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React from "react";
2+
import { NavLink } from "react-router-dom";
3+
import { Input, Button } from "./index";
4+
5+
const Login = () => {
6+
return (
7+
<>
8+
<main className="min-h-screen p-3 bg-gray-100 flex flex-col items-center justify-center">
9+
<section className="flex flex-col md:flex-row w-full max-w-6xl gap-10 justify-center items-center">
10+
<article className="md:w-1/2 text-center md:text-left">
11+
<h1 className="text-6xl font-bold text-blue-600">facebook</h1>
12+
<p className="text-2xl mt-4 mb-6 font-semibold">
13+
Facebook helps you connect and share with the people in your life.
14+
</p>
15+
</article>
16+
<form
17+
className="bg-white shadow-md rounded p-5 w-full max-w-md"
18+
action="#!"
19+
>
20+
<div className="space-y-4">
21+
<Input
22+
type="email"
23+
name="email"
24+
placeholder="Email address or Phone number"
25+
autoComplete="off"
26+
/>
27+
<Input
28+
type="password"
29+
name="password"
30+
placeholder="Password"
31+
autoComplete="new-password"
32+
/>
33+
34+
<button
35+
className="bg-blue-600 rounded text-2xl w-full text-center font-bold p-2 text-white"
36+
type="submit"
37+
>
38+
Log in
39+
</button>
40+
41+
<NavLink
42+
to="/forgot-password"
43+
className="block text-center text-blue-500 mt-3"
44+
>
45+
Forgotten password?
46+
</NavLink>
47+
48+
<hr className="my-4" />
49+
50+
<div className="flex justify-center">
51+
<NavLink to="/signup">
52+
<li className="rounded text-white bg-green-500 list-none px-6 py-3 text-center text-xl font-bold">
53+
Create new account
54+
</li>
55+
</NavLink>
56+
</div>
57+
</div>
58+
</form>
59+
</section>
60+
</main>
61+
</>
62+
);
63+
};
64+
65+
export default Login;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
3+
const SignUp = () => {
4+
return (
5+
<div>SignUp</div>
6+
)
7+
}
8+
9+
export default SignUp
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export {default as Login} from './Login'
2+
export {default as SignUp} from './SignUp'
3+
export {default as Input} from './Common/Input'
4+
export {default as Button} from './Common/Button'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react'
2+
import {Login,SignUp} from './Components/index'
3+
import {createBrowserRouter, RouterProvider} from 'react-router-dom'
4+
5+
const Routes = () => {
6+
const router = createBrowserRouter([
7+
{
8+
path:'/',
9+
element:<Login/>
10+
},
11+
{
12+
path:'/SignUp',
13+
element:<SignUp/>
14+
},
15+
{},
16+
])
17+
return (
18+
<RouterProvider router={router} />
19+
)
20+
}
21+
22+
export default Routes

0 commit comments

Comments
 (0)