From 5134b80689562d578d431507d09bb1e8a4a2e9e2 Mon Sep 17 00:00:00 2001 From: Christopher Strnad Date: Wed, 28 May 2025 12:34:01 -0500 Subject: [PATCH 1/2] feat(ui): add stop dictation button to Result component (#3) --- frontend/src/components/Result.jsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Result.jsx b/frontend/src/components/Result.jsx index 104bf88..9997d44 100644 --- a/frontend/src/components/Result.jsx +++ b/frontend/src/components/Result.jsx @@ -1,8 +1,9 @@ import ReactMarkdown from 'react-markdown'; -import { useRef } from 'react'; +import { useRef, useState } from 'react'; const Result = ({ data }) => { const utteranceRef = useRef(null); + const [readingAloud, setReadingAloud] = useState(false); const downloadSummary = () => { const element = document.createElement('a'); @@ -20,6 +21,15 @@ const Result = ({ data }) => { } utteranceRef.current = new window.SpeechSynthesisUtterance(data.summary); window.speechSynthesis.speak(utteranceRef.current); + setReadingAloud(true); + }; + + const stopDictation = () => { + if (utteranceRef.current) { + window.speechSynthesis.cancel(); + utteranceRef.current = null; + } + setReadingAloud(false); }; return ( @@ -35,7 +45,9 @@ const Result = ({ data }) => {
- +
); From b459e3530c3fb6a2b4deed1071d187927c336da9 Mon Sep 17 00:00:00 2001 From: Christopher Strnad Date: Wed, 28 May 2025 12:41:23 -0500 Subject: [PATCH 2/2] docs: fix vite backend url variable name in readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d69c9c..5e96215 100644 --- a/README.md +++ b/README.md @@ -112,8 +112,7 @@ yarn install Create a .env file in the frontend/ directory to specify the backend API URL: ``` -VITE_BACKEND_API_URL=http:// -localhost:5000 +VITE_BACKEND_URL=http://localhost:5000 ``` ### 5. Running the Frontend Make sure you are in the frontend/ directory. Then start the development server: