@@ -3,16 +3,14 @@ import React from "react";
3
3
import ButtonComponent from "./components/ButtonComponent" ;
4
4
import FooterComponent from "./components/FooterComponent" ;
5
5
import HeaderComponent from "./components/HeaderComponent" ;
6
+ import Loader from "./components/Loader" ;
6
7
7
8
import { useDataLayerValue } from "./context/DataLayer" ;
8
9
9
10
import "./styles.css" ;
10
11
11
12
export default function App ( ) {
12
- const {
13
- // state,//so es-lint does not brag!
14
- put,
15
- } = useDataLayerValue ( ) ;
13
+ const { state, put } = useDataLayerValue ( ) ;
16
14
17
15
function handleClick1 ( ) {
18
16
put ( { type : "INCREMENT_COUNTER_1_START" } ) ;
@@ -23,32 +21,46 @@ export default function App() {
23
21
}
24
22
25
23
return (
26
- < div className = "App" >
27
- < p >
28
- Imagine this is an actual website, where components need to display some
29
- state, or let's be crazy: even set some state !
30
- </ p >
31
-
32
- < HeaderComponent />
33
-
34
- < p >
35
- We, buttons below, live on the ground floor, level 0, in the App.js file
36
- directly but, we're cool!
37
- </ p >
38
-
39
- < p className = "App__groundFloor" >
40
- < ButtonComponent
41
- instructions = "Press me to increment counter 1"
42
- onClick = { handleClick1 }
43
- />
24
+ < >
25
+ < div className = "App" >
26
+ < p >
27
+ Imagine this is an actual website, where components need to display
28
+ some state, or let's be crazy: even set some state !
29
+ </ p >
30
+
31
+ < HeaderComponent />
32
+
33
+ < br />
34
+
35
+ < p >
36
+ We, buttons below, live on the ground floor, level 0, in the App.js
37
+ file directly but, we're cool!
38
+ </ p >
39
+
40
+ < p >
41
+ < ButtonComponent
42
+ instructions = "Press me to increment counter 1"
43
+ onClick = { handleClick1 }
44
+ />
45
+ </ p >
46
+
44
47
< hr />
45
- < ButtonComponent
46
- instructions = "No no, press me to increment counter 2, he's much better ;)"
47
- onClick = { handleClick2 }
48
- />
49
- </ p >
50
-
51
- < FooterComponent />
52
- </ div >
48
+
49
+ < p >
50
+ < span role = "img" aria-label = "pulling my tongue" >
51
+ 👀 👍
52
+ </ span >
53
+ < ButtonComponent
54
+ instructions = "PRESS ME!! BTW: whenever I see that counter 1 increments, I increment counter 2! This way, I'm always ahead of competition."
55
+ onClick = { handleClick2 }
56
+ />
57
+ </ p >
58
+
59
+ < br />
60
+
61
+ < FooterComponent />
62
+ </ div >
63
+ < Loader show = { state . ui . isWorking } />
64
+ </ >
53
65
) ;
54
66
}
0 commit comments