Archived
added login form
This commit is contained in:
1 parent
6a2e06ae67
commit
c93230d1d0
3 files changed
+47
No files matched your search
@@ -8,6 +8,7 @@ import Logo from "./components/Logo";
|
|||||||
import { CreateEvent } from "./pages/CreateEvent";
|
import { CreateEvent } from "./pages/CreateEvent";
|
||||||
import { Event } from "./pages/Event";
|
import { Event } from "./pages/Event";
|
||||||
import { EVENT_CONTEXT } from "./constants";
|
import { EVENT_CONTEXT } from "./constants";
|
||||||
|
import { LoginPage } from "./pages/Login";
|
||||||
|
|
||||||
export const App = (props) => {
|
export const App = (props) => {
|
||||||
const [context, setContext] = useState({
|
const [context, setContext] = useState({
|
||||||
@@ -32,6 +33,7 @@ export const App = (props) => {
|
|||||||
<Home />
|
<Home />
|
||||||
</Route>
|
</Route>
|
||||||
<Route exact path="/create" component={CreateEvent} />
|
<Route exact path="/create" component={CreateEvent} />
|
||||||
|
<Route exact path="/login" component={LoginPage} />
|
||||||
{Array.isArray(props.events) &&
|
{Array.isArray(props.events) &&
|
||||||
props.events.map((e) => {
|
props.events.map((e) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { useTitle } from "../../utils/useTitle";
|
||||||
|
import styles from "./index.module.scss";
|
||||||
|
import { Stack } from "react-bootstrap";
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
|
|
||||||
|
export const LoginPage = () => {
|
||||||
|
const form = useRef(null);
|
||||||
|
useTitle("Logowanie");
|
||||||
|
useEffect(() => {
|
||||||
|
form.current.addEventListener("submit", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log(e);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={styles.container}>
|
||||||
|
<p className={styles.title}>Zaloguj się</p>
|
||||||
|
<form ref={form}>
|
||||||
|
<Stack gap={2}>
|
||||||
|
<input type="text" autoComplete={"username"} placeholder="Nazwa użytkownika"></input>
|
||||||
|
<input type="password" autoComplete={"current-password"} placeholder="Hasło"></input>
|
||||||
|
<button type="submit" className={"greenButton"}>
|
||||||
|
Zaloguj się
|
||||||
|
</button>
|
||||||
|
</Stack>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
@import "../../index.scss";
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: $defaultWidth;
|
||||||
|
max-width: $maxWidth;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
color: $accent;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 2.1em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user