mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Icon update and type import.
This commit is contained in:
parent
ef854c57d3
commit
6f42d02737
2 changed files with 4 additions and 5 deletions
|
|
@ -1,9 +1,8 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import { MinusCircleIcon, PlusCircleIcon } from '@rgossiaux/svelte-heroicons/outline';
|
import { MinusCircleIcon, PlusCircleIcon } from '@rgossiaux/svelte-heroicons/outline';
|
||||||
import { ToastType, type GameType, type SavedGameType } from '$lib/types';
|
import type { GameType, SavedGameType } from '$lib/types';
|
||||||
import { collectionStore } from '$lib/stores/collectionStore';
|
import { collectionStore } from '$lib/stores/collectionStore';
|
||||||
import { toast } from '$lib/components/toast/toast';
|
|
||||||
import { addToCollection, removeFromCollection } from '$lib/util/manipulateCollection';
|
import { addToCollection, removeFromCollection } from '$lib/util/manipulateCollection';
|
||||||
|
|
||||||
export let game: GameType;
|
export let game: GameType;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import ExternalLink from '@rgossiaux/svelte-heroicons/outline/ExternalLink';
|
import { ExternalLinkIcon, MinusCircleIcon, MinusIcon, PlusCircleIcon, PlusIcon } from '@rgossiaux/svelte-heroicons/outline';
|
||||||
import { collectionStore } from '$lib/stores/collectionStore';
|
import { collectionStore } from '$lib/stores/collectionStore';
|
||||||
import type { GameType, SavedGameType } from '$lib/types';
|
import type { GameType, SavedGameType } from '$lib/types';
|
||||||
import { addToCollection, removeFromCollection } from '$lib/util/manipulateCollection';
|
import { addToCollection, removeFromCollection } from '$lib/util/manipulateCollection';
|
||||||
import { MinusCircleIcon, MinusIcon, PlusCircleIcon, PlusIcon } from '@rgossiaux/svelte-heroicons/outline';
|
|
||||||
|
|
||||||
$: existsInCollection = $collectionStore.find((item: SavedGameType) => item.id === game.id);
|
$: existsInCollection = $collectionStore.find((item: SavedGameType) => item.id === game.id);
|
||||||
export let game: GameType;
|
export let game: GameType;
|
||||||
|
|
@ -38,12 +37,13 @@ import { MinusCircleIcon, MinusIcon, PlusCircleIcon, PlusIcon } from '@rgossiaux
|
||||||
<p>Minimum Age: {game.min_age}</p>
|
<p>Minimum Age: {game.min_age}</p>
|
||||||
<p>Price: ${game?.price}</p>
|
<p>Price: ${game?.price}</p>
|
||||||
<a
|
<a
|
||||||
|
class="with-icon"
|
||||||
style="display: flex; gap: 1rem;"
|
style="display: flex; gap: 1rem;"
|
||||||
href={game.url}
|
href={game.url}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
aria-label={`Board Game Atlas Link for ${game.name}`}
|
aria-label={`Board Game Atlas Link for ${game.name}`}
|
||||||
>Board Game Atlas Link <ExternalLink width="24" height="24" /></a
|
>Board Game Atlas Link <ExternalLinkIcon width="24" height="24" /></a
|
||||||
>
|
>
|
||||||
{#if existsInCollection}
|
{#if existsInCollection}
|
||||||
<button class="btn" type="button" on:click={() => removeFromCollection(game)}
|
<button class="btn" type="button" on:click={() => removeFromCollection(game)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue