diff --git a/src/App.js b/src/App.js index 15097913..51a2778a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,3 +1,4 @@ +import { useState } from 'react'; import './index.scss'; const questions = [ @@ -8,7 +9,11 @@ const questions = [ }, { title: 'Компонент - это ... ', - variants: ['приложение', 'часть приложения или страницы', 'то, что я не знаю что такое'], + variants: [ + 'приложение', + 'часть приложения или страницы', + 'то, что я не знаю что такое', + ], correct: 1, }, { @@ -22,37 +27,67 @@ const questions = [ }, ]; -function Result() { +function Result({ correct }) { return (
); } -function Game() { +function Game({ step, question, onClickAnswer }) { + const percentage = Math.round(step / questions.length); + return ( <>