mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-06-16 16:41:09 +00:00
fix: dual bot token auth + P2P UI logic fixes
- All 17 edge functions now check both TELEGRAM_BOT_TOKEN and TELEGRAM_BOT_TOKEN_KRD for session verification - Add perPage:1000 to listUsers calls to prevent pagination issues - Fix offer button label: Buy tab shows "Al" (green), Sell tab shows "Sat" (red) - Fix active tab highlight with cyan color for visibility - Fix modal transparency (add --card CSS variable) - Fix withdraw tab sync (useEffect on modal open)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
X,
|
||||
ArrowDownToLine,
|
||||
@@ -51,6 +51,13 @@ export function DepositWithdrawModal({
|
||||
|
||||
const [activeTab, setActiveTab] = useState<'deposit' | 'withdraw'>(initialTab);
|
||||
|
||||
// Sync tab when modal opens with a different initialTab
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
setActiveTab(initialTab);
|
||||
}
|
||||
}, [isOpen, initialTab]);
|
||||
|
||||
// Deposit state
|
||||
const [depositToken, setDepositToken] = useState<'HEZ' | 'PEZ'>('HEZ');
|
||||
const [depositAmount, setDepositAmount] = useState('');
|
||||
@@ -231,7 +238,7 @@ export function DepositWithdrawModal({
|
||||
{/* Modal */}
|
||||
<div
|
||||
className={cn(
|
||||
'relative w-full max-w-md max-h-[90vh] bg-card rounded-t-2xl sm:rounded-2xl border border-border overflow-y-auto',
|
||||
'relative w-full max-w-md max-h-[90vh] bg-card rounded-t-2xl sm:rounded-2xl border border-border overflow-y-auto shadow-2xl',
|
||||
isRTL && 'direction-rtl'
|
||||
)}
|
||||
dir={isRTL ? 'rtl' : 'ltr'}
|
||||
|
||||
@@ -163,12 +163,12 @@ export function OfferList({ adType, onAcceptOffer }: OfferListProps) {
|
||||
onClick={() => handleAccept(offer)}
|
||||
className={cn(
|
||||
'px-3 py-1.5 text-xs font-medium rounded-lg transition-colors',
|
||||
adType === 'buy'
|
||||
adType === 'sell'
|
||||
? 'bg-green-500 hover:bg-green-600 text-white'
|
||||
: 'bg-red-500 hover:bg-red-600 text-white'
|
||||
)}
|
||||
>
|
||||
{adType === 'buy' ? t('p2p.buy') : t('p2p.sell')}
|
||||
{adType === 'sell' ? t('p2p.buy') : t('p2p.sell')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user