2020-01-10 03:24:54 +01:00
|
|
|
import React from 'react';
|
2020-01-09 10:06:38 +01:00
|
|
|
import '../css/App.css';
|
|
|
|
|
import useTelegraph from '../hooks/useTelegraph';
|
|
|
|
|
import MorseBufferDisplay from '../components/MorseBufferDisplay'
|
|
|
|
|
import MorseDisplay from '../components/MorseDisplay'
|
|
|
|
|
|
|
|
|
|
function PracticeMode() {
|
|
|
|
|
|
2020-01-10 03:24:54 +01:00
|
|
|
const {morseCharBuffer, morseWords, clearHistory} = useTelegraph('practice')
|
2020-01-13 09:03:58 +01:00
|
|
|
|
2020-01-09 10:06:38 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<MorseBufferDisplay buffer={morseCharBuffer} /><br/>
|
|
|
|
|
<MorseDisplay morseWords={morseWords} /><br/>
|
|
|
|
|
<button onClick={clearHistory}>Clear Morse History</button><br/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default React.memo(PracticeMode);
|