Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

badge toggles #75

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/simpleStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ const trueDefaults = {
Asc: true,
Unread: 0 as TriState,
Downloaded: 0 as TriState,
mangaMetaDefaults
mangaMetaDefaults,
downloadsBadge: true,
unreadbadge: true
};

type globalMeta = typeof trueDefaults;
Expand Down
12 changes: 8 additions & 4 deletions src/routes/(app)/(library)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,21 @@
{$Meta.Display === display.Comfortable && 'rounded-none rounded-t-lg'}"
>
<div class="absolute top-2 left-2 flex">
{#if manga.downloadCount}
{#if manga.downloadCount && $Meta.downloadsBadge}
<div
class="{manga.unreadCount ? 'rounded-l' : 'rounded'}
class="{manga.unreadCount && $Meta.unreadbadge
? 'rounded-l'
: 'rounded'}
variant-filled-primary m-0 py-0.5 px-1"
>
{manga.downloadCount}
</div>
{/if}
{#if manga.unreadCount}
{#if manga.unreadCount && $Meta.unreadbadge}
<div
class="{manga.downloadCount ? 'rounded-r' : 'rounded'}
class="{manga.downloadCount && $Meta.downloadsBadge
? 'rounded-r'
: 'rounded'}
variant-filled-secondary m-0 py-0.5 px-1"
>
{manga.unreadCount}
Expand Down
9 changes: 9 additions & 0 deletions src/routes/(app)/(library)/LibraryFilterModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
} from '@skeletonlabs/skeleton';
import { Meta, display, sort } from '$lib/simpleStores';
import { enumKeys } from '$lib/util';
import Slide from '$lib/components/Slide.svelte';
const modalStore = getModalStore();
let tabSet = localStorageStore('libraryModalTabs', 0);
</script>
Expand Down Expand Up @@ -107,6 +108,14 @@
{/each}
</RadioGroup>
{:else if $tabSet === 2}
<Slide
bind:checked={$Meta.downloadsBadge}
class="outline-0 p-1 pl-2 hover:variant-glass-surface w-full">Downloads Badge</Slide
>
<Slide
bind:checked={$Meta.unreadbadge}
class="outline-0 p-1 pl-2 hover:variant-glass-surface w-full">Unread Badge</Slide
>
<RadioGroup
rounded="rounded-container-token"
background="bg-transparent"
Expand Down