From 770b1e90a6683c4e0068b5d1f04e2b188bbe7cdf Mon Sep 17 00:00:00 2001 From: Bradley Shellnut Date: Wed, 26 Oct 2022 23:49:58 -0400 Subject: [PATCH] Adding collection dialog, showing dialog on clear click. --- .../dialog/ClearCollectionDialog.svelte | 84 +++++++++++++++++ .../preferences/gameCollection.svelte | 19 ++-- src/lib/components/preferences/profile.svelte | 5 +- src/routes/collection/+page.svelte | 93 +++++++++---------- 4 files changed, 147 insertions(+), 54 deletions(-) create mode 100644 src/lib/components/dialog/ClearCollectionDialog.svelte diff --git a/src/lib/components/dialog/ClearCollectionDialog.svelte b/src/lib/components/dialog/ClearCollectionDialog.svelte new file mode 100644 index 0000000..59598c0 --- /dev/null +++ b/src/lib/components/dialog/ClearCollectionDialog.svelte @@ -0,0 +1,84 @@ + + + { + boredState.update((n) => ({ ...n, dialog: { isOpen: false } })); + }} + static +> +
+ +
+ Clear collection + Are you sure you want to clear your collection? + + +
+
+
+ + diff --git a/src/lib/components/preferences/gameCollection.svelte b/src/lib/components/preferences/gameCollection.svelte index 8b805e3..050badf 100644 --- a/src/lib/components/preferences/gameCollection.svelte +++ b/src/lib/components/preferences/gameCollection.svelte @@ -1,8 +1,10 @@ @@ -44,9 +51,9 @@ - + diff --git a/src/lib/components/preferences/profile.svelte b/src/lib/components/preferences/profile.svelte index 6b57292..d84cd9f 100644 --- a/src/lib/components/preferences/profile.svelte +++ b/src/lib/components/preferences/profile.svelte @@ -2,6 +2,7 @@ import { fade } from 'svelte/transition'; import { Popover, PopoverButton, PopoverPanel } from '@rgossiaux/svelte-headlessui'; import { CogIcon } from '@rgossiaux/svelte-heroicons/outline'; + import { collectionStore } from '$root/lib/stores/collectionStore'; import Themes from './themes.svelte'; import GameCollection from './gameCollection.svelte'; @@ -40,7 +41,9 @@
- + {#if $collectionStore.length > 0} + + {/if}
diff --git a/src/routes/collection/+page.svelte b/src/routes/collection/+page.svelte index d6d410e..013e81c 100644 --- a/src/routes/collection/+page.svelte +++ b/src/routes/collection/+page.svelte @@ -1,67 +1,66 @@ - Your Collection | Bored Game + Your Collection | Bored Game

Your Collection

-
- {#if $collectionStore.length === 0} -

No games in your collection

- {:else} - {#each $collectionStore as game} - - {/each} - {/if} -
+
+ {#if $collectionStore.length === 0} +

No games in your collection

+ {:else} + {#each $collectionStore as game} + + {/each} + {/if} +