-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMenu.js
More file actions
43 lines (41 loc) · 1.55 KB
/
Menu.js
File metadata and controls
43 lines (41 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from "react";
function Menu({ difficulty, receiveView, receiveDifficulty }) {
return (
<div className="menu__container">
<h1 className="menu__title">It's Quizness Time!</h1>
<label className="menu__select__label">Please select difficulty:</label>
<select
value={difficulty}
onChange={event => {
receiveDifficulty(event.target.value);
}}
className="menu__select__dropdown"
>
<option value="&difficulty=easy">Easy</option>
<option value="&difficulty=medium">Medium</option>
<option value="&difficulty=hard">Hard</option>
<option value="">Random</option>
</select>
{difficulty === "&difficulty=easy" && (
<p className="menu__select__description">Just the basics, easy questions for easy going players.</p>
)}
{difficulty === "&difficulty=medium" && (
<p className="menu__select__description">Not quite easy, not quite hard.</p>
)}
{difficulty === "&difficulty=hard" && (
<p className="menu__select__description">Challenging to say the least.</p>
)}
{difficulty === "" && (
<p className="menu__select__description">
A mixed bag of question difficulties! Easy questions are worth 1
point, medium questions are worth 2 points and hard questions are
worth 3 points.
</p>
)}
<button className="menu__select__button" onClick={() => receiveView("quiz")}>
Lets get down to Quizness!
</button>
</div>
);
}
export default Menu;