File tree 4 files changed +24
-20
lines changed
4 files changed +24
-20
lines changed Original file line number Diff line number Diff line change 21
21
npm-debug.log *
22
22
yarn-debug.log *
23
23
yarn-error.log *
24
+
25
+ .firebase /
Original file line number Diff line number Diff line change 2
2
"hosting" : {
3
3
"public" : " build" ,
4
4
"ignore" : [
5
- " **/.*" ,
6
5
" firebase.json" ,
7
- " **/node_modules/**" ,
8
- " /build/asset-manifest.json" ,
9
- " /build/static/js/*.js.map"
10
- ],
11
- "rewrites" : [
12
- {
13
- "source" : " **" ,
14
- "destination" : " /index.html"
15
- }
16
- ],
17
- "headers" : [{
18
- "source" : " index.html" ,
19
- "headers" : [{
20
- "key" : " Access-Control-Allow-Origin" ,
21
- "value" : " *"
22
- }]
23
- }
6
+ " **/.*" ,
7
+ " **/node_modules/**"
24
8
]
25
9
}
26
10
}
Original file line number Diff line number Diff line change 4
4
differenceInMilliseconds
5
5
} from "date-fns"
6
6
7
- const QuizForm = ( { player, type } ) => {
7
+ const QuizForm = ( { player, type, reset } ) => {
8
8
9
9
const [ form , setForm ] = useState ( {
10
10
questions : require ( `../questions/${ type } ` ) [ type ] ,
@@ -114,6 +114,16 @@ const QuizForm = ({ player, type }) => {
114
114
< span className = "badge badge-primary" > { form . finishTimeSeconds } </ span >
115
115
</ li >
116
116
</ ul >
117
+
118
+ < div className = "mt-3" >
119
+ < button
120
+ className = "btn btn-block btn-success btn-lg"
121
+ onClick = { ( ) => { reset ( ) } }
122
+ type = "button"
123
+ >
124
+ Novo Jogo
125
+ </ button >
126
+ </ div >
117
127
</ div >
118
128
) }
119
129
</ div >
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ const App = () => {
14
14
console . log ( '< APP : STATE > ' , state )
15
15
} )
16
16
17
+ const resetForm = ( ) => {
18
+ setState ( {
19
+ name : '' ,
20
+ type : false ,
21
+ startQuiz : false
22
+ } )
23
+ }
24
+
17
25
return (
18
26
< div className = "App animated fadeIn" >
19
27
< div className = "container" >
@@ -28,7 +36,7 @@ const App = () => {
28
36
{ state . startQuiz && (
29
37
< div className = { `row animated ${ state . startQuiz ? 'fadeInDown' : 'fadeOutDown' } ` } >
30
38
< div className = "col-xs-12 ml-auto mr-auto" >
31
- < QuizForm player = { state . name } type = { state . type } />
39
+ < QuizForm player = { state . name } type = { state . type } reset = { resetForm } />
32
40
</ div >
33
41
</ div >
34
42
) }
You can’t perform that action at this time.
0 commit comments