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:
2026-02-27 00:53:52 +03:00
parent b67809481e
commit 910610491f
24 changed files with 237 additions and 88 deletions
+9 -2
View File
@@ -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'}
+2 -2
View File
@@ -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>
+2
View File
@@ -14,6 +14,8 @@
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--card: 222.2 84% 6.5%;
--card-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--radius: 0.75rem;
}
+1 -1
View File
@@ -195,7 +195,7 @@ export function P2PSection() {
onClick={() => handleTabChange(tab.id)}
className={cn(
'flex-1 py-2 text-xs font-medium rounded-lg transition-colors',
activeTab === tab.id ? 'bg-card text-foreground shadow-sm' : 'text-muted-foreground'
activeTab === tab.id ? 'bg-cyan-500/20 text-cyan-400 shadow-sm' : 'text-muted-foreground'
)}
>
{tab.label}
+3 -3
View File
@@ -1,5 +1,5 @@
{
"version": "1.0.227",
"buildTime": "2026-02-26T17:26:18.861Z",
"buildNumber": 1772126778862
"version": "1.0.228",
"buildTime": "2026-02-26T21:44:34.122Z",
"buildNumber": 1772142274123
}