Skip to content

Commit

Permalink
[Filters] move buttons in filter item header to avoid mis-click
Browse files Browse the repository at this point in the history
fixes #164
  • Loading branch information
paulgirard committed Jun 14, 2024
1 parent 23e292b commit b5bcfed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/components/GraphFilters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const FilterInStack: FC<{
} else openFutureFilter(filterIndex);
}}
>
<div className="d-flex justify-content-between align-items-center">
<div className="d-flex align-items-center">
<div className="d-flex justify-content-between align-items-start">
<div className=" button-container">
{/* filter downstream ongoing edition => disabled */}
{!active && <RiFilterOffLine title={t("filters.desactivated").toString()} className="icon" />}
{active && filterIndex !== filters.past.length - 1 && (
Expand Down Expand Up @@ -91,7 +91,7 @@ const FilterInStack: FC<{
</div>
)}
</div>
<div className="d-flex align-items-center">
<div className=" button-container">
<button
className="btn btn-icon"
onClick={(e) => {
Expand Down Expand Up @@ -134,7 +134,9 @@ const GraphFilters: FC = () => {
if (filters.past.length !== 0) closeAllPastFilters();
}}
>
<GraphIcon className="icon" />
<div className="button-container">
<GraphIcon className="icon" />
</div>
<div>
<div className="fs-5">{t("filters.full_graph")}</div>
<div className="small text-muted">
Expand Down
12 changes: 10 additions & 2 deletions src/styles/_filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@
&.inactive {
@extend .text-muted;
}
.icon {
margin: 0 0.75rem;

.button-container {
// we center buttons vertically on two lines of fs-5 text (filter title)
height: calc(var(--bs-body-line-height) * #{$h5-font-size} * 2);
margin: 0 0.5rem;
display: flex;
align-items: center;
.btn-icon {
padding: 0;
}
}

&::after {
Expand Down

0 comments on commit b5bcfed

Please sign in to comment.