feat: похуйу
This commit is contained in:
@@ -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