fix
This commit is contained in:
165
dist/assets/index-Bzh-PW6c.js
vendored
165
dist/assets/index-Bzh-PW6c.js
vendored
File diff suppressed because one or more lines are too long
161
dist/assets/index-CPUmmycy.js
vendored
Normal file
161
dist/assets/index-CPUmmycy.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/index.html
vendored
4
dist/index.html
vendored
@@ -5,8 +5,8 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
||||||
<script type="module" crossorigin src="/assets/index-Bzh-PW6c.js"></script>
|
<script type="module" crossorigin src="/assets/index-CPUmmycy.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-D1yEGVJz.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-DPCnfw2D.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
import { useMe } from '@features/auth'
|
||||||
import { ConverterSection } from '@widgets/converter-page'
|
import { ConverterSection } from '@widgets/converter-page'
|
||||||
|
import { LegalConverterPage } from './LegalConverterPage'
|
||||||
|
|
||||||
export function ConverterPage() {
|
export function ConverterPage() {
|
||||||
return <ConverterSection />
|
const { data } = useMe()
|
||||||
|
const isLegal = !!data && data.account_type !== 'individual'
|
||||||
|
return isLegal ? <LegalConverterPage /> : <ConverterSection />
|
||||||
}
|
}
|
||||||
|
|||||||
164
src/pages/converter/ui/LegalConverterPage.module.css
Normal file
164
src/pages/converter/ui/LegalConverterPage.module.css
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
.wrap {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
background: var(--glass-bg);
|
||||||
|
border: 1px solid var(--glass-border);
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: clamp(32px, 4vw, 48px);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
margin-top: 12px;
|
||||||
|
max-width: 560px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formCol {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--highlight);
|
||||||
|
margin-top: -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Селект срока ожидания — стилизован под FormField input */
|
||||||
|
.field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fieldLabel {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select {
|
||||||
|
width: 100%;
|
||||||
|
height: 48px;
|
||||||
|
background: rgba(255, 255, 255, 0.06);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 10px;
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: var(--font-sans);
|
||||||
|
padding: 0 16px;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select:focus {
|
||||||
|
border-color: var(--interactive);
|
||||||
|
box-shadow: 0 0 0 3px rgba(74, 109, 255, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select option {
|
||||||
|
background: var(--glass-bg, #1a1a2e);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Панель условий / комиссии */
|
||||||
|
.infoCol {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoTitle {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoRow {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14px 18px;
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid var(--glass-border);
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoRow[data-accent] {
|
||||||
|
border-color: var(--grad-center);
|
||||||
|
background: rgba(91, 61, 184, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoLabel {
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoValue {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitBtn {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 40px;
|
||||||
|
padding: 18px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: var(--grad-center);
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitBtn:disabled {
|
||||||
|
opacity: 0.4;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.wrap {
|
||||||
|
padding: 28px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
152
src/pages/converter/ui/LegalConverterPage.tsx
Normal file
152
src/pages/converter/ui/LegalConverterPage.tsx
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import { useState } from 'react'
|
||||||
|
import { FormField } from '@shared/ui'
|
||||||
|
import styles from './LegalConverterPage.module.css'
|
||||||
|
|
||||||
|
const MIN_ORDER = 500_000
|
||||||
|
|
||||||
|
// Тестовые значения: чем дольше пользователь готов ждать, тем ниже комиссия сервиса.
|
||||||
|
const TERM_OPTIONS = [
|
||||||
|
{ days: 1, rate: 0.05 },
|
||||||
|
{ days: 3, rate: 0.035 },
|
||||||
|
{ days: 7, rate: 0.02 },
|
||||||
|
{ days: 14, rate: 0.012 },
|
||||||
|
] as const
|
||||||
|
|
||||||
|
const ru = (n: number) => n.toLocaleString('ru-RU', { maximumFractionDigits: 0 })
|
||||||
|
|
||||||
|
const dayLabel = (days: number) => {
|
||||||
|
const mod10 = days % 10
|
||||||
|
const mod100 = days % 100
|
||||||
|
if (mod10 === 1 && mod100 !== 11) return `${days} день`
|
||||||
|
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) return `${days} дня`
|
||||||
|
return `${days} дней`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function LegalConverterPage() {
|
||||||
|
const [amount, setAmount] = useState('')
|
||||||
|
const [name, setName] = useState('')
|
||||||
|
const [contact, setContact] = useState('')
|
||||||
|
const [days, setDays] = useState<number>(TERM_OPTIONS[0].days)
|
||||||
|
|
||||||
|
const numAmount = Number(amount.replace(/\D/g, '')) || 0
|
||||||
|
const belowMin = numAmount > 0 && numAmount < MIN_ORDER
|
||||||
|
|
||||||
|
const rate = TERM_OPTIONS.find((o) => o.days === days)?.rate ?? TERM_OPTIONS[0].rate
|
||||||
|
const commission = numAmount * rate
|
||||||
|
const total = numAmount + commission
|
||||||
|
|
||||||
|
const handleAmountChange = (value: string) => {
|
||||||
|
const digits = value.replace(/\D/g, '')
|
||||||
|
setAmount(digits ? ru(Number(digits)) : '')
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
|
e.preventDefault()
|
||||||
|
// Бэкенд пока не подключён — заявка никуда не отправляется.
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<form className={styles.wrap} onSubmit={handleSubmit}>
|
||||||
|
<div className={styles.header}>
|
||||||
|
<h1 className={styles.title}>Оставить заявку</h1>
|
||||||
|
<p className={styles.subtitle}>
|
||||||
|
Конвертация крупных объёмов по индивидуальному курсу. Оставьте заявку —
|
||||||
|
менеджер свяжется с вами, подтвердит актуальный курс и сопроводит сделку.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.body}>
|
||||||
|
<div className={styles.formCol}>
|
||||||
|
<FormField
|
||||||
|
label="Объём заявки, ₽"
|
||||||
|
type="text"
|
||||||
|
value={amount}
|
||||||
|
onChange={handleAmountChange}
|
||||||
|
placeholder="от 500 000"
|
||||||
|
/>
|
||||||
|
{belowMin && (
|
||||||
|
<p className={styles.hint}>
|
||||||
|
Минимальный объём заявки — {ru(MIN_ORDER)} ₽
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className={styles.field}>
|
||||||
|
<label className={styles.fieldLabel} htmlFor="term">
|
||||||
|
Срок ожидания операции
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="term"
|
||||||
|
className={styles.select}
|
||||||
|
value={days}
|
||||||
|
onChange={(e) => setDays(Number(e.target.value))}
|
||||||
|
>
|
||||||
|
{TERM_OPTIONS.map((o) => (
|
||||||
|
<option key={o.days} value={o.days}>
|
||||||
|
{dayLabel(o.days)} — комиссия {(o.rate * 100).toFixed(1)} %
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
label="Как к вам обращаться"
|
||||||
|
type="text"
|
||||||
|
value={name}
|
||||||
|
onChange={setName}
|
||||||
|
placeholder="Имя"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
label="Email или телефон для связи"
|
||||||
|
type="text"
|
||||||
|
value={contact}
|
||||||
|
onChange={setContact}
|
||||||
|
placeholder="example@mail.ru / +7 900 000-00-00"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.infoCol}>
|
||||||
|
<div className={styles.infoTitle}>УСЛОВИЯ</div>
|
||||||
|
|
||||||
|
<div className={styles.infoRow}>
|
||||||
|
<span className={styles.infoLabel}>Минимальный объём</span>
|
||||||
|
<span className={styles.infoValue}>{ru(MIN_ORDER)} ₽</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.infoRow}>
|
||||||
|
<span className={styles.infoLabel}>Срок ожидания</span>
|
||||||
|
<span className={styles.infoValue}>{dayLabel(days)}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.infoRow}>
|
||||||
|
<span className={styles.infoLabel}>Ставка комиссии</span>
|
||||||
|
<span className={styles.infoValue}>{(rate * 100).toFixed(1)} %</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.infoRow}>
|
||||||
|
<span className={styles.infoLabel}>Сумма комиссии</span>
|
||||||
|
<span className={styles.infoValue}>
|
||||||
|
{numAmount > 0 ? `≈ ${ru(commission)} ₽` : '—'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.infoRow} data-accent>
|
||||||
|
<span className={styles.infoLabel}>Итого к оплате</span>
|
||||||
|
<span className={styles.infoValue}>
|
||||||
|
{numAmount > 0 ? `≈ ${ru(total)} ₽` : '—'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className={styles.note}>
|
||||||
|
Итоговая комиссия рассчитывается индивидуально и зависит от объёма,
|
||||||
|
валюты и направления сделки.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" className={styles.submitBtn} disabled={belowMin}>
|
||||||
|
Оставить заявку
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
)
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user