Skip to content

Commit bece733

Browse files
committed
Response header buttons
1 parent 6e96627 commit bece733

File tree

4 files changed

+81
-19
lines changed

4 files changed

+81
-19
lines changed
Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,70 @@
11
.HeaderButtons {
22
display: flex;
33
flex-direction: row;
4+
5+
justify-content: flex-end;
6+
}
7+
8+
.question__header__fixed .HeaderButtons {
9+
flex: 1;
410
}
511

6-
.question__header__fixed--show .questions__header__reset {
7-
background-color: #e74c3c;
12+
.question__header__fixed--show .HeaderButtons__button {
13+
background-color: rgba(231, 77, 60, 1);
814
color: white;
9-
right: 16px;
10-
top: 13px;
15+
1116
font-size: 14px;
1217
padding: 6px;
1318
}
1419

15-
.questions__header__reset {
20+
.HeaderButtons__button {
1621
background-color: transparent;
17-
color: #e74c3c;
22+
color: rgba(231, 77, 60, 1);
1823
border-radius: 4px;
1924
border: none;
2025
outline: none;
2126
font-size: 16px;
2227

2328
padding: 8px;
29+
transition: 0.5s ease all;
30+
}
31+
32+
.question__header__fixed--show .HeaderButtons__button--completed {
33+
background-color: rgba(243, 157, 18, 1);
2434
}
2535

26-
.questions__header__hide {
27-
color: #e67e22;
36+
.HeaderButtons__button--completed {
37+
color: rgba(243, 157, 18, 1);
38+
margin-left: 8px;
2839
}
2940

30-
.questions__header__reset:hover {
41+
/* Hover */
42+
.question__header__fixed--show .HeaderButtons__button:hover {
43+
background: rgba(231, 77, 60, 1);
44+
}
45+
.HeaderButtons__button:hover {
46+
cursor: pointer;
47+
background: rgba(231, 77, 60, 0.2);
48+
}
49+
.question__header__fixed--show .HeaderButtons__button--completed:hover {
50+
background: rgba(243, 157, 18, 1);
51+
}
52+
.HeaderButtons__button--completed:hover {
3153
cursor: pointer;
54+
background: rgba(243, 157, 18, 0.2);
3255
}
3356

34-
@media (max-width: 350px) {
35-
.questions__header__reset {
36-
right: 8px;
57+
@media (max-width: 600px) {
58+
.question__header__fixed .HeaderButtons {
59+
flex: auto;
60+
}
61+
.HeaderButtons {
62+
flex-direction: row;
63+
align-items: center;
64+
justify-content: space-between;
65+
}
66+
.HeaderButtons__button {
67+
margin: 0 8px;
68+
width: 100%;
3769
}
3870
}

src/ui/QuestionsHeader/HeaderButtons/HeaderButtons.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import "./HeaderButtons.css";
44
const HeaderButtons = ({ resetItems }) => {
55
return (
66
<div className="HeaderButtons">
7-
<button className="questions__header__reset" onClick={resetItems}>
7+
<button className="HeaderButtons__button" onClick={resetItems}>
88
Reset
99
</button>
1010
<button
11-
className="questions__header__reset questions__header__hide"
11+
className="HeaderButtons__button HeaderButtons__button--completed"
1212
onClick={resetItems}
1313
>
1414
Hide Completed

src/ui/QuestionsHeader/QuestionsHeader.css

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
margin-bottom: 24px;
77
font-size: 28px;
88
font-weight: bold;
9-
text-align: center;
9+
justify-content: flex-start;
1010
position: relative;
1111

1212
box-sizing: border-box;
@@ -24,7 +24,6 @@
2424
.question__header__fixed {
2525
position: fixed;
2626
background: #27ae60;
27-
2827
color: white;
2928
top: 0px;
3029
left: 0px;
@@ -36,7 +35,7 @@
3635
transition: 0.3s all ease;
3736
padding: 16px;
3837
border-radius: 0px;
39-
font-size: 20px;
38+
font-size: 28px;
4039
line-height: 22px;
4140
}
4241

@@ -45,3 +44,33 @@
4544
z-index: 100;
4645
pointer-events: all;
4746
}
47+
48+
.questions__header_text {
49+
justify-content: flex-start;
50+
}
51+
52+
.question__header__fixed .questions__header_text {
53+
flex: 1;
54+
justify-content: center;
55+
text-align: center;
56+
}
57+
58+
.questions__header__spacer {
59+
flex: 1;
60+
}
61+
62+
@media (max-width: 600px) {
63+
.questions__header {
64+
flex-direction: column;
65+
justify-content: center;
66+
padding: 12px;
67+
}
68+
.questions__header__spacer {
69+
flex: 0;
70+
}
71+
.questions__header_text {
72+
flex: auto;
73+
margin-bottom: 10px;
74+
text-align: center;
75+
}
76+
}

src/ui/QuestionsHeader/QuestionsHeader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ const QuestionsHeader = ({ items, questions, isFixed, resetItems }) => {
1414
<div
1515
className={`questions__header ${fixedClass} ${showFixed} ${hideNoneFixed}`}
1616
>
17-
<span>
17+
{isFixed ? <div className="questions__header__spacer"></div> : null}
18+
<div className="questions__header_text">
1819
{!items ? 0 : items.length}/{questions.length}
19-
</span>
20+
</div>
2021
<HeaderButtons resetItems={resetItems} />
2122
</div>
2223
);

0 commit comments

Comments
 (0)