Skip to content

Commit 011da55

Browse files
Make panels reponsive
1 parent c4c9c3d commit 011da55

File tree

6 files changed

+71
-2
lines changed

6 files changed

+71
-2
lines changed

src/App.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@
3030
justify-content: space-around;
3131
align-items: center;
3232
}
33+
34+
.mainContent {
35+
padding: 0;
36+
}
3337
}

src/styles/CovidAppStyles.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,25 @@ export default {
1717
color: colors.purple,
1818
marginRight: "1rem",
1919
},
20+
21+
[sizes.down("md")]: {
22+
fontSize: "2.8rem",
23+
padding: "3rem",
24+
},
2025
},
2126

2227
content: {
2328
backgroundColor: (props) => (props.isDarkMode ? colors.darkPurple : "#fff"),
2429
borderRadius: "2rem",
2530
marginTop: "3rem",
2631
display: "flex",
27-
padding: "4rem",
2832
flexDirection: "column",
2933
justifyContent: "center",
34+
35+
[sizes.down("md")]: {
36+
marginTop: "2.5rem",
37+
padding: "1.5rem",
38+
},
3039
},
3140

3241
contentArea: {
@@ -47,6 +56,11 @@ export default {
4756
tableContainer: {
4857
padding: "2rem",
4958
margin: "5rem 0",
59+
60+
[sizes.down("md")]: {
61+
margin: "3.5rem 0",
62+
padding: "1.5rem",
63+
},
5064
},
5165

5266
tableHeading: {
@@ -58,6 +72,10 @@ export default {
5872
fontSize: "2.5rem",
5973
marginTop: "1.5rem",
6074
},
75+
76+
[sizes.down("md")]: {
77+
marginTop: ".5rem",
78+
},
6179
},
6280

6381
tinyChartArea: {
@@ -91,6 +109,10 @@ export default {
91109
animationDuration: "1s",
92110
animationTimingFunction: "linear",
93111
animationIterationCount: "infinite",
112+
113+
[sizes.down("md")]: {
114+
fontSize: "3rem",
115+
},
94116
},
95117

96118
loadingIcon: {
@@ -110,6 +132,9 @@ export default {
110132
},
111133

112134
button: {
135+
display: "flex",
136+
justifyContent: "center",
137+
alignItems: "center",
113138
border: "none",
114139
backgroundColor: colors.purple,
115140
padding: "1.5rem 3rem",
@@ -122,6 +147,13 @@ export default {
122147
boxShadow: "0 .5rem 1rem rgba(0,0,0,.2)",
123148
position: "relative",
124149

150+
[sizes.down("md")]: {
151+
fontSize: "1.5rem",
152+
borderRadius: "100px",
153+
marginLeft: 0,
154+
padding: "1rem",
155+
},
156+
125157
"&:hover": {
126158
backgroundColor: colors.darkPurple,
127159
boxShadow: "0 .25rem .5rem rgba(0,0,0,.2)",

src/styles/DarkModeButton.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,10 @@ input:checked+.slider:before {
6363

6464
.slider.round:before {
6565
border-radius: 50%;
66+
}
67+
68+
@media(max-width:991.98px) {
69+
.darkModeButton {
70+
margin-right: 2rem;
71+
}
6672
}

src/styles/DisplayPanelsStyles.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ export default {
2323
marginBottom: ".5rem",
2424
marginTop: "2.5rem",
2525
},
26+
27+
[sizes.down("md")]: {
28+
marginBottom: ".5rem",
29+
marginTop: "1.5rem",
30+
},
2631
},
2732

2833
heading: {
2934
fontSize: (props) => (props.isMiniPanel ? "1.5rem" : "2rem"),
3035
[sizes.down("lg")]: {
3136
fontSize: (props) => (props.isMiniPanel ? "1.2rem" : "1.7rem"),
3237
},
38+
[sizes.down("md")]: {
39+
fontSize: (props) => (props.isMiniPanel ? "1rem" : "1.5rem"),
40+
},
3341
},
3442

3543
number: {
@@ -50,9 +58,14 @@ export default {
5058
fontSize: (props) => (props.isMiniPanel ? "2.2rem" : "3.5rem"),
5159
paddingTop: ".5rem",
5260
paddingBottom: ".5rem",
61+
5362
[sizes.down("lg")]: {
5463
fontSize: (props) => (props.isMiniPanel ? "1.5rem" : "3rem"),
5564
},
65+
66+
[sizes.down("md")]: {
67+
fontSize: (props) => (props.isMiniPanel ? "1.5rem" : "2rem"),
68+
},
5669
},
5770

5871
dataChange: {

src/styles/NavbarStyles.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ export default {
99
width: "100%",
1010
},
1111
},
12+
1213
navItems: {
1314
listStyle: "none",
1415
[sizes.down("md")]: {
1516
display: "flex",
1617
justifyContent: "space-evenly",
1718
},
1819
},
20+
1921
navItem: {
2022
marginBottom: "5rem",
2123
fontWeight: "500",
@@ -26,10 +28,12 @@ export default {
2628
marginBottom: "2.5rem",
2729
},
2830
},
31+
2932
navLinks: {
3033
textDecoration: "none",
3134
color: "inherit",
3235
},
36+
3337
iconBox: {
3438
display: "flex",
3539
zIndex: "50",
@@ -42,6 +46,7 @@ export default {
4246
zIndex: "50",
4347
},
4448
},
49+
4550
icons: {
4651
fontSize: "2.5rem",
4752
zIndex: "50",

src/styles/OverviewStyles.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sizes from "./sizes";
2+
13
export default {
24
root: {
35
textAlign: "center",
@@ -6,9 +8,16 @@ export default {
68
display: "flex",
79
justifyContent: "space-evenly",
810
alignItems: "center",
11+
12+
[sizes.down("sm")]: {
13+
flexWrap: "wrap",
14+
padding: "0 1rem",
15+
},
916
},
1017
panelContainer: {
1118
width: "20%",
12-
// padding: ''
19+
[sizes.down("sm")]: {
20+
width: "40%",
21+
},
1322
},
1423
};

0 commit comments

Comments
 (0)