feat: похуйу

This commit is contained in:
2026-05-12 23:31:10 +03:00
parent d6345ee0d2
commit b7900fcdf3
7 changed files with 107 additions and 4 deletions

View File

@@ -174,6 +174,24 @@
border-top: 1px solid var(--glass-border);
}
.payBtn {
width: 100%;
margin-top: 24px;
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;
}
.payBtn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
@media (max-width: 1024px) {
.body {
grid-template-columns: 1fr;

View File

@@ -1,7 +1,7 @@
import { useConverter } from '@widgets/currency-converter'
import { USDT_RATE, GAS_PRICE } from '@shared/config/constants'
import { useDebounce } from '@shared/lib/hooks/useDebounce'
import { usePaymentConfig, usePaymentQuote } from '@features/payment'
import { usePaymentConfig, usePaymentQuote, useCreateOrder } from '@features/payment'
import { CommissionPanel } from './CommissionPanel'
import { AgreementCheck } from './AgreementCheck'
import styles from './ConverterSection.module.css'
@@ -19,6 +19,17 @@ export function ConverterSection() {
const rubTotal = quote?.total_price ?? ''
const { mutate: submitOrder, isPending } = useCreateOrder()
function handlePay() {
submitOrder({
usdt_amount: c.numRub,
usdt_exchange_rate: 1,
gas_fee: 1,
total_price: Number(rubTotal) || 0,
})
}
return (
<div className={styles.wrap}>
<div className={styles.header}>
@@ -49,6 +60,7 @@ export function ConverterSection() {
</button>
<button
type="button"
disabled
className={styles.tab}
data-active={c.mode === 'sell' || undefined}
onClick={() => c.setMode('sell')}
@@ -116,6 +128,15 @@ export function ConverterSection() {
<div className={styles.bottom}>
<AgreementCheck checked={c.agreed} onToggle={() => c.setAgreed(!c.agreed)} />
</div>
<button
type="button"
className={styles.payBtn}
onClick={handlePay}
disabled={!rubTotal || isPending}
>
{isPending ? 'Обработка...' : 'Оплатить'}
</button>
</div>
)
}

View File

@@ -42,6 +42,7 @@ export function Converter() {
className={styles.tab}
data-active={c.mode === 'sell' || undefined}
onClick={() => c.setMode('sell')}
disabled
>
ПРОДАТЬ
</button>