blob: 6591cefd10e11847f74eb554d10bde26741b794e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<script lang="ts">
import { page } from '$app/stores';
import { ComicFilterContext, cycleBooleanFilter, getFilterContext } from '$lib/Filter';
import { accelerator } from '$lib/Shortcuts';
import Star from '$lib/icons/Star.svelte';
const filter = getFilterContext<ComicFilterContext>();
$: favourite = $filter.include.controls.favourite.value;
const toggle = () => {
$filter.include.controls.favourite.value = cycleBooleanFilter(favourite, false);
$filter.apply($page.url.searchParams);
};
</script>
<button
class:toggled={favourite}
class="btn-slate"
title="Filter favourites"
on:click={toggle}
use:accelerator={'f'}
>
<Star {favourite} />
</button>
|