diff options
Diffstat (limited to 'src/index.tsx')
-rw-r--r-- | src/index.tsx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/index.tsx b/src/index.tsx index 713039f..9b740f9 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,11 +1,25 @@ -import React from 'react'; +import React, { useState } from 'react'; import ReactDOM from 'react-dom'; import './style.css'; import Timer from './components/Timer'; +interface Solution { + result: string; + author: string; +} + const App: React.FC = () => { - return (<Timer />); + const [author, setAuthor] = useState<string>('anonymous'); + const [solutions, setSolutions] = useState<Solution[]>([]); + + const registerResult = (result: string) => { + setSolutions([...solutions, { author, result }]); + } + + return ( + <Timer registerResult={registerResult} /> + ); }; document.body.style.overflow = 'hidden'; |