-
Notifications
You must be signed in to change notification settings - Fork 38
/
LoginForm.js
43 lines (40 loc) · 1.43 KB
/
LoginForm.js
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
export default function RegisterForm() {
const login = () => {
/***
* @todo Complete this function.
* @todo 1. Write code for form validation.
* @todo 2. Fetch the auth token from backend and login the user.
* @todo 3. Set the token in the context (See context/auth.js)
*/
}
return (
<div className='bg-grey-lighter min-h-screen flex flex-col'>
<div className='container max-w-sm mx-auto flex-1 flex flex-col items-center justify-center px-2'>
<div className='bg-white px-6 py-8 rounded shadow-md text-black w-full'>
<h1 className='mb-8 text-3xl text-center'>Login</h1>
<input
type='text'
className='block border border-grey-light w-full p-3 rounded mb-4'
name='inputUsername'
id='inputUsername'
placeholder='Username'
/>
<input
type='password'
className='block border border-grey-light w-full p-3 rounded mb-4'
name='inputPassword'
id='inputPassword'
placeholder='Password'
/>
<button
type='submit'
className='w-full text-center py-3 rounded bg-transparent text-green-500 hover:text-white hover:bg-green-500 border border-green-500 hover:border-transparent focus:outline-none my-1'
onClick={login}
>
Login
</button>
</div>
</div>
</div>
)
}