Skip to content

Commit

Permalink
filtering by click on "Top 6 levels" item
Browse files Browse the repository at this point in the history
  • Loading branch information
LbP22 committed Nov 8, 2023
1 parent 654889c commit d436453
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions application/frontend/src/lib/Stats/Stats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
padding: 0;
margin: 0 0 6px 0;
font-size: $main-font-s;
cursor: pointer;
& :hover {
transform: scale(1.02);
}
}

.statsTittle {
Expand Down
10 changes: 9 additions & 1 deletion application/frontend/src/lib/Stats/Stats.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
lastChosenHost,
lastChosenService,
lastStatsPeriod,
chosenStatus
} from "../../Stores/stores.js";
import fetchApi from "../../utils/fetch";
import { navigate } from "svelte-routing";
Expand Down Expand Up @@ -90,7 +91,14 @@
return 1;
}
}) as [key, name]}
<li class="flex spaceBetween statsItem">
<li class="flex spaceBetween statsItem"
on:click={async () => {
if ($chosenStatus !== key) {
chosenStatus.set(key);
} else {
chosenStatus.set("");
}
}}>
<p class={key}>{key.charAt(0).toUpperCase() + key.slice(1)}</p>
<p>{name}</p>
</li>
Expand Down

0 comments on commit d436453

Please sign in to comment.