add form style
This commit is contained in:
1 parent
387b2c32cf
commit
fef249acd3
8 files changed
+177
-157
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { useState } from "react";
|
||||
import login from "../../utils/login.js";
|
||||
import getUser from "../../utils/getUser.js";
|
||||
import styles from "./form.module.css";
|
||||
function LoginForm({ className }) {
|
||||
const [email, setEmail] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
await login(email, password);
|
||||
getUser();
|
||||
}
|
||||
return (
|
||||
<div className={className}>
|
||||
<div className={styles.formgroup}>
|
||||
<input type="email" id="email" value={email} placeholder="Adresse mail" onChange={e => setEmail(e.target.value)} required/>
|
||||
</div>
|
||||
|
||||
<div className={styles.formgroup}>
|
||||
<input type="password" id="password" value={password} placeholder="Adresse mail" onChange={e => setPassword(e.target.value)} required/>
|
||||
<br/>
|
||||
</div>
|
||||
<div className={styles.logButton} >
|
||||
<button className={styles.loginButton} onClick={e => handleSubmit(e)}>Se connecter</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default LoginForm;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
padding: 0px 10px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
font-size: 16px;
|
||||
color: #111;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.06) inset;
|
||||
}
|
||||
|
||||
input::placeholder{
|
||||
font-size: 20px;
|
||||
color: rgba(0,0,0,0.45);
|
||||
}
|
||||
.logButton{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.formgroup{
|
||||
margin-top:23px;
|
||||
}
|
||||
|
||||
/* style scoped (module) */
|
||||
.loginButton {
|
||||
display: inline-block;
|
||||
padding: 0.55rem 1rem;
|
||||
height: 55px;
|
||||
border-radius: 6px;
|
||||
background-color: #2b6cb0;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
box-shadow: 0 2px 6px rgba(43,108,176,0.15);
|
||||
cursor: pointer;
|
||||
transition: background-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.loginButton:hover {
|
||||
background-color: #235a9a;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 14px rgba(43,108,176,0.18);
|
||||
}
|
||||
|
||||
.loginButton:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 3px 8px rgba(43,108,176,0.12);
|
||||
}
|
||||
|
||||
.loginButton:focus {
|
||||
outline: 2px solid rgba(43,108,176,0.24);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
|
||||
.loginButton:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 3px 8px rgba(43,108,176,0.12);
|
||||
}
|
||||
|
||||
.loginButton:focus {
|
||||
outline: 2px solid rgba(43,108,176,0.24);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
Reference in new issue
Block a user