diff --git a/package.json b/package.json index 4102aeb..50a09a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pezkuwi-telegram-miniapp", - "version": "1.0.225", + "version": "1.0.227", "type": "module", "description": "Pezkuwichain Telegram Mini App - Forum, Announcements, Rewards", "author": "Pezkuwichain Team", diff --git a/src/components/p2p/BalanceCard.tsx b/src/components/p2p/BalanceCard.tsx index 633e059..a9418e7 100644 --- a/src/components/p2p/BalanceCard.tsx +++ b/src/components/p2p/BalanceCard.tsx @@ -1,5 +1,5 @@ import { useState, useEffect, useCallback } from 'react'; -import { Wallet, Lock, RefreshCw } from 'lucide-react'; +import { Wallet, Lock, RefreshCw, ArrowDownToLine, ArrowUpFromLine } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useAuth } from '@/contexts/AuthContext'; import { useTranslation } from '@/i18n'; @@ -8,9 +8,17 @@ import { getInternalBalance, type InternalBalance } from '@/lib/p2p-api'; interface BalanceCardProps { onRefresh?: () => void; + onDeposit?: () => void; + onWithdraw?: () => void; + onBalancesLoaded?: (balances: InternalBalance[]) => void; } -export function BalanceCard({ onRefresh }: BalanceCardProps) { +export function BalanceCard({ + onRefresh, + onDeposit, + onWithdraw, + onBalancesLoaded, +}: BalanceCardProps) { const { sessionToken } = useAuth(); const { t, isRTL } = useTranslation(); const { hapticImpact } = useTelegram(); @@ -24,13 +32,14 @@ export function BalanceCard({ onRefresh }: BalanceCardProps) { try { const data = await getInternalBalance(sessionToken); setBalances(data); + onBalancesLoaded?.(data); } catch (err) { console.error('Failed to fetch balances:', err); } finally { setLoading(false); setRefreshing(false); } - }, [sessionToken]); + }, [sessionToken, onBalancesLoaded]); useEffect(() => { fetchBalances(); @@ -103,6 +112,30 @@ export function BalanceCard({ onRefresh }: BalanceCardProps) { ))} )} + + {/* Deposit / Withdraw buttons */} +
{t('p2p.depositInstructions')}
+
+ {PLATFORM_WALLET}
+
+
+ {t('p2p.verifying')}
++ {t('p2p.verifyingDesc')} +
+{t('p2p.depositSuccess')}
++ +{depositResult.amount} {depositResult.token} +
+ +{t('p2p.depositFailed')}
+{depositError}
+ +{t('p2p.withdrawSuccess')}
++ {t('p2p.withdrawProcessing')} +
+ +{withdrawError}
+