feat: похуйу
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user