This commit is contained in:
2026-06-01 23:28:57 +03:00
parent 895bec2a50
commit b86f3209f5
22 changed files with 1036 additions and 269 deletions

View File

@@ -0,0 +1,227 @@
.page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem 0;
}
.card {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 24px;
padding: 32px;
width: 100%;
max-width: 600px;
}
.logo {
display: flex;
justify-content: center;
margin-bottom: 28px;
}
.logo img {
height: 40px;
}
.title {
text-align: center;
font-size: 24px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 24px;
line-height: 1.3;
}
/* Переключатель типа регистрации */
.typeSwitch {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px;
padding: 4px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--glass-border);
border-radius: 14px;
margin-bottom: 24px;
}
.typeOption {
appearance: none;
border: none;
background: transparent;
color: var(--text-secondary);
font-size: 14px;
font-weight: 600;
padding: 12px 16px;
border-radius: 10px;
cursor: pointer;
transition: background 0.18s ease, color 0.18s ease;
}
.typeOption:hover {
color: var(--text-primary);
}
.typeOptionActive {
background: var(--interactive);
color: #fff;
}
.twoCol {
display: grid;
grid-template-columns: 1fr;
gap: 20px 24px;
align-items: start;
}
.leftCol {
display: flex;
flex-direction: column;
gap: 20px;
}
.rightCol {
display: flex;
flex-direction: column;
gap: 8px;
}
.codeHint {
font-size: 12px;
color: var(--text-secondary);
text-decoration: underline;
cursor: pointer;
}
/* Кнопка возврата на шаг ввода данных */
.backButton {
appearance: none;
border: none;
background: transparent;
color: var(--text-secondary);
font-size: 13px;
font-weight: 600;
padding: 0;
margin-bottom: 16px;
cursor: pointer;
transition: color 0.18s ease;
}
.backButton:hover {
color: var(--text-primary);
}
/* Документы для юридического лица */
.documents {
margin-top: 24px;
padding: 20px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--glass-border);
border-radius: 16px;
}
.documentsTitle {
font-size: 15px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 4px;
}
.documentsSubtitle {
font-size: 12px;
color: var(--text-secondary);
margin-bottom: 16px;
}
.documentsList {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 10px;
}
.documentItem {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 14px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--glass-border);
border-radius: 12px;
}
.documentName {
font-size: 13px;
color: var(--text-primary);
line-height: 1.4;
}
.attachButton {
flex-shrink: 0;
font-size: 12px;
font-weight: 600;
color: var(--interactive);
padding: 8px 14px;
border: 1px solid var(--interactive);
border-radius: 10px;
cursor: pointer;
white-space: nowrap;
transition: background 0.18s ease, color 0.18s ease;
}
.attachButton:hover {
background: var(--interactive);
color: #fff;
}
.fileInput {
display: none;
}
.error {
color: #ff5a5a;
font-size: 13px;
margin-top: 12px;
text-align: center;
}
.submitWrapper {
margin-top: 28px;
}
.legal {
text-align: center;
font-size: 11px;
color: var(--text-secondary);
margin-top: 20px;
line-height: 1.6;
}
.legal a {
color: var(--interactive);
text-decoration: none;
}
.legal a:hover {
text-decoration: underline;
}
@media (max-width: 560px) {
.card {
padding: 32px 20px;
border-radius: 0;
}
.twoCol {
grid-template-columns: 1fr;
}
.documentItem {
flex-direction: column;
align-items: flex-start;
}
}

View File

@@ -0,0 +1,155 @@
import { useState } from 'react'
import { FormField, PrimaryButton, Button } from '@shared/ui'
import logo from '@shared/assets/logo-full-white.png'
import styles from './RegisterTestPage.module.css'
type AccountType = 'individual' | 'legal'
type Step = 'info' | 'documents'
const LEGAL_DOCUMENTS = [
'Свидетельство о государственной регистрации (ОГРН)',
'Свидетельство о постановке на учёт в налоговом органе (ИНН)',
'Устав организации (действующая редакция)',
'Решение/протокол о назначении руководителя',
'Документ, подтверждающий полномочия лица, открывающего счёт',
'Карточка с образцами подписей и оттиска печати',
]
export function RegisterTestPage() {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const [confirmPassword, setConfirmPassword] = useState('')
const [verificationCode, setVerificationCode] = useState('')
const [accountType, setAccountType] = useState<AccountType>('individual')
const [step, setStep] = useState<Step>('info')
const isLegal = accountType === 'legal'
// Тестовая страница — без проверок и запросов. «Создать» просто ведёт на шаг 2.
const handleInfoSubmit = (e: React.FormEvent) => {
e.preventDefault()
setStep('documents')
}
const handleDocumentsSubmit = (e: React.FormEvent) => {
e.preventDefault()
// Тестовая страница — отправки нет.
}
return (
<div className={styles.page}>
{step === 'info' ? (
<form className={styles.card} onSubmit={handleInfoSubmit}>
<div className={styles.logo}>
<img src={logo} alt="ЭКСА" />
</div>
<h1 className={styles.title}>Создать кошелёк ЭКСА</h1>
{/* Выбор типа регистрации — перед всеми полями */}
<div className={styles.typeSwitch} role="tablist" aria-label="Тип регистрации">
<button
type="button"
role="tab"
aria-selected={!isLegal}
className={`${styles.typeOption} ${!isLegal ? styles.typeOptionActive : ''}`}
onClick={() => setAccountType('individual')}
>
Физическое лицо
</button>
<button
type="button"
role="tab"
aria-selected={isLegal}
className={`${styles.typeOption} ${isLegal ? styles.typeOptionActive : ''}`}
onClick={() => setAccountType('legal')}
>
Юридическое лицо
</button>
</div>
<div className={styles.twoCol}>
<div className={styles.leftCol}>
<FormField
label={isLegal ? 'Введите корпоративный email' : 'Введите адрес электронной почты'}
type="email"
value={email}
onChange={setEmail}
placeholder={isLegal ? 'name@company.ru' : 'example@mail.ru'}
/>
<FormField
label="Придумайте пароль"
type="password"
value={password}
onChange={setPassword}
placeholder="••••••••"
/>
<FormField
label="Повторите пароль"
type="password"
value={confirmPassword}
onChange={setConfirmPassword}
placeholder="••••••••"
/>
</div>
<div className={styles.rightCol}>
<Button variant="ghost" type="button">
Получить проверочный код
</Button>
<span className={styles.codeHint}>Код не пришёл</span>
<FormField
label="Ввести код"
type="text"
value={verificationCode}
onChange={setVerificationCode}
placeholder="000 000"
/>
</div>
</div>
<div className={styles.submitWrapper}>
<PrimaryButton label="Создать" />
</div>
<p className={styles.legal}>
Нажимая «Создать», вы принимаете<br />
<a href="#">Пользовательское соглашение</a> и <a href="#">Политику конфиденциальности</a>
</p>
</form>
) : (
/* Шаг 2: прикрепление документов (только юр. лицо) */
<form className={styles.card} onSubmit={handleDocumentsSubmit}>
<div className={styles.logo}>
<img src={logo} alt="ЭКСА" />
</div>
<button type="button" className={styles.backButton} onClick={() => setStep('info')}>
Назад к данным
</button>
<h1 className={styles.title}>Прикрепите документы</h1>
<p className={styles.documentsSubtitle}>
Для открытия счёта юридическому лицу прикрепите сканы или фотографии
следующих документов:
</p>
<ul className={styles.documentsList}>
{LEGAL_DOCUMENTS.map((doc) => (
<li key={doc} className={styles.documentItem}>
<span className={styles.documentName}>{doc}</span>
<label className={styles.attachButton}>
Прикрепить
<input type="file" className={styles.fileInput} multiple />
</label>
</li>
))}
</ul>
<div className={styles.submitWrapper}>
<PrimaryButton label="Создать аккаунт" />
</div>
</form>
)}
</div>
)
}