diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/App.js b/GrossesMitaines/grosses-mitaines-ui/src/components/App.js index c6b05d1..8cf5038 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/App.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/App.js @@ -7,9 +7,9 @@ import ContactUs from "../pages/ContactUs"; import Morceaux from "../pages/Morceaux"; import MorceauDetail from "../pages/MorceauDetail"; import Inventaire from "../pages/Inventaire"; +import Login from "../pages/Login"; const App = () => { - return ( @@ -21,6 +21,7 @@ const App = () => { }/> }/> }/> + }/> diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/Topbar.js b/GrossesMitaines/grosses-mitaines-ui/src/components/Topbar.js index 6813df2..ea5a31d 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/Topbar.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/Topbar.js @@ -31,6 +31,9 @@ const Topbar = () => { Vie privée + + Connexion + Gestion diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Login.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Login.js new file mode 100644 index 0000000..a42c16a --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Login.js @@ -0,0 +1,49 @@ +import { useState } from "react"; +import { Button } from "react-bootstrap"; + +const Login = () => { + + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); + + const handleLogin = async (e) => { + e.preventDefault(); + + const response = await fetch(`https://localhost:7292/api/Login?rememberme=true`, { + method: 'POST', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ username, password }) + }) + + // Partie de display d'erreur ou de redirection (faudrait checker pour se faire un state de connexion). + + } + + return ( +
+
+

Connexion

+
+ + setUsername(e.target.value)} /> +
+
+ + setPassword(e.target.value)} /> +
+ +
+
+ ) +} + +export default Login; \ No newline at end of file