Skip to content

Commit e2a4d6d

Browse files
Final-imp-done
1 parent b52c86c commit e2a4d6d

File tree

2 files changed

+71
-10
lines changed

2 files changed

+71
-10
lines changed

src/App.css

+49-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
body {
2+
overflow: hidden;
3+
}
14
.App {
25
display: flex;
36
justify-content: center;
@@ -15,11 +18,55 @@
1518
font-size: 2rem;
1619
letter-spacing: 10px;
1720
}
18-
.App .Inc-btn {
21+
.App .btn-group {
22+
display: flex;
23+
width: 80vh;
24+
justify-content: space-around;
25+
}
26+
.App .btn-group .Inc-btn,
27+
.App .btn-group .Dec-btn {
1928
font-size: 1rem;
2029
font-weight: 600;
2130
padding: 1rem;
22-
width: 10rem;
2331
letter-spacing: 3px;
2432
cursor: pointer;
33+
width: 40%;
34+
}
35+
@media only screen and (max-width: 1000px) {
36+
.App .App-Name {
37+
font-size: 2rem;
38+
}
39+
.App .Current-State {
40+
font-size: 1.7rem;
41+
}
42+
}
43+
@media only screen and (max-width: 510px) {
44+
.App .btn-group {
45+
width: 50vh;
46+
}
47+
.App .btn-group .Inc-btn,
48+
.App .btn-group .Dec-btn {
49+
font-size: 1rem;
50+
font-weight: 600;
51+
padding: 0.5rem;
52+
letter-spacing: 3px;
53+
cursor: pointer;
54+
width: 40%;
55+
}
56+
}
57+
@media only screen and (max-width: 308px) {
58+
.App .App-Name {
59+
font-size: 1.3rem;
60+
}
61+
.App .Current-State {
62+
font-size: 1rem;
63+
}
64+
.App .btn-group {
65+
flex-direction: column;
66+
justify-content: center;
67+
align-items: center;
68+
}
69+
.App .btn-group > button {
70+
margin: 5px 0px;
71+
}
2572
}

src/App.js

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
import "./App.css";
2-
import Increment from "./redux/actions/counter.action.js";
2+
import React from "react";
3+
// import Increment from "./redux/actions/counter.action.js";
34
import { useSelector, useDispatch } from "react-redux";
45
function App() {
56
const counter = useSelector((store) => store.counter);
67
const trigger = useDispatch();
78
return (
8-
<div className="App">
9-
<h1 className="App-Name">CounterApp</h1>
10-
<h3 className="Current-State">Counter: {counter}</h3>
11-
<button onClick={() => trigger(Increment)} className="Inc-btn">
12-
Increment
13-
</button>
14-
</div>
9+
<React.Fragment>
10+
<div className="App">
11+
<h1 className="App-Name">CounterApp</h1>
12+
<h3 className="Current-State">Counter: {counter}</h3>
13+
<div className="btn-group">
14+
<button
15+
onClick={() => trigger({ type: "INCREMENT" })}
16+
className="Inc-btn"
17+
>
18+
Increment
19+
</button>
20+
<button
21+
onClick={() => trigger({ type: "DECREMENT" })}
22+
className="Dec-btn"
23+
>
24+
Decrement
25+
</button>
26+
</div>
27+
</div>
28+
</React.Fragment>
1529
);
1630
}
1731

0 commit comments

Comments
 (0)