Skip to content

Instantly share code, notes, and snippets.

@tararoutray
Created October 18, 2022 02:31
Show Gist options
  • Save tararoutray/f95a96cd7bf1ebc46e937baa2c4f0a23 to your computer and use it in GitHub Desktop.
Save tararoutray/f95a96cd7bf1ebc46e937baa2c4f0a23 to your computer and use it in GitHub Desktop.
import axios from "axios";
import React from "react";
import { Button, Col, Container, Form, FormGroup, FormLabel, Row } from "react-bootstrap";
import { useNavigate } from "react-router-dom";
const Login = () => {
const submitLoginForm = (event) => {
event.preventDefault();
}
return (
<React.Fragment>
<Container className="my-5">
<h2 className="fw-normal mb-5">Login To React Auth Demo</h2>
<Row>
<Col md={{span: 6}}>
<Form id="loginForm" onSubmit={submitLoginForm}>
<FormGroup className="mb-3">
<FormLabel htmlFor={'login-username'}>Username</FormLabel>
<input type={'text'} className="form-control" id={'login-username'} name="username" required />
</FormGroup>
<FormGroup className="mb-3">
<FormLabel htmlFor={'login-password'}>Password</FormLabel>
<input type={'password'} className="form-control" id={'login-password'} name="password" required />
</FormGroup>
<Button type="submit" className="btn-success mt-2" id="login-btn">Login</Button>
</Form>
</Col>
</Row>
</Container>
</React.Fragment>
);
}
export default Login;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment