mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
feat(a11y): cross-platform hardening + modal focus-trap from impeccable audit
Responsive / viewport: - add .min-h-viewport / .h-viewport utilities (100dvh + Telegram --tg-viewport-stable-height) - migrate min-h-screen / h-screen / 100vh across 18 files - reveal hover-only controls on focus-within + touch (desktop nav, admin settings) - grid breakpoints (TopUpAmount, Contests), larger touch targets, nav aria-labels Platform routing (Telegram WebView correctness): - clipboard -> copyToClipboard util with execCommand fallback (10 files) - window.open -> openTelegramLink / openLink (Profile, Referral, ChannelSubscriptionScreen) - window.confirm -> useNativeDialog (admin pages); PromoOffersSection -> useDestructiveConfirm - window.prompt -> usePrompt / PromptDialogHost (TipTap link editors) - ESLint no-restricted-properties guard against regressions (adapters/clipboard util exempt) Modal accessibility: - new useFocusTrap hook (focus trap, Esc, scroll lock, focus restore) - role=dialog / aria-modal / focus-trap: Polls, SuccessNotificationModal, AdminPolicies, AdminPromoGroups, AdminCampaigns, BroadcastPreview (Telegram + Email) - new global usePrompt store + PromptDialogHost
This commit is contained in:
@@ -13,6 +13,7 @@ import { staggerContainer, staggerItem } from '@/components/motion/transitions';
|
||||
import type { PaymentMethod, PaymentMethodOption } from '../types';
|
||||
import BentoCard from '../components/ui/BentoCard';
|
||||
import { saveTopUpPendingInfo } from '../utils/topUpStorage';
|
||||
import { copyToClipboard } from '@/utils/clipboard';
|
||||
|
||||
// Icons
|
||||
const StarIcon = () => (
|
||||
@@ -400,7 +401,7 @@ export default function TopUpAmount() {
|
||||
const handleCopyUrl = async () => {
|
||||
if (!paymentUrl) return;
|
||||
try {
|
||||
await navigator.clipboard.writeText(paymentUrl);
|
||||
await copyToClipboard(paymentUrl);
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
} catch {
|
||||
@@ -522,7 +523,7 @@ export default function TopUpAmount() {
|
||||
|
||||
{/* Quick amount buttons */}
|
||||
{quickAmounts.length > 0 && (
|
||||
<motion.div variants={staggerItem} className="grid grid-cols-4 gap-2">
|
||||
<motion.div variants={staggerItem} className="grid grid-cols-2 gap-2 sm:grid-cols-4">
|
||||
{quickAmounts.map((a) => {
|
||||
const val = getQuickValue(a);
|
||||
const isSelected = amount === val;
|
||||
|
||||
Reference in New Issue
Block a user