2020-01-16 22:14:53 +01:00
|
|
|
import Link from 'next/link';
|
2020-01-14 09:53:40 +01:00
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
|
import { faUser, faBuilding, faLock } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
|
|
|
|
|
2020-01-16 22:14:53 +01:00
|
|
|
const UserAuthForm = props => {
|
|
|
|
const isRegisterForm = props.formType === "register";
|
2020-01-14 09:53:40 +01:00
|
|
|
const isDeveloperAccount = props.accountType === "developer";
|
|
|
|
const isDeveloperIcon = <span>{isDeveloperAccount ? <FontAwesomeIcon icon={faUser} /> : <FontAwesomeIcon icon={faBuilding} /> }</span>
|
|
|
|
const lockIcon = <span><FontAwesomeIcon icon={faLock} /></span>
|
|
|
|
|
|
|
|
return (
|
2020-01-14 15:23:01 +01:00
|
|
|
<div className="page-content-center">
|
2020-01-15 19:43:39 +01:00
|
|
|
<h1>Rejestracja konta {isDeveloperAccount ? 'programisty' : 'firmy'} do systemu Task-O!</h1>
|
2020-01-14 09:53:40 +01:00
|
|
|
<form>
|
|
|
|
<ul>
|
2020-01-16 22:14:53 +01:00
|
|
|
{
|
|
|
|
isRegisterForm &&
|
2020-01-14 09:53:40 +01:00
|
|
|
<li>
|
|
|
|
{isDeveloperIcon}
|
|
|
|
<input type="text" placeholder={isDeveloperAccount ? "Podaj imię" : "Podaj nazwę firmy"} />
|
|
|
|
</li>
|
2020-01-16 22:14:53 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
isRegisterForm &&
|
2020-01-14 09:53:40 +01:00
|
|
|
<li>
|
|
|
|
{isDeveloperIcon}
|
|
|
|
<input type="text" placeholder={isDeveloperAccount ? "Podaj nazwisko" : "Podaj numer NIP"}/>
|
|
|
|
</li>
|
2020-01-16 22:14:53 +01:00
|
|
|
}
|
2020-01-14 09:53:40 +01:00
|
|
|
<li>
|
|
|
|
{isDeveloperIcon}
|
|
|
|
<input type="email" placeholder="Podaj adres e-mail" />
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
{lockIcon}
|
|
|
|
<input type="password" placeholder="Podaj hasło" />
|
|
|
|
</li>
|
2020-01-16 22:14:53 +01:00
|
|
|
{
|
|
|
|
isRegisterForm &&
|
2020-01-14 09:53:40 +01:00
|
|
|
<li>
|
|
|
|
{lockIcon}
|
|
|
|
<input type="password" placeholder="Powtórz hasło" />
|
|
|
|
</li>
|
2020-01-16 22:14:53 +01:00
|
|
|
}
|
2020-01-14 09:53:40 +01:00
|
|
|
</ul>
|
2020-01-16 22:14:53 +01:00
|
|
|
<button className={isRegisterForm ? "register-button" : "login-button"}>Zarejestruj się</button>
|
|
|
|
<Link href={isRegisterForm ? "/login" : "/register"}>
|
|
|
|
<button>{isRegisterForm ? "Zaloguj się" : "Zarejestruj się"}</button>
|
|
|
|
</Link>
|
2020-01-14 09:53:40 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-01-16 22:14:53 +01:00
|
|
|
export default UserAuthForm;
|