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:
c0mrade
2026-02-04 16:41:25 +03:00
parent 02640d1c38
commit e6f8ae6ab0
6 changed files with 37 additions and 4 deletions

View File

@@ -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();
};