aboutsummaryrefslogtreecommitdiff
path: root/src/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.tsx')
-rw-r--r--src/index.tsx18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/index.tsx b/src/index.tsx
index 9b740f9..30d0f07 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import './style.css';
+import './fonts/Bitter-Regular.woff';
import Timer from './components/Timer';
@@ -14,13 +15,24 @@ const App: React.FC = () => {
const [solutions, setSolutions] = useState<Solution[]>([]);
const registerResult = (result: string) => {
- setSolutions([...solutions, { author, result }]);
+ setSolutions([{ author, result }, ...solutions]);
}
return (
- <Timer registerResult={registerResult} />
+ <>
+ <h2>Timer</h2>
+ <Timer registerResult={registerResult} />
+
+ <h2>Results</h2>
+ <ul>
+ {solutions.map(solution => (
+ <li>
+ {solution.result} by {solution.author}
+ </li>
+ ))}
+ </ul>
+ </>
);
};
-document.body.style.overflow = 'hidden';
ReactDOM.render(<App />, document.getElementById('root'));