#13 Made login page form
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
.App {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-logo {
|
|
||||||
height: 40vmin;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
.App-logo {
|
|
||||||
animation: App-logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-header {
|
|
||||||
background-color: #282c34;
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: calc(10px + 2vmin);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-link {
|
|
||||||
color: #61dafb;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes App-logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import "./App.css";
|
import "./App.css";
|
||||||
import { Route } from "wouter";
|
import { Route } from "wouter";
|
||||||
import HomePage from "./pages/HomePage";
|
import HomePage from "./pages/HomePage";
|
||||||
|
import LoginPage from "./pages/LoginPage";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Route path="/">
|
<Route path="/" component={HomePage} />
|
||||||
<HomePage />
|
<Route path="/login" component={LoginPage} />
|
||||||
</Route>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
20
frontend/src/components/MyNavbar.jsx
Normal file
20
frontend/src/components/MyNavbar.jsx
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { Nav, Container, Navbar, NavDropdown } from "react-bootstrap";
|
||||||
|
|
||||||
|
const MyNavbar = () => {
|
||||||
|
return (
|
||||||
|
<Navbar variant="dark" bg="dark" expand="lg">
|
||||||
|
<Container>
|
||||||
|
<Navbar.Brand href="/">LearningTree</Navbar.Brand>
|
||||||
|
<Navbar.Toggle aria-controls="navbar-nav" />
|
||||||
|
<Navbar.Collapse id="navbar-nav">
|
||||||
|
<Nav className="ms-auto">
|
||||||
|
<Nav.Link href="/">Home</Nav.Link>
|
||||||
|
<Nav.Link href="/login">Login</Nav.Link>
|
||||||
|
</Nav>
|
||||||
|
</Navbar.Collapse>
|
||||||
|
</Container>
|
||||||
|
</Navbar>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MyNavbar;
|
||||||
@@ -1,8 +1,16 @@
|
|||||||
|
import { Container } from "react-bootstrap";
|
||||||
|
import MyNavbar from "../components/MyNavbar";
|
||||||
|
|
||||||
const HomePage = () => {
|
const HomePage = () => {
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
|
<MyNavbar />
|
||||||
|
<Container>
|
||||||
<div>
|
<div>
|
||||||
<h1>This is the home page</h1>
|
<h1>This is the home page</h1>
|
||||||
</div>
|
</div>
|
||||||
|
</Container>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
38
frontend/src/pages/LoginPage.jsx
Normal file
38
frontend/src/pages/LoginPage.jsx
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { Col, Container, Form, Row } from "react-bootstrap";
|
||||||
|
import MyNavbar from "../components/MyNavbar";
|
||||||
|
|
||||||
|
const LoginPage = () => {
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<MyNavbar />
|
||||||
|
<Container className="p-5">
|
||||||
|
<Form>
|
||||||
|
<Form.Group as={Row} className="mb-3" controlId="username">
|
||||||
|
<Form.Label column sm={2}>
|
||||||
|
Username
|
||||||
|
</Form.Label>
|
||||||
|
<Col sm={10}>
|
||||||
|
<Form.Control type="username" placeholder="username" />
|
||||||
|
</Col>
|
||||||
|
</Form.Group>
|
||||||
|
<Form.Group as={Row} className="mb-3" controlId="password">
|
||||||
|
<Form.Label column sm={2}>
|
||||||
|
Password
|
||||||
|
</Form.Label>
|
||||||
|
<Col sm={10}>
|
||||||
|
<Form.Control type="password" placeholder="password" />
|
||||||
|
</Col>
|
||||||
|
</Form.Group>
|
||||||
|
<Form.Group as={Row}>
|
||||||
|
<p>
|
||||||
|
Don't have an account? <a href="/register">Register here</a>
|
||||||
|
</p>
|
||||||
|
</Form.Group>
|
||||||
|
</Form>
|
||||||
|
</Container>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoginPage;
|
||||||
Reference in New Issue
Block a user