Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import React from 'react';
  2. import authorization from '../../../services/authorization';
  3. import './SignInForm.css';
  4.  
  5. function SignInForm() {
  6. const executeLogin = (event: React.FormEvent<HTMLFormElement>) => {
  7. event.preventDefault();
  8. const username = ((event.target as unknown) as Array<HTMLFormElement>)[0].value as string;
  9. const password = ((event.target as unknown) as Array<HTMLFormElement>)[1].value as string;
  10.  
  11. authorization.login(username, password);
  12. };
  13. return (
  14. <form className='form-signin text-center' onSubmit={executeLogin}>
  15. <img className='mb-4' src='../../../static/AliorLogo.png' alt='' width='50%' height='50%' />
  16. <h1 className='h3 mb-3 font-weight-normal'>Please sign in</h1>
  17. <label htmlFor='username' className='sr-only'>
  18. Username
  19. </label>
  20. <input type='text' id='inputEmail' className='form-control' placeholder='Username' required />
  21. <label htmlFor='inputPassword' className='sr-only'>
  22. Password
  23. </label>
  24. <input type='password' id='inputPassword' className='form-control' placeholder='Password' required />
  25. <button className='mt-4 btn btn-lg btn-primary btn-block' type='submit'>
  26. Sign in
  27. </button>
  28. <p className='mt-3 text-muted'>Register</p>
  29. </form>
  30. );
  31. }
  32.  
  33. export default SignInForm;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement