@@ -3,16 +3,14 @@ import React from "react";
33import ButtonComponent from "./components/ButtonComponent" ;
44import FooterComponent from "./components/FooterComponent" ;
55import HeaderComponent from "./components/HeaderComponent" ;
6+ import Loader from "./components/Loader" ;
67
78import { useDataLayerValue } from "./context/DataLayer" ;
89
910import "./styles.css" ;
1011
1112export default function App ( ) {
12- const {
13- // state,//so es-lint does not brag!
14- put,
15- } = useDataLayerValue ( ) ;
13+ const { state, put } = useDataLayerValue ( ) ;
1614
1715 function handleClick1 ( ) {
1816 put ( { type : "INCREMENT_COUNTER_1_START" } ) ;
@@ -23,32 +21,46 @@ export default function App() {
2321 }
2422
2523 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+
4447 < 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+ </ >
5365 ) ;
5466}
0 commit comments