add login, register layout

This commit is contained in:
smanylov
2025-11-27 13:48:24 +07:00
parent fecb811a5c
commit 5c6a235ece
9 changed files with 420 additions and 2 deletions
+36
View File
@@ -0,0 +1,36 @@
'use client'
import styles from '@/app/styles/login.module.scss'
import { useActionState } from 'react';
import { authenticate } from '@/app/api/action';
export default function LoginForm() {
const [errorMessage, formAction, isPending] = useActionState(
authenticate,
undefined,
);
return (
<form action={formAction}>
<div className={`${styles['form-group']}`}>
<label className={`${styles['form-label']}`}>Email адрес</label>
<input type="readOnly" id="email" name="email" className={`${styles['form-input']}`} placeholder="Введите ваш email" />
</div>
<div className={`${styles['form-group']}`}>
<label className={`${styles['form-label']}`}>Пароль</label>
<input type="password" id="password" name="password" className={`${styles['form-input']}`} placeholder="Введите пароль" />
</div>
{errorMessage && (
<p className="text-sm text-red-500">{errorMessage}</p>
)}
<div className={`${styles['form-options']}`}>
<div className={`${styles['form-checkbox']}`}>
<input type="checkbox" id="remember" name="remember" />
<label>Запомнить меня</label>
</div>
<a href="forgot-password" className={`${styles['forgot-password']}`} >Забыли пароль?</a>
</div>
<button type="submit" className={`${styles['btn']}`}>Войти в систему</button>
</form>
)
}
+11
View File
@@ -0,0 +1,11 @@
import style from "./ui.module.scss"
export default function LogoIcon() {
return (
<div className={`${style['logo-icon']}`}>
<svg viewBox="0 0 24 24">
<path d="M12 2L2 7v10c0 5.55 3.84 9.74 9 11 5.16-1.26 9-5.45 9-11V7l-10-5z"></path>
</svg>
</div>
)
}
+61
View File
@@ -0,0 +1,61 @@
'use client'
import styles from '@/app/styles/login.module.scss';
import { useActionState } from 'react';
import { registration } from '@/app/api/action';
export default function RegisterForm() {
const [errorMessage, formAction, isPending] = useActionState(
registration,
undefined,
);
return (
<form action={formAction}>
<div className={`${styles['form-group']}`}>
<label
className={`${styles['form-label']} ${styles['required']}`}
>
Полное имя
</label>
<input type="readOnly" id="full_name" name="full_name" className={`${styles['form-input']}`} placeholder="Иванов Иван Иванович" />
</div>
<div className={`${styles['form-row']}`}>
<div className={`${styles['form-group']}`}>
<label className={`${styles['form-label']} ${styles['required']}`}>Email адрес</label>
<input type="password" id="email" name="email" className={`${styles['form-input']}`} placeholder="ivan@example.com" />
</div>
<div className={`${styles['form-group']}`}>
<label className={`${styles['form-label']}`}>Телефон</label>
<input type="phone" id="phone" name="phone" className={`${styles['form-input']}`} placeholder="+7 (999) 123-45-67" />
</div>
</div>
<div className={`${styles['form-group']}`}>
<label
className={`${styles['form-label']}`}
>
Компания
</label>
<input type="readOnly" id="company" name="company" className={`${styles['form-input']}`} placeholder="ООО «Ваша компания»" />
</div>
<div className={`${styles['form-row']}`}>
<div className={`${styles['form-group']}`}>
<label className={`${styles['form-label']} ${styles['required']}`}>Пароль</label>
<input type="password" id="password" name="password" className={`${styles['form-input']}`} placeholder="Минимум 6 символов" />
</div>
<div className={`${styles['form-group']}`}>
<label className={`${styles['form-label']} ${styles['required']}`}>Подтвердите пароль</label>
<input type="password" id="confirm_password" name="confirm_password" className={`${styles['form-input']}`} placeholder="Повторите пароль" />
</div>
</div>
{errorMessage && (
<p className="text-sm text-red-500">{errorMessage}</p>
)}
<div className={`${styles['form-checkbox']}`} style={{ marginBottom: "20px" }}>
<input type="checkbox" id="remember" name="remember" />
<label>Я соглашаюсь с <a href="forgot-password" >условиями использования и политикой конфиденциальности</a></label>
</div>
<button type="submit" className={`${styles['btn']}`}>Создать аккаунт</button>
</form>
)
}
+17
View File
@@ -83,4 +83,21 @@
height: 32px;
margin-right: 15px;
}
}
.logo-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 60px;
height: 60px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border-radius: 15px;
margin-bottom: 15px;
svg {
width: 30px;
height: 30px;
fill: white;
}
}