Skip to content

Commit b5bcfed

Browse files
committed
[Filters] move buttons in filter item header to avoid mis-click
fixes #164
1 parent 23e292b commit b5bcfed

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/components/GraphFilters/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ const FilterInStack: FC<{
4848
} else openFutureFilter(filterIndex);
4949
}}
5050
>
51-
<div className="d-flex justify-content-between align-items-center">
52-
<div className="d-flex align-items-center">
51+
<div className="d-flex justify-content-between align-items-start">
52+
<div className=" button-container">
5353
{/* filter downstream ongoing edition => disabled */}
5454
{!active && <RiFilterOffLine title={t("filters.desactivated").toString()} className="icon" />}
5555
{active && filterIndex !== filters.past.length - 1 && (
@@ -91,7 +91,7 @@ const FilterInStack: FC<{
9191
</div>
9292
)}
9393
</div>
94-
<div className="d-flex align-items-center">
94+
<div className=" button-container">
9595
<button
9696
className="btn btn-icon"
9797
onClick={(e) => {
@@ -134,7 +134,9 @@ const GraphFilters: FC = () => {
134134
if (filters.past.length !== 0) closeAllPastFilters();
135135
}}
136136
>
137-
<GraphIcon className="icon" />
137+
<div className="button-container">
138+
<GraphIcon className="icon" />
139+
</div>
138140
<div>
139141
<div className="fs-5">{t("filters.full_graph")}</div>
140142
<div className="small text-muted">

src/styles/_filters.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
&.inactive {
88
@extend .text-muted;
99
}
10-
.icon {
11-
margin: 0 0.75rem;
10+
11+
.button-container {
12+
// we center buttons vertically on two lines of fs-5 text (filter title)
13+
height: calc(var(--bs-body-line-height) * #{$h5-font-size} * 2);
14+
margin: 0 0.5rem;
15+
display: flex;
16+
align-items: center;
17+
.btn-icon {
18+
padding: 0;
19+
}
1220
}
1321

1422
&::after {

0 commit comments

Comments
 (0)