Using custom game store and updating colors of links.

This commit is contained in:
Bradley Shellnut 2022-07-12 18:27:08 -07:00
parent 7491c001da
commit f0691b9936
2 changed files with 7 additions and 4 deletions

View file

@ -6,9 +6,10 @@
import Listbox from '$lib/components/listbox.svelte'; import Listbox from '$lib/components/listbox.svelte';
import Loading from '$lib/components/loading.svelte'; import Loading from '$lib/components/loading.svelte';
import Portal from '$lib/Portal.svelte'; import Portal from '$lib/Portal.svelte';
import { gameStore } from '$lib/stores/gameSearchStore';
// import { enhance } from "$lib/form"; // import { enhance } from "$lib/form";
let games: GameType[] = []; // let games: GameType[] = [];
let submitting = false; let submitting = false;
async function handleSubmit(event: SubmitEvent) { async function handleSubmit(event: SubmitEvent) {
@ -22,7 +23,9 @@
}); });
const responseData = await response.json(); const responseData = await response.json();
submitting = false; submitting = false;
games = responseData?.games; gameStore.removeAll();
gameStore.addAll(responseData?.games);
// games = responseData?.games;
} }
let minAge = 0; let minAge = 0;
@ -131,7 +134,7 @@
<h1>Games</h1> <h1>Games</h1>
<div class="games"> <div class="games">
{#each games as game} {#each $gameStore as game}
<Game {game} /> <Game {game} />
{/each} {/each}
</div> </div>

View file

@ -181,7 +181,7 @@ body {
a { a {
text-decoration: none; text-decoration: none;
color: var(--color-text-primary); color: var(--clr-txt);
} }
fieldset { fieldset {