mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
feat: add Stars payment confirmation and admin validation
- Show confirmation dialog before redirecting to Telegram for Stars payment (native popup in Mini App, confirm in browser) - Warn admin when saving wheel config with Stars enabled but Telegram Stars payment method is disabled globally - Add translation keys: confirmStarsTitle, confirmStarsPayment, starsNotEnabledGlobally (ru, en, zh, fa)
This commit is contained in:
@@ -7,6 +7,7 @@ import WheelLegend from '../components/wheel/WheelLegend';
|
||||
import InsufficientBalancePrompt from '../components/InsufficientBalancePrompt';
|
||||
import { usePlatform, useHaptic } from '@/platform';
|
||||
import { useNotify } from '@/platform/hooks/useNotify';
|
||||
import { useNativeDialog } from '@/platform/hooks/useNativeDialog';
|
||||
import { Card } from '@/components/data-display/Card/Card';
|
||||
import { Button } from '@/components/primitives/Button/Button';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
@@ -63,6 +64,7 @@ export default function Wheel() {
|
||||
const { openInvoice, capabilities } = usePlatform();
|
||||
const haptic = useHaptic();
|
||||
const notify = useNotify();
|
||||
const dialog = useNativeDialog();
|
||||
|
||||
const [isSpinning, setIsSpinning] = useState(false);
|
||||
const [targetRotation, setTargetRotation] = useState<number | null>(null);
|
||||
@@ -306,7 +308,12 @@ export default function Wheel() {
|
||||
},
|
||||
});
|
||||
|
||||
const handleDirectStarsPay = () => {
|
||||
const handleDirectStarsPay = async () => {
|
||||
const confirmed = await dialog.confirm(
|
||||
t('wheel.confirmStarsPayment'),
|
||||
t('wheel.confirmStarsTitle'),
|
||||
);
|
||||
if (!confirmed) return;
|
||||
setIsPayingStars(true);
|
||||
starsInvoiceMutation.mutate();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user