must use react for all !
Browse files- src/App.js +1 -1
- src/components/Navbar.js +2 -1
- src/pages/Login.js +81 -0
- src/pages/Register.js +85 -0
src/App.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import React from 'react';
|
| 2 |
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
| 3 |
import Home from './pages/Home';
|
|
@@ -29,5 +30,4 @@ function App() {
|
|
| 29 |
</Router>
|
| 30 |
);
|
| 31 |
}
|
| 32 |
-
|
| 33 |
export default App;
|
|
|
|
| 1 |
+
|
| 2 |
import React from 'react';
|
| 3 |
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
| 4 |
import Home from './pages/Home';
|
|
|
|
| 30 |
</Router>
|
| 31 |
);
|
| 32 |
}
|
|
|
|
| 33 |
export default App;
|
src/components/Navbar.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import React, { useState, useEffect } from 'react';
|
| 2 |
import { Link } from 'react-router-dom';
|
| 3 |
import feather from 'feather-icons';
|
|
@@ -79,4 +80,4 @@ const Navbar = () => {
|
|
| 79 |
);
|
| 80 |
};
|
| 81 |
|
| 82 |
-
export default Navbar;
|
|
|
|
| 1 |
+
|
| 2 |
import React, { useState, useEffect } from 'react';
|
| 3 |
import { Link } from 'react-router-dom';
|
| 4 |
import feather from 'feather-icons';
|
|
|
|
| 80 |
);
|
| 81 |
};
|
| 82 |
|
| 83 |
+
export default Navbar;
|
src/pages/Login.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { Link } from 'react-router-dom';
|
| 3 |
+
|
| 4 |
+
const Login = () => {
|
| 5 |
+
return (
|
| 6 |
+
<div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
|
| 7 |
+
<div className="max-w-md w-full space-y-8 bg-white p-8 rounded-xl shadow-md">
|
| 8 |
+
<div className="text-center">
|
| 9 |
+
<h2 className="mt-6 text-3xl font-extrabold text-gray-900">
|
| 10 |
+
Sign in to your account
|
| 11 |
+
</h2>
|
| 12 |
+
</div>
|
| 13 |
+
<form className="mt-8 space-y-6">
|
| 14 |
+
<div className="rounded-md shadow-sm space-y-4">
|
| 15 |
+
<div>
|
| 16 |
+
<label htmlFor="email" className="sr-only">Email address</label>
|
| 17 |
+
<input
|
| 18 |
+
id="email"
|
| 19 |
+
name="email"
|
| 20 |
+
type="email"
|
| 21 |
+
autoComplete="email"
|
| 22 |
+
required
|
| 23 |
+
className="appearance-none rounded-lg relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
| 24 |
+
placeholder="Email address"
|
| 25 |
+
/>
|
| 26 |
+
</div>
|
| 27 |
+
<div>
|
| 28 |
+
<label htmlFor="password" className="sr-only">Password</label>
|
| 29 |
+
<input
|
| 30 |
+
id="password"
|
| 31 |
+
name="password"
|
| 32 |
+
type="password"
|
| 33 |
+
autoComplete="current-password"
|
| 34 |
+
required
|
| 35 |
+
className="appearance-none rounded-lg relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
| 36 |
+
placeholder="Password"
|
| 37 |
+
/>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
<div className="flex items-center justify-between">
|
| 42 |
+
<div className="flex items-center">
|
| 43 |
+
<input
|
| 44 |
+
id="remember-me"
|
| 45 |
+
name="remember-me"
|
| 46 |
+
type="checkbox"
|
| 47 |
+
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
|
| 48 |
+
/>
|
| 49 |
+
<label htmlFor="remember-me" className="ml-2 block text-sm text-gray-900">
|
| 50 |
+
Remember me
|
| 51 |
+
</label>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
<div className="text-sm">
|
| 55 |
+
<a href="/forgot-password" className="font-medium text-blue-600 hover:text-blue-500">
|
| 56 |
+
Forgot your password?
|
| 57 |
+
</a>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<div>
|
| 62 |
+
<button
|
| 63 |
+
type="submit"
|
| 64 |
+
className="group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
| 65 |
+
>
|
| 66 |
+
Sign in
|
| 67 |
+
</button>
|
| 68 |
+
</div>
|
| 69 |
+
</form>
|
| 70 |
+
<div className="text-center text-sm">
|
| 71 |
+
<span className="text-gray-600">Don't have an account? </span>
|
| 72 |
+
<Link to="/register" className="font-medium text-blue-600 hover:text-blue-500">
|
| 73 |
+
Sign up
|
| 74 |
+
</Link>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
);
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
export default Login;
|
src/pages/Register.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { Link } from 'react-router-dom';
|
| 3 |
+
|
| 4 |
+
const Register = () => {
|
| 5 |
+
return (
|
| 6 |
+
<div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
|
| 7 |
+
<div className="max-w-md w-full space-y-8 bg-white p-8 rounded-xl shadow-md">
|
| 8 |
+
<div className="text-center">
|
| 9 |
+
<h2 className="mt-6 text-3xl font-extrabold text-gray-900">
|
| 10 |
+
Create your account
|
| 11 |
+
</h2>
|
| 12 |
+
</div>
|
| 13 |
+
<form className="mt-8 space-y-6">
|
| 14 |
+
<div className="rounded-md shadow-sm space-y-4">
|
| 15 |
+
<div>
|
| 16 |
+
<label htmlFor="full-name" className="sr-only">Full name</label>
|
| 17 |
+
<input
|
| 18 |
+
id="full-name"
|
| 19 |
+
name="full-name"
|
| 20 |
+
type="text"
|
| 21 |
+
autoComplete="name"
|
| 22 |
+
required
|
| 23 |
+
className="appearance-none rounded-lg relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
| 24 |
+
placeholder="Full name"
|
| 25 |
+
/>
|
| 26 |
+
</div>
|
| 27 |
+
<div>
|
| 28 |
+
<label htmlFor="email" className="sr-only">Email address</label>
|
| 29 |
+
<input
|
| 30 |
+
id="email"
|
| 31 |
+
name="email"
|
| 32 |
+
type="email"
|
| 33 |
+
autoComplete="email"
|
| 34 |
+
required
|
| 35 |
+
className="appearance-none rounded-lg relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
| 36 |
+
placeholder="Email address"
|
| 37 |
+
/>
|
| 38 |
+
</div>
|
| 39 |
+
<div>
|
| 40 |
+
<label htmlFor="password" className="sr-only">Password</label>
|
| 41 |
+
<input
|
| 42 |
+
id="password"
|
| 43 |
+
name="password"
|
| 44 |
+
type="password"
|
| 45 |
+
autoComplete="new-password"
|
| 46 |
+
required
|
| 47 |
+
className="appearance-none rounded-lg relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
| 48 |
+
placeholder="Password"
|
| 49 |
+
/>
|
| 50 |
+
</div>
|
| 51 |
+
<div>
|
| 52 |
+
<label htmlFor="confirm-password" className="sr-only">Confirm Password</label>
|
| 53 |
+
<input
|
| 54 |
+
id="confirm-password"
|
| 55 |
+
name="confirm-password"
|
| 56 |
+
type="password"
|
| 57 |
+
autoComplete="new-password"
|
| 58 |
+
required
|
| 59 |
+
className="appearance-none rounded-lg relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
| 60 |
+
placeholder="Confirm Password"
|
| 61 |
+
/>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<div>
|
| 66 |
+
<button
|
| 67 |
+
type="submit"
|
| 68 |
+
className="group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
| 69 |
+
>
|
| 70 |
+
Create account
|
| 71 |
+
</button>
|
| 72 |
+
</div>
|
| 73 |
+
</form>
|
| 74 |
+
<div className="text-center text-sm">
|
| 75 |
+
<span className="text-gray-600">Already have an account? </span>
|
| 76 |
+
<Link to="/login" className="font-medium text-blue-600 hover:text-blue-500">
|
| 77 |
+
Sign in
|
| 78 |
+
</Link>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
);
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
export default Register;
|