From 8c445b2a52b1d9063be55d09cf4932868487c6ba Mon Sep 17 00:00:00 2001 From: caileanhtuan Date: Thu, 4 Apr 2024 19:25:25 -0400 Subject: [PATCH] feat: change user flow --- App.tsx | 52 +++++++++---------- src/requests.ts | 2 + src/screens/Game/ExercisesCompleted.tsx | 9 +++- src/screens/Game/MathMain/MathMain.tsx | 4 +- .../Game/SectionSummary/SectionSummary.tsx | 21 ++++++++ src/screens/Stacks/gameDescriptions.ts | 14 ++--- src/screens/Stacks/generalDescriptions.ts | 10 ++-- src/types.ts | 6 ++- 8 files changed, 77 insertions(+), 41 deletions(-) create mode 100644 src/screens/Game/SectionSummary/SectionSummary.tsx diff --git a/App.tsx b/App.tsx index b742d8b3..4ed5b58f 100644 --- a/App.tsx +++ b/App.tsx @@ -35,31 +35,31 @@ export default function App() { - - - - {MergedStacks} - - - + {/* */} + + + {MergedStacks} + + + {/* */} @@ -75,5 +75,5 @@ axios.interceptors.request.use( // Do something with request error logAxiosError(error); return Promise.reject(error); - }, + } ); diff --git a/src/requests.ts b/src/requests.ts index fb1749b4..86a01c4f 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -60,10 +60,12 @@ export async function internalRequest({ }); if (response.data.success === false) { + console.log("Error1:", response.data.message); throw new Error(`Unable to connect to API: ${response.data.message}`); } return response.data.payload; } catch (e) { + console.log("Error2:", e); throw new Error(`Unable to connect to API: ${e}`); } } diff --git a/src/screens/Game/ExercisesCompleted.tsx b/src/screens/Game/ExercisesCompleted.tsx index 71d82459..d94d4f74 100644 --- a/src/screens/Game/ExercisesCompleted.tsx +++ b/src/screens/Game/ExercisesCompleted.tsx @@ -8,6 +8,7 @@ import Text from "../../components/Text"; import useAsyncStorage from "../../hooks/useAsyncStorage"; import { RootStackParamList, SoundSetting, Settings } from "../../types"; import useSound from "../../hooks/useSound"; +import { GameTypes } from "../../types"; const sound = require("../../assets/congrats.mp3") as AVPlaybackSource; @@ -40,7 +41,7 @@ type Props = NativeStackScreenProps; function ExercisesCompleted({ navigation }: Props) { const { storageValue: settings } = useAsyncStorage("SETTINGS"); const { unloadSound } = useSound(sound, SoundSetting.voiceOverOn); - + const gameCompleted = "Math"; const correct = 1; const total = 1; @@ -73,6 +74,12 @@ function ExercisesCompleted({ navigation }: Props) { navigation.navigate("ExtraPractice"); }} /> +