2020-01-09 10:06:38 +01:00
|
|
|
import React from 'react';
|
|
|
|
|
import '../css/App.css';
|
|
|
|
|
import useTelegraph from '../hooks/useTelegraph';
|
2020-01-10 03:24:54 +01:00
|
|
|
// import ChallengeWord from '../components/ChallengeWord'
|
|
|
|
|
// import MorseBufferDisplay from '../components/MorseBufferDisplay'
|
|
|
|
|
import ChallengeDisplay from '../components/ChallengeDisplay';
|
2020-01-09 10:06:38 +01:00
|
|
|
|
|
|
|
|
function ChallengeMode() {
|
|
|
|
|
|
2020-01-10 03:24:54 +01:00
|
|
|
const {morseCharBuffer, setMorseCharBuffer} = useTelegraph('challenge')
|
2020-01-09 10:06:38 +01:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2020-01-10 03:24:54 +01:00
|
|
|
<ChallengeDisplay buffer={morseCharBuffer} word="Morse" setMorseCharBuffer={setMorseCharBuffer}/>
|
2020-01-10 09:56:38 +01:00
|
|
|
<button onClick={() => console.log(morseCharBuffer)}>morseCharBuffer</button>
|
2020-01-09 10:06:38 +01:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default React.memo(ChallengeMode);
|