File tree 1 file changed +26
-20
lines changed
1 file changed +26
-20
lines changed Original file line number Diff line number Diff line change 1
- import logo from ' ./logo.svg' ;
2
- import ' ./App.css' ;
1
+ import logo from " ./logo.svg" ;
2
+ import " ./App.css" ;
3
3
4
4
function App ( ) {
5
- return (
6
- < div className = "App" >
7
- < header className = "App-header" >
8
- < img src = { logo } className = "App-logo" alt = "logo" />
9
- < p >
10
- Edit < code > src/App.js</ code > and save to reload.
11
- </ p >
12
- < a
13
- className = "App-link"
14
- href = "https://reactjs.org"
15
- target = "_blank"
16
- rel = "noopener noreferrer"
17
- >
18
- Learn React
19
- </ a >
20
- </ header >
21
- </ div >
22
- ) ;
5
+ const [ code , setCode ] = useState ( "" ) ;
6
+ const [ recording , setRecording ] = useState ( false ) ;
7
+ const [ stream , setStream ] = useState ( [ ] ) ;
8
+ const [ startTime , setStartTime ] = useState ( null ) ;
9
+ const [ isPlaying , setIsPlaying ] = useState ( false ) ;
10
+
11
+ const [ timeoutIds , setTimeoutIds ] = useState ( [ ] ) ;
12
+ const inputRef = useRef ( ) ;
13
+
14
+ const handleRecordStart = ( ) => {
15
+ if ( recording ) {
16
+ console . log ( stream ) ;
17
+ setRecording ( false ) ;
18
+ return ;
19
+ }
20
+
21
+ inputRef . current . focus ( ) ;
22
+ setStartTime ( Date . now ( ) ) ;
23
+ setStream ( [ ] ) ;
24
+ setCode ( "" ) ;
25
+ setRecording ( true ) ;
26
+ } ;
27
+
28
+ return < div className = "App" > </ div > ;
23
29
}
24
30
25
31
export default App ;
You can’t perform that action at this time.
0 commit comments