From 48f246c8e098baa42568c8ca5d205430e986b5ad Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Fri, 18 Oct 2024 18:19:59 +0530 Subject: [PATCH] #0000 Fixed audio issue and uppercase issue --- src/components/DiscoverSentance/DiscoverSentance.jsx | 5 +++-- src/components/Practice/Mechanics6.jsx | 12 ++---------- src/views/Practice/Practice.jsx | 10 ++++++---- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/components/DiscoverSentance/DiscoverSentance.jsx b/src/components/DiscoverSentance/DiscoverSentance.jsx index 742981cb..9b574271 100644 --- a/src/components/DiscoverSentance/DiscoverSentance.jsx +++ b/src/components/DiscoverSentance/DiscoverSentance.jsx @@ -32,13 +32,14 @@ const SpeakSentenceComponent = () => { const [assesmentCount, setAssesmentcount] = useState(0); const [initialAssesment, setInitialAssesment] = useState(true); const [disableScreen, setDisableScreen] = useState(false); - const [play] = useSound(LevelCompleteAudio); + // const [play] = useSound(LevelCompleteAudio); const [openMessageDialog, setOpenMessageDialog] = useState(""); const [totalSyllableCount, setTotalSyllableCount] = useState(""); const [isNextButtonCalled, setIsNextButtonCalled] = useState(false); const callConfettiAndPlay = () => { - play(); + let audio = new Audio(LevelCompleteAudio); + audio.play(); callConfetti(); }; diff --git a/src/components/Practice/Mechanics6.jsx b/src/components/Practice/Mechanics6.jsx index 9b87bccb..4f272326 100644 --- a/src/components/Practice/Mechanics6.jsx +++ b/src/components/Practice/Mechanics6.jsx @@ -184,19 +184,11 @@ const Mechanics2 = ({ ? 0 : currrentProgress / duration; - const getEnableButton = () => { - if (type === "fillInTheBlank") { - return enableNext; - } - if (type === "audio") { - return selectedWord === wordToCheck; - } - }; return ( { const [disableScreen, setDisableScreen] = useState(false); const [mechanism, setMechanism] = useState(""); - const [play] = useSound(LevelCompleteAudio); + // const [play] = useSound(LevelCompleteAudio); const [livesData, setLivesData] = useState(); const [gameOverData, setGameOverData] = useState(); const [loading, setLoading] = useState(); @@ -71,7 +71,8 @@ const Practice = () => { }, [startShowCase]); const callConfettiAndPlay = () => { - play(); + let audio = new Audio(LevelCompleteAudio); + audio.play(); callConfetti(); }; @@ -597,6 +598,7 @@ const Practice = () => { }); let type = currentContentType?.toLowerCase(); + // console.log(type, sentence, matchedChar); if (type === "char" || type === "word") { const word = splitGraphemes(words[0].toLowerCase()).filter( (item) => item !== "‌" && item !== "" && item !== " " @@ -623,7 +625,7 @@ const Practice = () => { background: "#FFF0BD", }} > - {substr} + {i === 0 ? substr.toUpperCase() : substr} ); @@ -646,7 +648,7 @@ const Practice = () => { lineHeight: "50px", }} > - {word[i]} + {i === 0 ? word[i].toUpperCase() : word[i]} );