@@ -17,6 +17,7 @@ import type { GamePhase, Hypothesis } from "./types";
1717import { Phase1Collider } from "./components/Games/Phase1Collider/Phase1Collider" ;
1818import { Phase2Equation } from "./components/Games/Phase2Equation/Phase2Equation" ;
1919import { Phase3Synthesis } from "./components/Games/Phase3Synthesis/Phase3Synthesis" ;
20+ import { logger } from "@/utils/logger" ;
2021
2122function App ( ) {
2223 const [ currentPhase , setCurrentPhase ] = useState < GamePhase > ( "intro" ) ;
@@ -35,9 +36,9 @@ function App() {
3536 useEffect ( ( ) => {
3637 if ( ! hasDraft ( ) ) {
3738 initializeDraft ( ) ;
38- console . log ( "🆕 Nuevo draft inicializado" ) ;
39+ logger . log ( "🆕 Nuevo draft inicializado" ) ;
3940 } else {
40- console . log ( "📋 Draft existente encontrado" ) ;
41+ logger . log ( "📋 Draft existente encontrado" ) ;
4142 }
4243 setIsInitialized ( true ) ;
4344 } , [ ] ) ;
@@ -49,14 +50,14 @@ function App() {
4950 const handleHypothesisSelect = ( hypothesis : Hypothesis ) => {
5051 // Sobrescribir hipótesis en localStorage (permite cambiar de opinión)
5152 updateHypothesis ( hypothesis ) ;
52- console . log ( `✅ Hipótesis ${ hypothesis } guardada en draft` ) ;
53+ logger . log ( `✅ Hipótesis ${ hypothesis } guardada en draft` ) ;
5354
5455 // Navegar a InputScreen
5556 setCurrentPhase ( "input" ) ;
5657 } ;
5758
5859 const handleInputSubmit = async ( data : InputData ) => {
59- console . log ( "📝 Datos de input guardados en draft:" , data ) ;
60+ logger . log ( "📝 Datos de input guardados en draft:" , data ) ;
6061
6162 // Verificar si el draft está listo para enviar
6263 const draft = getDraft ( ) ;
@@ -66,7 +67,7 @@ function App() {
6667 // Ir a los juegos primero
6768 setCurrentPhase ( "collider" ) ;
6869
69- console . log ( "🎮 Navegando a juegos. Draft completo:" , draft ) ;
70+ logger . log ( "🎮 Navegando a juegos. Draft completo:" , draft ) ;
7071 } else {
7172 alert ( "Faltan datos. Por favor completa el formulario." ) ;
7273 }
@@ -84,13 +85,13 @@ function App() {
8485 try {
8586 const draft = getDraft ( ) ;
8687
87- console . log ( "🚀 Enviando predicción completa a Firebase..." ) ;
88- console . log ( "📦 Draft final:" , draft ) ;
88+ logger . log ( "🚀 Enviando predicción completa a Firebase..." ) ;
89+ logger . log ( "📦 Draft final:" , draft ) ;
8990
9091 // Enviar a Firebase
9192 await submitPrediction ( draft ) ;
9293
93- console . log ( "✅ Predicción enviada exitosamente" ) ;
94+ logger . log ( "✅ Predicción enviada exitosamente" ) ;
9495
9596 // IMPORTANTE: NO limpiar el draft todavía
9697 // SuccessScreen lo necesita para mostrar los datos
@@ -99,7 +100,7 @@ function App() {
99100 // Navegar a pantalla de éxito
100101 setCurrentPhase ( "submitted" ) ;
101102 } catch ( error ) {
102- console . error ( "❌ Error al enviar predicción:" , error ) ;
103+ logger . error ( "❌ Error al enviar predicción:" , error ) ;
103104 alert ( "Error al enviar tu predicción. Por favor intenta de nuevo." ) ;
104105 } finally {
105106 setIsSaving ( false ) ;
@@ -108,19 +109,19 @@ function App() {
108109
109110 // Handlers para los juegos
110111 const handleColliderComplete = ( score : number ) => {
111- console . log ( `🎮 Collider completado: ${ score } pts` ) ;
112+ logger . log ( `🎮 Collider completado: ${ score } pts` ) ;
112113 // updateGameScore("collider", score) ya se llama dentro del juego
113114 setCurrentPhase ( "equation" ) ;
114115 } ;
115116
116117 const handleEquationComplete = ( score : number ) => {
117- console . log ( `🎮 Equation completado: ${ score } pts` ) ;
118+ logger . log ( `🎮 Equation completado: ${ score } pts` ) ;
118119 // updateGameScore("equation", score) ya se llama dentro del juego
119120 setCurrentPhase ( "synthesis" ) ;
120121 } ;
121122
122123 const handleSynthesisComplete = async ( score : number ) => {
123- console . log ( `🎮 Synthesis completado: ${ score } pts` ) ;
124+ logger . log ( `🎮 Synthesis completado: ${ score } pts` ) ;
124125 // updateGameScore("synthesis", score) ya se llama dentro del juego
125126
126127 // Después del último juego, enviar TODO a Firebase
0 commit comments