Abans del codi

This commit is contained in:
Pasq G 2024-11-27 10:33:17 +01:00
parent 6035c20831
commit 2387c9d931
3 changed files with 33 additions and 11 deletions

16
imports/roles.ts Normal file
View File

@ -0,0 +1,16 @@
export const ROLS_GLOBALS = {
ADMINISTRADOR: 'admin',
USUARI: 'usuari'
}; // as const;
// export type GlobalRolesKeys = keyof typeof GLOBAL_ROLES;
// export type GlobalRolesValues = (typeof GLOBAL_ROLES)[GlobalRolesKeys];
export const ROLS_DE_POBLE = {
MONITOR: 'monitor_de_poble',
ENCARREGAT: 'encarregat_de_tasques',
VOLUNTARI: 'voluntari_de_poble'
}; // as const;
// export type TeamRolesKeys = keyof typeof TEAM_ROLES;
// export type TeamRolesValues = (typeof TEAM_ROLES)[TeamRolesKeys];

View File

@ -94,7 +94,7 @@ const Loguejat = () => {
Nosaltres hauríem de tindre opció de filtrar les necessitats per pobles i condicions (per poder vore, per exemple, totes les necessitats pendents de tots els pobles, o només les necessitats pendents d'Alaquàs) Nosaltres hauríem de tindre opció de filtrar les necessitats per pobles i condicions (per poder vore, per exemple, totes les necessitats pendents de tots els pobles, o només les necessitats pendents d'Alaquàs)
</div> </div>
: <Link to="/login">Login</Link> : <Link to="/login">Entra o Registra't</Link>
; ;
}; };

View File

@ -48,33 +48,39 @@ export const Login= () => {
if (isLogin) { if (isLogin) {
return <form onSubmit={handleLogin}> return <form onSubmit={handleLogin}>
<label htmlFor="email">E-mail</label> <label htmlFor="email">Correu electrònic o nom d'usuari: </label>
<input id="email" type="email" required /> <input id="email" type="email" required />
<br /> <br />
<label htmlFor="password">Password</label> <label htmlFor="password">Contrasenya: </label>
<input id="password" type="password" required /> <input id="password" type="password" required />
<br /> <br />
<button type="submit">Login</button> <button type="submit">Entra</button>
<button onClick={() => setIsLogin( false )}>Register a new account</button> <button onClick={() => setIsLogin( false )}>Registra un compte nou</button>
</form> </form>
} }
return ( return (
<form onSubmit={handleRegistration}> <form onSubmit={handleRegistration}>
<label htmlFor="username">Username</label> <label htmlFor="username">Nom d'usuari: </label>
<input id="username" type="text" required /> <input id="username" type="text" required />
<br /> <br />
<label htmlFor="email">E-mail</label> <label htmlFor="email">Correu electrònic: </label>
<input id="email" type="email" required /> <input id="email" type="email" required />
<br /> <br />
<label htmlFor="password">Password</label> <label htmlFor="password">Contrasenya: </label>
<input id="password" type="password" required /> <input id="password" type="password" required />
<br /> <br />
<label htmlFor="password2">Repeat password</label> <label htmlFor="password2">Repeteix la contrasenya: </label>
<input id="password2" type="password" required /> <input id="password2" type="password" required />
<br /> <br />
<button type="submit">Register</button> <label htmlFor="tel">Telèfon: </label>
<button onClick={() => setIsLogin( true )}>Login instead</button> <input id="tel" type="tel" required />
<br />
<label htmlFor="codi">Codi d'entrada (opcional): </label>
<input id="codi" type="text" />
<br />
<button type="submit">Registrar</button>
<button onClick={() => setIsLogin( true )}>Dialeg d'accés</button>
</form> </form>
); );
}; };