@@ -4,6 +4,7 @@ import { TonClient, WalletContractV4 } from '@ton/ton';
44import { mnemonicNew , mnemonicToPrivateKey } from '@ton/crypto' ;
55import { getHttpEndpoint } from '@orbs-network/ton-access' ;
66import { QRCode } from 'react-qrcode-logo' ;
7+ import { Toaster , toast } from 'sonner' ;
78import './App.css' ;
89
910// Telegram WebApp
@@ -667,6 +668,21 @@ function App() {
667668 if ( isWin ) {
668669 seenTxHashesRef . current . add ( txHash ) ;
669670 addLog ( 'success' , `🎉 ${ comment } : +${ amount . toFixed ( 2 ) } TON @ ${ timeStr } ` ) ;
671+
672+ // Show toast notification
673+ toast . success ( `🎉 ${ comment } !` , {
674+ description : `+${ amount . toFixed ( 2 ) } TON` ,
675+ duration : 5000 ,
676+ } ) ;
677+
678+ // Add to results immediately
679+ setWinResults ( prev => [ ...prev , {
680+ id : txHash ,
681+ amount,
682+ isWin : true ,
683+ time : timeStr
684+ } ] ) ;
685+
670686 newWins . push ( {
671687 id : txHash ,
672688 amount,
@@ -684,7 +700,7 @@ function App() {
684700
685701 if ( newWins . length > 0 ) {
686702 addLog ( 'success' , `🎉 ${ lang === 'ru' ? 'Новых выигрышей' : 'New wins' } : ${ newWins . length } ` ) ;
687- setWinResults ( prev => [ ... prev , ... newWins ] ) ;
703+ // Wins already added immediately above
688704 } else {
689705 addLog ( 'pending' , lang === 'ru' ? 'Новых выигрышей не найдено' : 'No new wins found' ) ;
690706 }
@@ -844,6 +860,17 @@ function App() {
844860
845861 return (
846862 < div className = { `app ${ isTelegram ? 'telegram-app' : '' } ` } >
863+ < Toaster
864+ position = "top-center"
865+ richColors
866+ theme = "dark"
867+ toastOptions = { {
868+ style : {
869+ background : '#16213e' ,
870+ border : '1px solid rgba(0, 212, 170, 0.3)' ,
871+ } ,
872+ } }
873+ />
847874 { /* Language Switcher */ }
848875 < div className = "lang-switcher" >
849876 < button className = { lang === 'en' ? 'active' : '' } onClick = { ( ) => setLang ( 'en' ) } > EN</ button >
0 commit comments